1 8 9 package net.sourceforge.chaperon.model.symbol; 10 11 17 public class Terminal extends Symbol 18 { 19 24 public Terminal(String name) 25 { 26 super(name); 27 } 28 29 34 public int hashCode() 35 { 36 return name.hashCode()<<1; 37 } 38 39 46 public boolean equals(Object o) 47 { 48 if (o==this) 49 return true; 50 51 if ((o!=null) && (o instanceof Terminal)) 52 { 53 Symbol symbol = (Terminal)o; 54 55 return symbol.name.equals(name); 56 } 57 58 return false; 59 } 60 } 61 | Popular Tags |