Guest User

Untitled

a guest
May 23rd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. public boolean add(Topic topic) {
  2. if (topic == null) {
  3. return false;
  4. }
  5.  
  6. if (!contains(topic)) {
  7. InterestListElem newElem = new InterestListElem(topic);
  8. + // newElem weight muss auf 1 gesetzt werden
  9. + // -0.5p
  10.  
  11. if (first != null) {
  12. newElem.setNext(first);
  13. }
  14. first = newElem;
  15.  
  16. return true;
  17. } else {
  18. find(topic).increaseWeight(1);
  19. return false;
  20. }
  21. }
Add Comment
Please, Sign In to add comment