@Override public String toString() { StringBuffer result = new StringBuffer("["); LinkedSeq scan = this; while (scan != null) { result.append(scan.item); scan = scan.rest; result.append(" "); } return result.append("]").toString(); }
public String toShortString() { StringBuffer buf = new StringBuffer(); buf.append("DisjointSet{node="); buf.append(m_node); buf.append(",parent="); buf.append( (getParent() == this) ? "self" : (getParent() == null ? "null" : getParent().toShortString())); buf.append("...}"); return buf.toString(); }
/** * @see java.lang.Object#toString() * @return A string representation of this set for debugging */ @Override public String toString() { StringBuffer buf = new StringBuffer(); buf.append("DisjointSet{node="); buf.append(m_node); buf.append(",anc="); buf.append( (getAncestor() == this) ? "self" : (getAncestor() == null ? "null" : getAncestor().toShortString())); buf.append(",parent="); buf.append( (getParent() == this) ? "self" : (getParent() == null ? "null" : getParent().toShortString())); buf.append(",rank="); buf.append(getRank()); buf.append(m_black ? ",black" : ",white"); buf.append("}"); return buf.toString(); }