Class FrequencySortedSet.SubSet

java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
org.apache.sis.util.collection.FrequencySortedSet.SubSet
All Implemented Interfaces:
Serializable, Iterable<E>, Collection<E>, Set<E>, SortedSet<E>
Enclosing class:
FrequencySortedSet<E>

private final class FrequencySortedSet.SubSet extends AbstractSet<E> implements SortedSet<E>, Serializable
A view over a subset of FrequencySortedSet.
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      For cross-version compatibility.
      See Also:
    • elements

      private transient E[] elements
      Reference to the FrequencySortedSet.sorted array, used for detecting changes.
    • fromElement

      private final E fromElement
      Low endpoint (inclusive) of the subset. May be null.
    • toElement

      private final E toElement
      High endpoint (exclusive) of the subset. May be null.
    • hasFrom

      private final boolean hasFrom
      Whether the set should take in account fromElement or toElement. We have to use those booleans (we cannot use null sentinel value instead) because null is a legal value for from/toElement.
    • hasTo

      private final boolean hasTo
      Whether the set should take in account fromElement or toElement. We have to use those booleans (we cannot use null sentinel value instead) because null is a legal value for from/toElement.
    • lower

      private transient int lower
      Lower and upper index computed from fromElement and toElement.
    • upper

      private transient int upper
      Lower and upper index computed from fromElement and toElement.
  • Constructor Details

    • SubSet

      SubSet(boolean hasFrom, E fromElement, boolean hasTo, E toElement)
      Creates a new subset from the lower element (inclusive) to the upper element (exclusive). Each endpoint can be null.
  • Method Details