Module jonix.common
Package com.tectonica.jonix.common
Class ListOfOnixDataComposite<C extends OnixComposite.OnixDataComposite<S>,S extends JonixStruct>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<C>
com.tectonica.jonix.common.ListOfOnixDataComposite<C,S>
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<C>
,Collection<C>
,List<C>
,RandomAccess
- Direct Known Subclasses:
ListOfOnixDataCompositeWithKey
public class ListOfOnixDataComposite<C extends OnixComposite.OnixDataComposite<S>,S extends JonixStruct>
extends ArrayList<C>
- See Also:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionreturns a list of the items inside this list, transformed into Jonix structsGiven this list ofOnixComposite.OnixDataComposite
s, this method creates a new list containing only a subset of items, or none, conforming to the condition passed in thePredicate
object.first()
<L extends Collection<S>>
LstructsInto
(L collection) 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
-
Constructor Details
-
ListOfOnixDataComposite
-
-
Method Details
-
itemClass
-
asStructs
returns a list of the items inside this list, transformed into Jonix structs- Returns:
- a non-null, possibly empty, list of the structs
-
structsInto
-
first
-
firstAsStruct
-
firstOrEmpty
- Returns:
- the first
OnixComposite.OnixDataComposite
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
-
firstOrEmptyAsStruct
- Returns:
- same as
firstOrEmpty()
but wraps thisOnixComposite.OnixDataComposite
as aJonixStruct
-
filter
Given this list ofOnixComposite.OnixDataComposite
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.ListOfOnixDataComposite
), 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
-