
Tagged Collection ADTs 795
TaggedCollection
public Collection<E> values() {
Collection<E> coll = new Array<E>(getSize());
for (TaggedElement<T, E> te : this)
coll.add(te.element);
return coll;
}
The toString method returns a string that describes each tagged element in the collection.
public String toString() {
return pairs.toString();
}
The accept method takes v, a visitor. It traverses the entire collection on behalf of a visitor.
It throws a VisitAbortedException when the traversal is aborted due to an exception raised by the
visitor, in which case the cause held by the VisitAbortedException is the exception thrown by the
visitor.
public void accept(Visitor ...