public abstract class AbstractTraversable<E> extends java.lang.Object implements Traversable<E>
| Constructor and Description |
|---|
AbstractTraversable() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isEmpty()
Returns true if this collection is empty.
|
java.lang.String |
makeString(java.lang.String separator)
Returns this collection converted to a string by joining elements together with the specified
separator. |
java.lang.String |
makeString(java.lang.String separator,
java.lang.String prefix,
java.lang.String postfix,
int limit,
java.lang.String truncated)
Returns this collection converted to a string.
|
int |
size()
Returns the size of the collection.
|
<R extends Traversable<E>> |
to(Builder<E,R> builder)
Converts this collection to another collection using a builder.
|
java.lang.Object[] |
toArray()
Converts this collection to an array of objects.
|
E[] |
toArray(E[] array)
Converts this collection to an array of objects of the correct type.
|
IndexedList<E> |
toIndexedList()
Converts this collection to an indexed list.
|
Set<E> |
toSet()
Converts this collection to a set.
|
SortedSet<E> |
toSortedSet(java.util.Comparator<? super E> comparator)
Converts this collection to a sorted set.
|
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEachpublic int size()
TraversableWarning: infinite collections are possible, as are collections that require traversal to calculate the size.
size in interface Traversable<E>@NotNull
public java.lang.String makeString(@NotNull
java.lang.String separator)
Traversableseparator.makeString in interface Traversable<E>@NotNull
public java.lang.String makeString(@NotNull
java.lang.String separator,
@NotNull
java.lang.String prefix,
@NotNull
java.lang.String postfix,
int limit,
@NotNull
java.lang.String truncated)
TraversablemakeString in interface Traversable<E>separator - Specifies the joining characterprefix - Specifies a prefix to the stringpostfix - Species a postfix to the stringlimit - Specifies the maximum number of elements to join. If the limit is exceeded, additional elements are ignored.truncated - If the limit is reached, the truncated value will be appended to indicate the limit was reached.public java.lang.String toString()
toString in class java.lang.Object@NotNull public <R extends Traversable<E>> R to(@NotNull Builder<E,R> builder)
Traversableto in interface Traversable<E>@NotNull public Set<E> toSet()
TraversabletoSet in interface Traversable<E>@NotNull public SortedSet<E> toSortedSet(java.util.Comparator<? super E> comparator)
TraversabletoSortedSet in interface Traversable<E>@NotNull public IndexedList<E> toIndexedList()
TraversabletoIndexedList in interface Traversable<E>public boolean isEmpty()
TraversableisEmpty in interface Traversable<E>@NotNull public java.lang.Object[] toArray()
TraversabletoArray in interface Traversable<E>@NotNull public E[] toArray(E[] array)
TraversabletoArray in interface Traversable<E>