Class AbstractTraversable<E>
java.lang.Object
com.github.andrewoma.dexx.collection.internal.base.AbstractTraversable<E>
- All Implemented Interfaces:
Traversable<E>
- Direct Known Subclasses:
AbstractIterable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisEmpty()Returns true if this collection is empty.@NotNull StringmakeString(@NotNull String separator) Returns this collection converted to a string by joining elements together with the specifiedseparator.@NotNull StringmakeString(@NotNull String separator, @NotNull String prefix, @NotNull String postfix, int limit, @NotNull String truncated) Returns this collection converted to a string.intsize()Returns the size of the collection.<R extends Traversable<E>>
RConverts this collection to another collection using a builder.@NotNull Object[]toArray()Converts this collection to an array of objects.E[]Converts this collection to an array of objects of the correct type.@NotNull IndexedList<E> Converts this collection to an indexed list.toSet()Converts this collection to a set.toSortedSet(Comparator<? super E> comparator) Converts this collection to a sorted set.toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Traversable
forEach
-
Constructor Details
-
AbstractTraversable
public AbstractTraversable()
-
-
Method Details
-
size
public int size()Description copied from interface:TraversableReturns the size of the collection.Warning: infinite collections are possible, as are collections that require traversal to calculate the size.
- Specified by:
sizein interfaceTraversable<E>
-
makeString
Description copied from interface:TraversableReturns this collection converted to a string by joining elements together with the specifiedseparator.- Specified by:
makeStringin interfaceTraversable<E>
-
makeString
@NotNull public @NotNull String makeString(@NotNull @NotNull String separator, @NotNull @NotNull String prefix, @NotNull @NotNull String postfix, int limit, @NotNull @NotNull String truncated) Description copied from interface:TraversableReturns this collection converted to a string.- Specified by:
makeStringin interfaceTraversable<E>- Parameters:
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, thetruncatedvalue will be appended to indicate the limit was reached.
-
toString
-
to
Description copied from interface:TraversableConverts this collection to another collection using a builder.- Specified by:
toin interfaceTraversable<E>
-
toSet
Description copied from interface:TraversableConverts this collection to a set.- Specified by:
toSetin interfaceTraversable<E>
-
toSortedSet
Description copied from interface:TraversableConverts this collection to a sorted set.- Specified by:
toSortedSetin interfaceTraversable<E>
-
toIndexedList
Description copied from interface:TraversableConverts this collection to an indexed list.- Specified by:
toIndexedListin interfaceTraversable<E>
-
isEmpty
public boolean isEmpty()Description copied from interface:TraversableReturns true if this collection is empty.- Specified by:
isEmptyin interfaceTraversable<E>
-
toArray
Description copied from interface:TraversableConverts this collection to an array of objects.- Specified by:
toArrayin interfaceTraversable<E>
-
toArray
Description copied from interface:TraversableConverts this collection to an array of objects of the correct type.- Specified by:
toArrayin interfaceTraversable<E>
-