Klasse ReadContainer<E>

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

public final class ReadContainer<E> extends Container<E>
A ReadContainer can read a given container. A ReadContainer prevents that its accessed container can be mutated. A ReadContainer does not prevent that the elements of its accessed container can be mutated.
Version:
2017-07-01
Autor:
Silvan Wyss
  • Konstruktordetails

    • ReadContainer

      public ReadContainer()
      Creates a new ReadContainer for an empty container.
  • Methodendetails

    • forArray

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

      public static <E2> ReadContainer<E2> forElement(E2 firstElement, E2... elements)
      Typparameter:
      E2 - is the type of the given elements.
      Parameter:
      firstElement -
      elements -
      Gibt zurück:
      a new ReadContainer with the given elements.
      Löst aus:
      ArgumentIsNullException - if the given firstElement or one of the given elements is null.
    • forIterable

      @SafeVarargs public static <E2> ReadContainer<E2> forIterable(Iterable<? extends E2> container, Iterable<? extends E2>... containers)
      Typparameter:
      E2 - is the type of the elements of the given container and containers.
      Parameter:
      container -
      containers -
      Gibt zurück:
      a new ReadContainer for the given containers.
      Löst aus:
      ArgumentIsNullException - if the given container is null.
      ArgumentIsNullException - if the given containers is null.
      ArgumentIsNullException - if one of the given containers is null.
    • equals

      public boolean equals(Object object)
      An object equals a ReadContainer when the object is a ReadContainer that contains exactly the same elements in the same order.
      Setzt außer Kraft:
      equals in Klasse Object
    • 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.
    • hashCode

      public int hashCode()
      Setzt außer Kraft:
      hashCode in Klasse Object
    • 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()
      Setzt außer Kraft:
      toString in Klasse Object
    • 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.