Klasse ObjectCollections.SynchronizedCollection<T>

java.lang.Object
speiger.src.collections.objects.utils.ObjectCollections.SynchronizedCollection<T>
Typparameter:
T - the keyType of elements maintained by this Collection
Alle implementierten Schnittstellen:
Iterable<T>, Collection<T>, ObjectCollection<T>, ObjectIterable<T>, ISizeProvider
Umschließende Klasse:
ObjectCollections

public static class ObjectCollections.SynchronizedCollection<T> extends Object implements ObjectCollection<T>
Synchronized Collection Wrapper for the synchronizedCollection function
  • Methodendetails

    • add

      public boolean add(T o)
      Angegeben von:
      add in Schnittstelle Collection<T>
    • addAll

      public boolean addAll(Collection<? extends T> c)
      Angegeben von:
      addAll in Schnittstelle Collection<T>
    • addAll

      public boolean addAll(ObjectCollection<T> c)
      Beschreibung aus Schnittstelle kopiert: ObjectCollection
      A Type-Specific addAll function to reduce (un)boxing
      Angegeben von:
      addAll in Schnittstelle ObjectCollection<T>
      Parameter:
      c - the collection of elements that should be added
      Gibt zurück:
      true if elements were added into the collection
    • addAll

      public boolean addAll(T[] e, int offset, int length)
      Beschreibung aus Schnittstelle kopiert: ObjectCollection
      A Type-Specific Array based addAll method to reduce the amount of Wrapping
      Angegeben von:
      addAll in Schnittstelle ObjectCollection<T>
      Parameter:
      e - the elements that should be added
      offset - where to start within the array
      length - how many elements of the array should be added
      Gibt zurück:
      if the collection was modified
    • contains

      public boolean contains(Object o)
      Angegeben von:
      contains in Schnittstelle Collection<T>
    • containsAll

      public boolean containsAll(Collection<?> c)
      Angegeben von:
      containsAll in Schnittstelle Collection<T>
    • containsAny

      public boolean containsAny(Collection<?> c)
      Beschreibung aus Schnittstelle kopiert: ObjectCollection
      Returns true if any element of the Collection is found in the provided collection. A Small Optimization function to find out of any element is present when comparing collections and not all of them.
      Angegeben von:
      containsAny in Schnittstelle ObjectCollection<T>
      Parameter:
      c - the collection of elements that should be tested for
      Gibt zurück:
      true if any element was found.
    • containsAll

      public boolean containsAll(ObjectCollection<T> c)
      Beschreibung aus Schnittstelle kopiert: ObjectCollection
      A Type-Specific containsAll function to reduce (un)boxing
      Angegeben von:
      containsAll in Schnittstelle ObjectCollection<T>
      Parameter:
      c - the collection of elements that should be tested for
      Gibt zurück:
      true if all the element is found in the collection
    • containsAny

      public boolean containsAny(ObjectCollection<T> c)
      Beschreibung aus Schnittstelle kopiert: ObjectCollection
      A Type-Specific containsAny function to reduce (un)boxing
      Angegeben von:
      containsAny in Schnittstelle ObjectCollection<T>
      Parameter:
      c - the collection of elements that should be tested for
      Gibt zurück:
      true if any element was found
    • size

      public int size()
      Angegeben von:
      size in Schnittstelle Collection<T>
      Angegeben von:
      size in Schnittstelle ISizeProvider
      Gibt zurück:
      the size of the implementing Collection
    • isEmpty

      public boolean isEmpty()
      Angegeben von:
      isEmpty in Schnittstelle Collection<T>
    • iterator

      public ObjectIterator<T> iterator()
      Beschreibung aus Schnittstelle kopiert: ObjectCollection
      Returns a Type-Specific Iterator to reduce (un)boxing
      Angegeben von:
      iterator in Schnittstelle Collection<T>
      Angegeben von:
      iterator in Schnittstelle Iterable<T>
      Angegeben von:
      iterator in Schnittstelle ObjectCollection<T>
      Angegeben von:
      iterator in Schnittstelle ObjectIterable<T>
      Gibt zurück:
      a iterator of the collection
      Siehe auch:
    • copy

      public ObjectCollection<T> copy()
      Beschreibung aus Schnittstelle kopiert: ObjectCollection
      A Function that does a shallow clone of the Collection itself. This function is more optimized then a copy constructor since the Collection does not have to be unsorted/resorted. It can be compared to Cloneable but with less exception risk
      Angegeben von:
      copy in Schnittstelle ObjectCollection<T>
      Gibt zurück:
      a Shallow Copy of the collection
    • remove

      public boolean remove(Object o)
      Angegeben von:
      remove in Schnittstelle Collection<T>
    • removeAll

      public boolean removeAll(Collection<?> c)
      Angegeben von:
      removeAll in Schnittstelle Collection<T>
    • retainAll

      public boolean retainAll(Collection<?> c)
      Angegeben von:
      retainAll in Schnittstelle Collection<T>
    • removeAll

      public boolean removeAll(ObjectCollection<T> c)
      Beschreibung aus Schnittstelle kopiert: ObjectCollection
      A Type-Specific removeAll function that reduces (un)boxing.
      Angegeben von:
      removeAll in Schnittstelle ObjectCollection<T>
      Parameter:
      c - the collection of elements that should be removed
      Gibt zurück:
      true if any element was removed
      Siehe auch:
    • removeAll

      public boolean removeAll(ObjectCollection<T> c, Consumer<T> r)
      Beschreibung aus Schnittstelle kopiert: ObjectCollection
      A Type-Specific removeAll function that reduces (un)boxing. It also notifies the remover of which exact element is going to be removed.
      Angegeben von:
      removeAll in Schnittstelle ObjectCollection<T>
      Parameter:
      c - the collection of elements that should be removed
      r - elements that got removed
      Gibt zurück:
      true if any element was removed
      Siehe auch:
    • retainAll

      public boolean retainAll(ObjectCollection<T> c)
      Beschreibung aus Schnittstelle kopiert: ObjectCollection
      A Type-Specific retainAll function that reduces (un)boxing.
      Angegeben von:
      retainAll in Schnittstelle ObjectCollection<T>
      Parameter:
      c - the collection of elements that should be kept
      Gibt zurück:
      true if any element was removed
      Siehe auch:
    • retainAll

      public boolean retainAll(ObjectCollection<T> c, Consumer<T> r)
      Beschreibung aus Schnittstelle kopiert: ObjectCollection
      A Type-Specific retainAll function that reduces (un)boxing. It also notifies the remover of which exact element is going to be removed.
      Angegeben von:
      retainAll in Schnittstelle ObjectCollection<T>
      Parameter:
      c - the collection of elements that should be kept
      r - elements that got removed
      Gibt zurück:
      true if any element was removed
      Siehe auch:
    • clear

      public void clear()
      Angegeben von:
      clear in Schnittstelle Collection<T>
    • toArray

      public Object[] toArray()
      Angegeben von:
      toArray in Schnittstelle Collection<T>
    • toArray

      public <E> E[] toArray(E[] a)
      Angegeben von:
      toArray in Schnittstelle Collection<T>
    • forEach

      public void forEach(Consumer<? super T> action)
      Angegeben von:
      forEach in Schnittstelle Iterable<T>
    • forEachIndexed

      public void forEachIndexed(IntObjectConsumer<T> action)
      Beschreibung aus Schnittstelle kopiert: ObjectIterable
      A Indexed forEach implementation that allows you to keep track of how many elements were already iterated over.
      Angegeben von:
      forEachIndexed in Schnittstelle ObjectIterable<T>
      Parameter:
      action - The action to be performed for each element
    • hashCode

      public int hashCode()
      Angegeben von:
      hashCode in Schnittstelle Collection<T>
      Setzt außer Kraft:
      hashCode in Klasse Object
    • equals

      public boolean equals(Object obj)
      Angegeben von:
      equals in Schnittstelle Collection<T>
      Setzt außer Kraft:
      equals in Klasse Object
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object
    • forEach

      public <E> void forEach(E input, ObjectObjectConsumer<E,T> action)
      Beschreibung aus Schnittstelle kopiert: ObjectIterable
      Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.
      Angegeben von:
      forEach in Schnittstelle ObjectIterable<T>
      Typparameter:
      E - the generic type of the Object
      Parameter:
      input - the object that should be included
      action - The action to be performed for each element
    • matchesAny

      public boolean matchesAny(Predicate<T> filter)
      Beschreibung aus Schnittstelle kopiert: ObjectIterable
      Helper function to reduce stream usage that allows to filter for any matches.
      Angegeben von:
      matchesAny in Schnittstelle ObjectIterable<T>
      Parameter:
      filter - that should be applied
      Gibt zurück:
      true if any matches were found
    • matchesNone

      public boolean matchesNone(Predicate<T> filter)
      Beschreibung aus Schnittstelle kopiert: ObjectIterable
      Helper function to reduce stream usage that allows to filter for no matches.
      Angegeben von:
      matchesNone in Schnittstelle ObjectIterable<T>
      Parameter:
      filter - that should be applied
      Gibt zurück:
      true if no matches were found
    • matchesAll

      public boolean matchesAll(Predicate<T> filter)
      Beschreibung aus Schnittstelle kopiert: ObjectIterable
      Helper function to reduce stream usage that allows to filter for all matches.
      Angegeben von:
      matchesAll in Schnittstelle ObjectIterable<T>
      Parameter:
      filter - that should be applied
      Gibt zurück:
      true if all matches.
    • reduce

      public <E> E reduce(E identity, BiFunction<E,T,E> operator)
      Beschreibung aus Schnittstelle kopiert: ObjectIterable
      Performs a reduction on the elements of this Iterable
      Angegeben von:
      reduce in Schnittstelle ObjectIterable<T>
      Typparameter:
      E - the keyType of elements maintained by this Collection
      Parameter:
      identity - the start value
      operator - the operation that should be applied
      Gibt zurück:
      the reduction result, returns identity if nothing was found
    • reduce

      public T reduce(ObjectObjectUnaryOperator<T,T> operator)
      Beschreibung aus Schnittstelle kopiert: ObjectIterable
      Performs a reduction on the elements of this Iterable
      Angegeben von:
      reduce in Schnittstelle ObjectIterable<T>
      Parameter:
      operator - the operation that should be applied
      Gibt zurück:
      the reduction result, returns null value if nothing was found
    • findFirst

      public T findFirst(Predicate<T> filter)
      Beschreibung aus Schnittstelle kopiert: ObjectIterable
      Helper function to reduce stream usage that allows to filter for the first match.
      Angegeben von:
      findFirst in Schnittstelle ObjectIterable<T>
      Parameter:
      filter - that should be applied
      Gibt zurück:
      the found value or the null equivalent variant.
    • count

      public int count(Predicate<T> filter)
      Beschreibung aus Schnittstelle kopiert: ObjectIterable
      Helper function to reduce stream usage that allows to count the valid elements.
      Angegeben von:
      count in Schnittstelle ObjectIterable<T>
      Parameter:
      filter - that should be applied
      Gibt zurück:
      the amount of Valid Elements