Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void add(Song song){
- int pos = song.hashCode() % this.length;
- ListElement node = new ListElement(song,null);
- if(this.entries[pos]==null){
- this.entries[pos] = node;
- }else {
- this.entries[pos].setNext(node);
- }
- }
- public Song lookupTitle(String titel) {
- int pos = titel.hashCode() % this.length;
- ListElement node = this.entries[pos];
- while(node != null) {
- if(node.getValue().getTitel().equals(titel)) {
- return node.getValue();
- }
- node = node.getNext();
- }
- return null;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement