Klasse ContainerView<E>

java.lang.Object
ch.nolix.core.container.base.Container<E>
ch.nolix.core.container.containerview.ContainerView<E>
Typparameter:
E - is the type of the elements of a ContainerView.
Alle implementierten Schnittstellen:
IContainer<E>, IViewProviderContainer<E>, Mappable<E>, MultiSearchable<E>, ArrayMappable<E>, ICountingContainer<E>, IndexRequestable<E>, IStatisticalConainer<E>, IterableWithCopyableIterator<E>, SingleSearchable<E>, StoringRequestable<E>, StringMappable, EmptinessRequestable, MaterializationRequestable, Iterable<E>

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

    • forArray

      public static <E2> ContainerView<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 ContainerView 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 array of the given arrays is null.
    • forElementAndArray

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

      public static <E2> ContainerView<E2> forEmpty()
      Typparameter:
      E2 - is the type of the hypothetical elements of the created empty ContainerView.
      Gibt zurück:
      a new empty ContainerView.
    • forIterable

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

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

      public boolean equals(Object object)
      An object equals a ContainerView when the object is a Iterable that contains exactly the same elements in the same order like the ContainerView.
      Setzt außer Kraft:
      equals in Klasse Object
    • getCount

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

      public E getStoredAt1BasedIndex(int param1BasedIndex)
      Parameter:
      param1BasedIndex -
      Gibt zurück:
      the element at the given param1BasedIndex. The element can be null.
    • 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 comparableMapper 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 Comparables the given comparableMapper maps from the elements of the current IContainer.
    • 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.