Klasse ArrayReadContainer<E>

java.lang.Object
ch.nolix.core.container.base.Container<E>
ch.nolix.core.container.readcontainer.ArrayReadContainer<E>
Typparameter:
E - is the type of the elements of a ArrayReadContainer.
Alle implementierten Schnittstellen:
IContainer<E>, IMappableContainer<E>, ISearchableContainer<E>, IStatisticalConainer<E>, IterableWithCopyableIterator<E>, StoringRequestable<E>, EmptinessRequestable, MaterializationRequestable, Iterable<E>

public final class ArrayReadContainer<E> extends Container<E>
Version:
2017-11-26
Autor:
Silvan Wyss
  • Konstruktordetails

    • ArrayReadContainer

      public ArrayReadContainer()
      Creates a new ArrayReadContainer for a new empty array.
  • Methodendetails

    • forArray

      public static <E2> ArrayReadContainer<E2> forArray(E2[] array)
      Typparameter:
      E2 - is the type of the elements of the given array.
      Parameter:
      array -
      Gibt zurück:
      a new ArrayReadContainer for the given array.
      Löst aus:
      ArgumentIsNullException - if the given array is null.
    • getCount

      public int getCount()
      Gibt zurück:
      the number of elements of the current IStatisticalConainer.
    • getStoredAt1BasedIndex

      public E getStoredAt1BasedIndex(int p1BasedIndex)
      Parameter:
      p1BasedIndex -
      Gibt zurück:
      the element at the given p1BasedIndex.
    • getStoredLast

      public E getStoredLast()
      Gibt zurück:
      the last element of the current ISearchableContainer.
    • isMaterialized

      public boolean isMaterialized()
      Gibt zurück:
      true if the current MaterializationRequestable is materialized, false otherwise.
    • iterator

      public CopyableIterator<E> iterator()
    • toOrderedList

      public <C extends Comparable<C>> IContainer<E> toOrderedList(Function<E,C> norm)
      Typparameter:
      C - is the type of the Comparables the given norm returns.
      Parameter:
      norm -
      Gibt zurück:
      a new IContainer with the elements of the current IContainer ordered from the smallest to the biggest element according to the given norm.
    • toString

      public String toString()
      The complexity of this implementation is O(n). if the current ArrayReadContainer contains n elements.
      Setzt außer Kraft:
      toString in Klasse Object
      Gibt zurück:
      a String representation of the current ArrayReadContainer.
    • createEmptyMutableList

      protected <E2> ILinkedList<E2> createEmptyMutableList(Marker<E2> marker)
      Angegeben von:
      createEmptyMutableList in Klasse Container<E>
      Typparameter:
      E2 - is the type of the elements the created ILinkedList can contain.
      Parameter:
      marker -
      Gibt zurück:
      a new empty ILinkedList.