Module jonix.common

Class ListOfOnixElement<E extends OnixElement<V>,V>

java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<E>
com.tectonica.jonix.common.ListOfOnixElement<E,V>
All Implemented Interfaces:
Serializable, Cloneable, Iterable<E>, Collection<E>, List<E>, RandomAccess
Direct Known Subclasses:
ListOfOnixCodelist

public class ListOfOnixElement<E extends OnixElement<V>,V> extends ArrayList<E>
See Also:
  • Constructor Details

    • ListOfOnixElement

      public ListOfOnixElement()
  • Method Details

    • values

      public List<V> values()
      returns a list of the values stored within the elements of this list (as opposed to the elements themselves, each of which also contains attributes, which are usually not interesting)
      Returns:
      a non-null, possibly empty, list of the values
    • valuesInto

      public <C extends Collection<V>> C valuesInto(C collection)
      stores into a given Collection the values stored within the elements of this list (as opposed to the elements themselves, each of which also contains attributes, which are usually not interesting)
      Returns:
      the same passed collection, after being populated
    • first

      public Optional<E> first()
      Returns:
      an Optional of the first OnixElement listed, if any. Since OnixElement contains a value and some (less-interesting) attributes, a more typical API is firstValue().
    • firstValue

      public Optional<V> firstValue()
      Returns:
      an Optional of the value in the first OnixElement listed, if any
    • firstValueOrNull

      public V firstValueOrNull()
      Returns:
      the value in the first OnixElement listed, or null it the none is listed
    • empty

      public static <X extends OnixElement<Y>, Y> ListOfOnixElement<X,Y> empty()