SCreateList
int ro size
The number of Objects in the list
List<Object> asList()
Returns a List of Objects with the same contents as this one.
boolean contains(Object object)
Returns true if
object
is in this list.
Parameters:
SList<Object> create(Collection<Object> list)
For each element in
list
, creates a new Object and initializes it from that element, then adds it to this list.
Parameters:
SList<Object> create(Object... content)
For each argument, creates a new Object and initializes it from that argument, then adds it to the list.
Parameters:
Object create(Object content)
Creates a new Object, initializes it from
content
, then adds it to the list.
Parameters:
SList<Object> create(int count)
Adds
count
new Objects to the list, and returns a sublist containing the new Objects.
Parameters:
Object create()
Creates a new Object and adds it to the list.
void each(Closure block)
Executes the code in
block
on each Object in this list.
Parameters:
void forEach(Consumer<Object> action)
Performs the given action for each element of the
Iterable
until all elements have been processed or the action throws an exception. Unless otherwise specified by the implementing class, actions are performed in the order of iteration (if an iteration order is specified). Exceptions thrown by the action are relayed to the caller.
-
Implementation Requirements:
-
The default implementation behaves as if:
for (T t : this)
action.accept(t);
-
Parameters:
-
action
- The action to be performed for each element
-
Throws:
-
NullPointerException
- if the specified action is null
-
Since:
-
1.8
Object get(int index)
Returns the Object at index
index
.
Parameters:
int indexOf(Object object)
Returns the index of
object
in this list, or -1 if not found.
Parameters:
Iterator<Object> iterator()
Returns an iterator over the Objects in this list.
Spliterator<Object> spliterator()
Creates a
Spliterator
over the elements described by this
Iterable
.
-
Implementation Requirements:
-
The default implementation creates an
early-binding spliterator from the iterable's
Iterator
. The spliterator inherits the
fail-fast properties of the iterable's iterator.
-
Implementation Note:
-
The default implementation should usually be overridden. The spliterator returned by the default implementation has poor splitting capabilities, is unsized, and does not report any spliterator characteristics. Implementing classes can nearly always provide a better implementation.
-
Returns:
-
a
Spliterator
over the elements described by this
Iterable
.
-
Since:
-
1.8