Parse implements Cloneable, Comparable<Parse> { @Override public boolean equals(Object o) { if (o instanceof Parse) { Parse p = (Parse) o; if (this.label == null) { if (p.label != null) { return false; } } else if (!this.label.equals(p.label)) { return false; } if (!this.span.equals(p.span)) { return false; } if (!this.text.equals(p.text)) { return false; } if (this.parts.size() != p.parts.size()){ return false; } for (int ci=0;ci<parts.size();ci++) { if (!parts.get(ci).equals(p.parts.get(ci))) { return false; } } return true; } return false; } Parse(String text, Span span, String type, double p, int index);  Parse(String text, Span span, String type, double p, Parse h); @Override Object clone(); Parse clone(Parse node); Parse cloneRoot(Parse node, int parseIndex); static void useFunctionTags(boolean uft); void setType(String type); String getType(); Collection<Parse> getPreviousPunctuationSet(); void addPreviousPunctuation(Parse punct); Collection<Parse> getNextPunctuationSet(); void addNextPunctuation(Parse punct); void setNextPunctuation(Collection<Parse> punctSet); void setPrevPunctuation(Collection<Parse> punctSet); void insert(final Parse constituent); void show(StringBuffer sb); void show(); double getTagSequenceProb(); boolean complete(); String getCoveredText(); @Override String toString(); String getText(); Span getSpan(); double getProb(); void addProb(double logProb); Parse[] getChildren(); void setChild(int index, String label); void add(Parse daughter, HeadRules rules); void remove(int index); Parse adjoinRoot(Parse node, HeadRules rules, int parseIndex); Parse adjoin(Parse sister, HeadRules rules); void expandTopNode(Parse root); int getChildCount(); int indexOf(Parse child); Parse getHead(); int getHeadIndex(); String getLabel(); void setLabel(String label); void updateHeads(HeadRules rules); void updateSpan(); static void pruneParse(Parse parse); static void fixPossesives(Parse parse); static Parse parseParse(String parse); static Parse parseParse(String parse, GapLabeler gl); Parse getParent(); void setParent(Parse parent); boolean isPosTag(); boolean isFlat(); void isChunk(boolean ic); boolean isChunk(); Parse[] getTagNodes(); Parse getCommonParent(Parse node); @Override boolean equals(Object o); @Override int hashCode(); int compareTo(Parse p); StringBuffer getDerivation(); void setDerivation(StringBuffer derivation); void showCodeTree(); static void addNames(String tag, Span[] names, Parse[] tokens); @Deprecated static void main(String[] args); static final String BRACKET_LRB; static final String BRACKET_RRB; static final String BRACKET_LCB; static final String BRACKET_RCB; }
@Test public void testEquals() { Parse p1 = Parse.parseParse(PARSE_STRING); assertTrue(p1.equals(p1)); }