public interface PrimitiveIterable
| Modifier and Type | Method and Description |
|---|---|
default void |
appendString(Appendable appendable)
Prints a string representation of this collection onto the given
Appendable. |
default void |
appendString(Appendable appendable,
String separator)
Prints a string representation of this collection onto the given
Appendable. |
void |
appendString(Appendable appendable,
String start,
String separator,
String end)
Prints a string representation of this collection onto the given
Appendable. |
default boolean |
isEmpty()
Returns true if this iterable has zero items.
|
default String |
makeString()
Returns a string representation of this collection by delegating to
makeString(String) and defaulting
the separator parameter to the characters ", " (comma and space). |
default String |
makeString(String separator)
Returns a string representation of this collection by delegating to
makeString(String, String, String)
and defaulting the start and end parameters to "" (the empty String). |
default String |
makeString(String start,
String separator,
String end)
Returns a string representation of this collection with the elements separated by the specified
separator and enclosed between the start and end strings.
|
default boolean |
notEmpty()
The English equivalent of !this.isEmpty()
|
int |
size()
Returns the number of items in this iterable.
|
String |
toString()
Returns a string with the elements of this iterable separated by commas with spaces and
enclosed in square brackets.
|
int size()
default boolean isEmpty()
default boolean notEmpty()
String toString()
Assert.assertEquals("[]", IntLists.mutable.empty().toString());
Assert.assertEquals("[1]", IntLists.mutable.with(1).toString());
Assert.assertEquals("[1, 2, 3]", IntLists.mutable.with(1, 2, 3).toString());
toString in class ObjectAbstractCollection.toString()default String makeString()
makeString(String) and defaulting
the separator parameter to the characters ", " (comma and space).default String makeString(String separator)
makeString(String, String, String)
and defaulting the start and end parameters to "" (the empty String).default String makeString(String start, String separator, String end)
default void appendString(Appendable appendable)
Appendable. Prints the string returned
by makeString().default void appendString(Appendable appendable, String separator)
Appendable. Prints the string returned
by makeString(String).void appendString(Appendable appendable, String start, String separator, String end)
Appendable. Prints the string returned
by makeString(String, String, String).Copyright © 2004–2017. All rights reserved.