| Modifier and Type | Field and Description |
|---|---|
| private T | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public | |
| pack-priv |
| element1 | back to summary |
|---|---|
| private T element1 | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| SingletonList | back to summary |
|---|---|
public SingletonList()
| |
| SingletonList | back to summary |
|---|---|
| pack-priv SingletonList(T obj1) | |
| clone | back to summary |
|---|---|
| public SingletonList Overrides org. Implements org. Doc from java. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by
| |
| contains | back to summary |
|---|---|
| public boolean contains(Object obj) Overrides org. Implements java. Doc from java. Returns
| |
| each | back to summary |
|---|---|
| public void each(Procedure<? super T> procedure) Overrides org. Implements org. Doc from org. The procedure is executed for each element in the iterable. Example using a Java 8 lambda expression: people.each(person -> LOGGER.info(person.getName()));This method is a variant of InternalIterable#forEach(Procedure)
that has a signature conflict with Iterable#forEach(java..
| |
| forEachWith | back to summary |
|---|---|
| public <P> void forEachWith(Procedure2<? super T, ? super P> procedure, P parameter) Overrides org. Implements org. Doc from org. The procedure2 is evaluated for each element in the iterable with the specified parameter provided as the second argument. Example using a Java 8 lambda:
people.forEachWith((Person person, Person other) ->
{
if (person.isRelatedTo(other))
{
LOGGER.info(person.getName());
}
}, fred);
Example using an anonymous inner class:
people.forEachWith(new Procedure2<Person, Person>()
{
public void value(Person person, Person other)
{
if (person.isRelatedTo(other))
{
LOGGER.info(person.getName());
}
}
}, fred);
| |
| forEachWithIndex | back to summary |
|---|---|
| public void forEachWithIndex(ObjectIntProcedure<? super T> objectIntProcedure) Overrides org. Implements org. Doc from org. Iterates over the iterable passing each element and the current relative int index to the specified instance of ObjectIntProcedure. Example using a Java 8 lambda:
people.forEachWithIndex((Person person, int index) -> LOGGER.info("Index: " + index + " person: " + person.getName()));
Example using an anonymous inner class:
people.forEachWithIndex(new ObjectIntProcedure<Person>()
{
public void value(Person person, int index)
{
LOGGER.info("Index: " + index + " person: " + person.getName());
}
});
| |
| get | back to summary |
|---|---|
| public T get(int index) Implements java. Doc from java. Returns the element at the specified position in this list.
| |
| getFirst | back to summary |
|---|---|
| public T getFirst() Overrides org. Overrides default org. Implements org. Doc from org. This default override exists because java.util.List added a default getFirst() method in Java 21.
| |
| getLast | back to summary |
|---|---|
| public T getLast() Overrides org. Overrides default org. Implements org. Doc from org. This default override exists because java.util.List added a default getLast() method in Java 21.
| |
| getOnly | back to summary |
|---|---|
| public T getOnly() Overrides default org. Doc from org. Returns the element if the iterable has exactly one element. Otherwise, throw
| |
| readExternal | back to summary |
|---|---|
| public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException Implements java. Doc from java. The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. The readExternal method must read the values in the same sequence and with the same types as were written by writeExternal.
| |
| replaceAll | back to summary |
|---|---|
| public void replaceAll(UnaryOperator<T> operator) Overrides default java. Doc from java. Replaces each element of this list with the result of applying the operator to that element (optional operation). Errors or runtime exceptions thrown by the operator are relayed to the caller.
| |
| set | back to summary |
|---|---|
| public T set(int index, T element) Implements java. set is implemented purely to allow the List to be sorted, not because this List should be considered mutable.
| |
| size | back to summary |
|---|---|
| public int size() Implements java. Doc from java. Returns the number of elements in this list. If this list contains
more than
| |
| sort | back to summary |
|---|---|
| public void sort(Comparator<? super T> comparator) Overrides org. Overrides default java. Doc from org. This method checks if comparator is null and use a ComparableComparator if it is.
| |
| sortThis | back to summary |
|---|---|
| public SingletonList Overrides default org. Doc from org. Sorts the internal data structure of this list and returns the list itself as a convenience.
| |
| sortThisBy | back to summary |
|---|---|
| public <V extends Comparable Overrides default org. Doc from org. Sorts the internal data structure of this list based on the natural order of the attribute returned by
| |
| sortThisByBoolean | back to summary |
|---|---|
| public MutableList Overrides org. Implements org.
| |
| sortThisByByte | back to summary |
|---|---|
| public MutableList Overrides org. Implements org.
| |
| sortThisByChar | back to summary |
|---|---|
| public MutableList Overrides org. Implements org.
| |
| sortThisByDouble | back to summary |
|---|---|
| public MutableList Overrides org. Implements org.
| |
| sortThisByFloat | back to summary |
|---|---|
| public MutableList Overrides org. Implements org.
| |
| sortThisByInt | back to summary |
|---|---|
| public MutableList Overrides org. Implements org.
| |
| sortThisByLong | back to summary |
|---|---|
| public MutableList Overrides org. Implements org.
| |
| sortThisByShort | back to summary |
|---|---|
| public MutableList Overrides org. Implements org.
| |
| with | back to summary |
|---|---|
| public DoubletonList Overrides default org. Implements org. Doc from org. This method allows fixed size collections the ability to add elements to their existing elements. A new instance
of
MutableCollection<String> list;
list = list.with("1");
list = list.with("2");
return list;
| |
| writeExternal | back to summary |
|---|---|
| public void writeExternal(ObjectOutput out) throws IOException Implements java. Doc from java. The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.
| |