Module jonix.common
Package com.tectonica.jonix.common
Class ListOfOnixComposite<C extends OnixComposite>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<C>
com.tectonica.jonix.common.ListOfOnixComposite<C>
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<C>
,Collection<C>
,List<C>
,RandomAccess
- See Also:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Method Summary
Modifier and TypeMethodDescriptionGiven this list ofOnixComposite
s, this method creates a new list containing only a subset of items, or none, conforming to the condition passed in thePredicate
object.first()
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
Methods inherited from class java.util.AbstractCollection
containsAll, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods inherited from interface java.util.List
containsAll
-
Method Details
-
itemClass
-
first
- Returns:
- an
Optional
of the firstOnixComposite
listed, if any
-
firstOrEmpty
- Returns:
- the first
OnixComposite
listed, if any, or an "empty" instance (whoseOnixTag.exists()
isfalse
), which can be further traversed by your code (as if it exists in the ONIX source), with all underlying data fields eventually yielding "non-existing" value
-
filter
Given this list ofOnixComposite
s, this method creates a new list containing only a subset of items, or none, conforming to the condition passed in thePredicate
object.Note that this method is different from
.stream().filter()
in that it returns a list of the same original type (i.e.ListOfOnixComposite
), and not a generic JavaList
. This allows the caller to apply methods such asfirstOrEmpty()
on the returned list.- Returns:
- a non-null, possibly empty, sublist of items meeting the predicate condition
-