Ejemplo n.º 1
0
 public void search(String keyword) {
   GenreNode curr = this.head;
   String cache = "";
   for (curr = this.head.getNextGenre(); curr != null; curr = curr.getNextGenre()) {
     for (TitleNode curr2nd = curr.getTitleHead().getNextTitle();
         curr2nd != null;
         curr2nd = curr2nd.getNextTitle()) {
       if (curr2nd.getTitleData().contains(keyword)) {
         System.out.println("(" + curr.getGenreData() + ", " + curr2nd.getTitleData() + ")");
         cache = "*";
       }
     }
   }
   if (cache.equals("")) {
     System.out.println("EMPTY");
   }
 }
Ejemplo n.º 2
0
 public TitleNode findTitleNode(String title) {
   TitleNode curr = this.getTitleHead();
   while (curr != null) {
     if (curr.getTitleData().equals(title)) {
       return curr;
     }
     curr = curr.getNextTitle();
   }
   return null;
 }
Ejemplo n.º 3
0
 public boolean isExistTitle(String title) {
   TitleNode curr = this.getTitleHead();
   while (curr != null) {
     if (curr.getTitleData().equals(title)) {
       return true;
     }
     curr = curr.getNextTitle();
   }
   return false;
 }
Ejemplo n.º 4
0
  public void printListAll(List printList) {
    GenreNode curr = printList.head;
    if (curr.getNextGenre() == null) {
      System.out.println("EMPTY");
    } else {
      for (curr = printList.head.getNextGenre(); curr != null; curr = curr.getNextGenre()) {

        for (TitleNode curr2nd = curr.getTitleHead().getNextTitle();
            curr2nd != null;
            curr2nd = curr2nd.getNextTitle()) {

          System.out.println("(" + curr.getGenreData() + ", " + curr2nd.getTitleData() + ")");
        }
      }
    }
  }