83 84 public final boolean isFromMain() { 85 return location().isFromMainFile(); 86 } 87 88 public final boolean isFromSystem() { 89 return location().isInSystemHeader(); 90 } 91 92 @Override 93 public final boolean equals(Object obj) { 94 if (this == obj) { 95 return true; 96 } 97 98 if (!(obj instanceof Tree)) { 99 return false; 100 } 101 102 Tree t = (Tree)obj; 103 return name.equals(t.name()) && c.equals(t.cursor()); 104 } 105 106 @Override 107 public final int hashCode() { 108 return name.hashCode() ^ c.hashCode(); 109 } 110 111 @Override 112 public final String toString() { 113 return Printer.Stringifier(p -> p.dumpCursor(c, true)); 114 } 115 116 public <R,D> R accept(TreeVisitor<R,D> visitor, D data) { 117 return visitor.visitTree(this, data); 118 } 119 } | 83 84 public final boolean isFromMain() { 85 return location().isFromMainFile(); 86 } 87 88 public final boolean isFromSystem() { 89 return location().isInSystemHeader(); 90 } 91 92 @Override 93 public final boolean equals(Object obj) { 94 if (this == obj) { 95 return true; 96 } 97 98 if (!(obj instanceof Tree)) { 99 return false; 100 } 101 102 Tree t = (Tree)obj; 103 return name.equals(t.name()) && location().equals(t.location()); 104 } 105 106 @Override 107 public final int hashCode() { 108 return name.hashCode() ^ location().hashCode(); 109 } 110 111 @Override 112 public final String toString() { 113 return Printer.Stringifier(p -> p.dumpCursor(c, true)); 114 } 115 116 public <R,D> R accept(TreeVisitor<R,D> visitor, D data) { 117 return visitor.visitTree(this, data); 118 } 119 } |