edu.rice.cs.plt.object
Interface Composite
- All Known Implementing Classes:
- BinaryMappedIterable, BinaryMappedIterator, CartesianIterable, CartesianIterator, CartesianRelation, CollapsedIterable, CollapsedIterator, ComplementRelation, ComplementSet, ComposedIterable, ComposedIterator, ComposedMap, ConsList, ConsList.Empty, ConsList.Nonempty, DelegatingCollection, DelegatingList, DelegatingMap, DelegatingRelation, DelegatingSet, DiagonalCartesianIterable, DiagonalCartesianIterator, FilteredIterable, FilteredIterator, FilteredRelation, FilteredSet, FiniteSequenceIterable, ImmutableCollection, ImmutableIterable, ImmutableIterator, ImmutableMap, ImmutableMapEntry, ImmutableRelation, ImmutableSet, IntersectionRelation, IntersectionSet, IterableCollection, IterableSet, ListenerSet, MappedIterable, MappedIterator, MappedMap, NoDuplicatesIterator, OutputStreamSplitter, PermutationIterable, RemoveNotificationIterator, SkipFirstIterable, SkipLastIterable, SkipLastIterator, SnapshotSynchronizedList, SnapshotSynchronizedSet, SplitLogSink, TruncatedIterable, TruncatedIterator, UnionMap, UnionRelation, UnionSet, WrappedDirectInputStream, WrappedDirectOutputStream, WrappedDirectReader, WrappedDirectWriter, WriterSplitter
public interface Composite
An object that can contain similar objects in a tree-like structure. Typically, this is
used where an object is normally composed of other objects of the same type, thus
allowing data structures of arbitrary size. In such cases, it may be useful to "collapse"
the structure into a more efficient representation if it grows too large, and this interface
provides the means to determine when such an optimization should take place.
|
Method Summary |
int |
compositeHeight()
Get the maximum path length from this node to a leaf. |
int |
compositeSize()
Get the number of nodes in the tree rooted at this node. |
compositeHeight
int compositeHeight()
- Get the maximum path length from this node to a leaf.
compositeSize
int compositeSize()
- Get the number of nodes in the tree rooted at this node. Always 1 or greater.