    001    package org.maltparser.core.symbol.trie;
    002
    003    /**
    004
    005    @author Johan Hall
    006    @since 1.0
    007    */
    008    public class TrieEntry {
    009            private int code;
    010    //      private boolean known;
    011
    012            public TrieEntry(int code, boolean known) {
    013                    this.code = code;
    014    //              this.known = known;
    015            }
    016
    017            public int getCode() {
    018                    return code;
    019            }
    020
    021    //      public boolean isKnown() {
    022    //              return known;
    023    //      }
    024    //
    025    //      public void setKnown(boolean known) {
    026    //              this.known = known;
    027    //      }
    028
    029            public boolean equals(Object obj) {
    030                    if (this == obj)
    031                            return true;
    032                    if (obj == null)
    033                            return false;
    034                    if (getClass() != obj.getClass())
    035                            return false;
    036                    return code == ((TrieEntry)obj).code; // && known == ((TrieEntry)obj).known;
    037            }
    038
    039
    040            public int hashCode() {
    041                    return  31 * 7 + code;
    042    //              int hash = 7;
    043    //              hash = 31 * hash + code;
    044    //              return 31 * hash + (known ? 1 : 0);
    045            }
    046
    047
    048            public String toString() {
    049                    final StringBuilder sb = new StringBuilder();
    050                    sb.append(code);
    051    //              sb.append(' ');
    052    //              sb.append(known);
    053                    return sb.toString();
    054            }
    055    }