Interface XGettingEnum<E>

All Superinterfaces:
CapacityCarrying, Copyable, ExtendedCollection<E>, ExtendedSequence<E>, Iterable<E>, Sized, XGettingCollection<E>, XGettingSequence<E>, XGettingSet<E>, XIndexIterable<E>, XIterable<E>, XJoinable<E>
All Known Subinterfaces:
XBasicEnum<E>, XBasicTable<K,​V>, XBasicTable.Keys<K,​V>, XChart<K,​V>, XChart.Keys<K,​V>, XDecreasingEnum<E>, XEnum<E>, XGettingTable<K,​V>, XGettingTable.Keys<K,​V>, XImmutableEnum<E>, XImmutableEnum.Factory<E>, XImmutableTable<K,​V>, XImmutableTable.Keys<K,​V>, XIncreasingEnum<E>, XProcessingEnum<E>, XPutGetEnum<E>, XRank<E>, XReference<E>, XReferencing<E>, XSettingEnum<E>, XSortableEnum<E>, XTable<K,​V>, XTable.Keys<K,​V>
All Known Implementing Classes:
Constant, ConstHashEnum, ConstHashTable, ConstHashTable.Keys, ConstLinearEnum, Empty, EmptyTable, EnumProcessor, EnumView, EqConstHashEnum, EqConstHashTable, EqConstHashTable.Keys, EqHashEnum, EqHashTable, EqHashTable.Keys, HashEnum, HashTable, HashTable.Keys, LinkingReferencing.Default, LinkReference.Default, Single, Singleton, SingletonView, TableView

public interface XGettingEnum<E>
extends XGettingSet<E>, XGettingSequence<E>
  • Method Details

    • immure

      XImmutableEnum<E> immure()
      Provides an instance of an immutable collection type with equal behavior and data as this instance.

      If this instance already is of an immutable collection type, it returns itself.

      Specified by:
      immure in interface XGettingCollection<E>
      Specified by:
      immure in interface XGettingSequence<E>
      Specified by:
      immure in interface XGettingSet<E>
      Returns:
      an immutable copy of this collection instance.
    • copy

      XGettingEnum<E> copy()
      Description copied from interface: XGettingCollection
      Creates a true copy of this collection which references the same elements as this collection does at the time the method is called. The elements themselves are NOT copied (no deep copying).
      The type of the returned set is the same as of this list if possible.
      Specified by:
      copy in interface Copyable
      Specified by:
      copy in interface XGettingCollection<E>
      Specified by:
      copy in interface XGettingSequence<E>
      Specified by:
      copy in interface XGettingSet<E>
      Returns:
      a copy of this list
    • toReversed

      XGettingEnum<E> toReversed()
      Description copied from interface: XGettingSequence
      Creates a new XGettingSequence with the reversed order of elements.

      This method creates a new collection and does not change the existing collection.

      Specified by:
      toReversed in interface XGettingSequence<E>
      Returns:
      New copy of the collection
    • view

      XGettingEnum<E> view()
      Description copied from interface: XGettingCollection
      Creates a view of this collection and returns it. It is a read-only collection, which wraps around this collection and only allows read methods.

      A view is different from immutable collection (XGettingCollection.immure()) in the way, that changes in this collection are still affecting the view. The immutable collection on the other hand has no reference to this collection and changes therefore do not affect the immutable collection.

      Specified by:
      view in interface XGettingCollection<E>
      Specified by:
      view in interface XGettingSequence<E>
      Returns:
      new read-only collection to view this collection
    • view

      XGettingEnum<E> view​(long lowIndex, long highIndex)
      Description copied from interface: XGettingSequence
      Creates a sub-view of this collection and returns it. It is a read-only collection, which wraps around this collection and only allows read methods.
      The view is limited to a range from the lowIndex to the highIndex.

      A view is different from immutable collection (XGettingCollection.immure()) in the way, that changes in this collection are still affecting the view. The immutable collection on the other hand has no reference to this collection and changes therefore do not affect the immutable collection.

      Specified by:
      view in interface XGettingSequence<E>
      Parameters:
      lowIndex - defines lower boundary for the view of the collection.
      highIndex - defines higher boundary for the view of the collection.
      Returns:
      new read-only collection to view a range of elements in this collection
    • range

      XGettingEnum<E> range​(long lowIndex, long highIndex)
      Specified by:
      range in interface XGettingSequence<E>
    • iterate

      <P extends Consumer<? super E>> P iterate​(P procedure)
      Description copied from interface: XIterable
      Executes the given procedure for each element of the XIterable until all elements have been processed or the action throws an exception. Unless otherwise specified by the implementing class, procedures are performed in the order of iteration (if an iteration order is specified). Exceptions thrown by the procedure are relayed to the caller.
      Should be identical to Iterable.forEach(Consumer).
      Specified by:
      iterate in interface XGettingSet<E>
      Specified by:
      iterate in interface XIterable<E>
      Type Parameters:
      P - type of procedure
      Parameters:
      procedure - The procedure to be performed for each element
      Returns:
      Given procedure