Klasse ImmutableFloatOpenHashSet

Alle implementierten Schnittstellen:
Iterable<Float>, Collection<Float>, Set<Float>, FloatCollection, FloatIterable, FloatOrderedSet, FloatSet, ISizeProvider

public class ImmutableFloatOpenHashSet extends AbstractFloatSet implements FloatOrderedSet
A Type Specific Custom implementation of the HashSet Instead of using Wrapper Object Arrays for storing keys and values there is dedicated arrays for storing keys. Extra to that there is a couple quality of life functions provided
  • Konstruktordetails

    • ImmutableFloatOpenHashSet

      public ImmutableFloatOpenHashSet(float[] array)
      Helper constructor that allow to create a set from unboxed values
      Parameter:
      array - the elements that should be put into the set
    • ImmutableFloatOpenHashSet

      public ImmutableFloatOpenHashSet(float[] array, float loadFactor)
      Helper constructor that allow to create a set from unboxed values
      Parameter:
      array - the elements that should be put into the set
      loadFactor - the percentage of how full the backing array can be before they resize
      Löst aus:
      IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1
    • ImmutableFloatOpenHashSet

      public ImmutableFloatOpenHashSet(float[] array, int offset, int length)
      Helper constructor that allow to create a set from unboxed values
      Parameter:
      array - the elements that should be put into the set
      offset - the starting index within the array that should be used
      length - the amount of elements used from the array
      Löst aus:
      IllegalStateException - if offset and length causes to step outside of the arrays range
    • ImmutableFloatOpenHashSet

      public ImmutableFloatOpenHashSet(float[] array, int offset, int length, float loadFactor)
      Helper constructor that allow to create a set from unboxed values
      Parameter:
      array - the elements that should be put into the set
      offset - the starting index within the array that should be used
      length - the amount of elements used from the array
      loadFactor - the percentage of how full the backing array can be before they resize
      Löst aus:
      IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1
      IllegalStateException - if offset and length causes to step outside of the arrays range
    • ImmutableFloatOpenHashSet

      @Deprecated public ImmutableFloatOpenHashSet(Collection<? extends Float> collection)
      Veraltet.
      A Helper constructor that allows to create a Set with exactly the same values as the provided collection.
      Parameter:
      collection - the set the elements should be added to the Set
    • ImmutableFloatOpenHashSet

      @Deprecated public ImmutableFloatOpenHashSet(Collection<? extends Float> collection, float loadFactor)
      Veraltet.
      A Helper constructor that allows to create a Set with exactly the same values as the provided collection.
      Parameter:
      collection - the set the elements should be added to the Set
      loadFactor - the percentage of how full the backing array can be before they resize
      Löst aus:
      IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1
    • ImmutableFloatOpenHashSet

      public ImmutableFloatOpenHashSet(FloatCollection collection)
      A Helper constructor that allows to create a Set with exactly the same values as the provided collection.
      Parameter:
      collection - the set the elements should be added to the Set
    • ImmutableFloatOpenHashSet

      public ImmutableFloatOpenHashSet(FloatCollection collection, float loadFactor)
      A Helper constructor that allows to create a Set with exactly the same values as the provided collection.
      Parameter:
      collection - the set the elements should be added to the Set
      loadFactor - the percentage of how full the backing array can be before they resize
      Löst aus:
      IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1
    • ImmutableFloatOpenHashSet

      public ImmutableFloatOpenHashSet(Iterator<Float> iterator)
      A Helper constructor that allows to create a set from a iterator of an unknown size
      Parameter:
      iterator - the elements that should be added to the set
    • ImmutableFloatOpenHashSet

      public ImmutableFloatOpenHashSet(Iterator<Float> iterator, float loadFactor)
      A Helper constructor that allows to create a set from a iterator of an unknown size
      Parameter:
      iterator - the elements that should be added to the set
      loadFactor - the percentage of how full the backing array can be before they resize
      Löst aus:
      IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1
    • ImmutableFloatOpenHashSet

      public ImmutableFloatOpenHashSet(FloatIterator iterator)
      A Helper constructor that allows to create a set from a iterator of an unknown size
      Parameter:
      iterator - the elements that should be added to the set
    • ImmutableFloatOpenHashSet

      public ImmutableFloatOpenHashSet(FloatIterator iterator, float loadFactor)
      A Helper constructor that allows to create a set from a iterator of an unknown size
      Parameter:
      iterator - the elements that should be added to the set
      loadFactor - the percentage of how full the backing array can be before they resize
      Löst aus:
      IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1
  • Methodendetails

    • add

      public boolean add(float o)
      Beschreibung aus Schnittstelle kopiert: FloatCollection
      A Type-Specific add function to reduce (un)boxing
      Angegeben von:
      add in Schnittstelle FloatCollection
      Parameter:
      o - the element that should be added
      Gibt zurück:
      true if the element was added to the collection
    • addAll

      @Deprecated public boolean addAll(Collection<? extends Float> c)
      Veraltet.
      Beschreibung aus Klasse kopiert: AbstractFloatCollection

      This default implementation delegates to the corresponding type-specific function.

      Angegeben von:
      addAll in Schnittstelle Collection<Float>
      Angegeben von:
      addAll in Schnittstelle Set<Float>
      Setzt außer Kraft:
      addAll in Klasse AbstractFloatCollection
    • addAll

      public boolean addAll(FloatCollection c)
      Beschreibung aus Schnittstelle kopiert: FloatCollection
      A Type-Specific addAll function to reduce (un)boxing
      Angegeben von:
      addAll in Schnittstelle FloatCollection
      Setzt außer Kraft:
      addAll in Klasse AbstractFloatCollection
      Parameter:
      c - the collection of elements that should be added
      Gibt zurück:
      true if elements were added into the collection
    • addAndMoveToFirst

      public boolean addAndMoveToFirst(float o)
      Beschreibung aus Schnittstelle kopiert: FloatOrderedSet
      A customized add method that allows you to insert into the first index.
      Angegeben von:
      addAndMoveToFirst in Schnittstelle FloatOrderedSet
      Parameter:
      o - the element that should be inserted
      Gibt zurück:
      true if it was added
      Siehe auch:
    • addAndMoveToLast

      public boolean addAndMoveToLast(float o)
      Beschreibung aus Schnittstelle kopiert: FloatOrderedSet
      A customized add method that allows you to insert into the last index.
      Angegeben von:
      addAndMoveToLast in Schnittstelle FloatOrderedSet
      Parameter:
      o - the element that should be inserted
      Gibt zurück:
      true if it was added
      Siehe auch:
    • moveToFirst

      public boolean moveToFirst(float o)
      Beschreibung aus Schnittstelle kopiert: FloatOrderedSet
      A specific move method to move a given key to the first index.
      Angegeben von:
      moveToFirst in Schnittstelle FloatOrderedSet
      Parameter:
      o - that should be moved to the first index
      Gibt zurück:
      true if the value was moved.
    • moveToLast

      public boolean moveToLast(float o)
      Beschreibung aus Schnittstelle kopiert: FloatOrderedSet
      A specific move method to move a given key to the last index.
      Angegeben von:
      moveToLast in Schnittstelle FloatOrderedSet
      Parameter:
      o - that should be moved to the first last
      Gibt zurück:
      true if the value was moved.
    • contains

      public boolean contains(Object o)
      Beschreibung aus Klasse kopiert: AbstractFloatCollection

      This default implementation delegates to the corresponding type-specific function.

      This default implementation delegates to the corresponding type-specific function.

      Angegeben von:
      contains in Schnittstelle Collection<Float>
      Angegeben von:
      contains in Schnittstelle FloatCollection
      Angegeben von:
      contains in Schnittstelle FloatSet
      Angegeben von:
      contains in Schnittstelle Set<Float>
      Setzt außer Kraft:
      contains in Klasse AbstractFloatCollection
    • firstFloat

      public float firstFloat()
      Beschreibung aus Schnittstelle kopiert: FloatOrderedSet
      A method to get the first element in the set
      Angegeben von:
      firstFloat in Schnittstelle FloatOrderedSet
      Gibt zurück:
      first element in the set
    • pollFirstFloat

      public float pollFirstFloat()
      Beschreibung aus Schnittstelle kopiert: FloatOrderedSet
      A method to get and remove the first element in the set
      Angegeben von:
      pollFirstFloat in Schnittstelle FloatOrderedSet
      Gibt zurück:
      first element in the set
    • lastFloat

      public float lastFloat()
      Beschreibung aus Schnittstelle kopiert: FloatOrderedSet
      A method to get the last element in the set
      Angegeben von:
      lastFloat in Schnittstelle FloatOrderedSet
      Gibt zurück:
      last element in the set
    • pollLastFloat

      public float pollLastFloat()
      Beschreibung aus Schnittstelle kopiert: FloatOrderedSet
      A method to get and remove the last element in the set
      Angegeben von:
      pollLastFloat in Schnittstelle FloatOrderedSet
      Gibt zurück:
      last element in the set
    • remove

      public boolean remove(Object o)
      Beschreibung aus Klasse kopiert: AbstractFloatCollection

      This default implementation delegates to the corresponding type-specific function.

      This default implementation delegates to the corresponding type-specific function.

      Angegeben von:
      remove in Schnittstelle Collection<Float>
      Angegeben von:
      remove in Schnittstelle FloatCollection
      Angegeben von:
      remove in Schnittstelle FloatSet
      Angegeben von:
      remove in Schnittstelle Set<Float>
      Setzt außer Kraft:
      remove in Klasse AbstractFloatCollection
    • contains

      public boolean contains(float o)
      Beschreibung aus Klasse kopiert: AbstractFloatCollection
      A Type-Specific implementation of contains. This implementation iterates over the elements and returns true if the value match.
      Angegeben von:
      contains in Schnittstelle FloatCollection
      Setzt außer Kraft:
      contains in Klasse AbstractFloatCollection
      Parameter:
      o - the element that should be searched for.
      Gibt zurück:
      true if the value was found.
    • remove

      public boolean remove(float o)
      Beschreibung aus Schnittstelle kopiert: FloatSet
      A Type Specific remove function to reduce boxing/unboxing
      Angegeben von:
      remove in Schnittstelle FloatSet
      Parameter:
      o - the element that should be removed
      Gibt zurück:
      true if the element was removed
    • forEach

      public void forEach(FloatConsumer action)
      Beschreibung aus Schnittstelle kopiert: FloatIterable
      A Type Specific foreach function that reduces (un)boxing
      Angegeben von:
      forEach in Schnittstelle FloatIterable
      Parameter:
      action - The action to be performed for each element
      Siehe auch:
    • forEachIndexed

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

      public <E> void forEach(E input, ObjectFloatConsumer<E> action)
      Beschreibung aus Schnittstelle kopiert: FloatIterable
      Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.
      Angegeben von:
      forEach in Schnittstelle FloatIterable
      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(FloatPredicate filter)
      Beschreibung aus Schnittstelle kopiert: FloatIterable
      Helper function to reduce stream usage that allows to filter for any matches.
      Angegeben von:
      matchesAny in Schnittstelle FloatIterable
      Parameter:
      filter - that should be applied
      Gibt zurück:
      true if any matches were found
    • matchesNone

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

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

      public float reduce(float identity, FloatFloatUnaryOperator operator)
      Beschreibung aus Schnittstelle kopiert: FloatIterable
      Performs a reduction on the elements of this Iterable
      Angegeben von:
      reduce in Schnittstelle FloatIterable
      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 float reduce(FloatFloatUnaryOperator operator)
      Beschreibung aus Schnittstelle kopiert: FloatIterable
      Performs a reduction on the elements of this Iterable
      Angegeben von:
      reduce in Schnittstelle FloatIterable
      Parameter:
      operator - the operation that should be applied
      Gibt zurück:
      the reduction result, returns null value if nothing was found
    • findFirst

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

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

      public FloatListIterator iterator()
      Beschreibung aus Schnittstelle kopiert: FloatCollection
      Returns a Type-Specific Iterator to reduce (un)boxing
      Angegeben von:
      iterator in Schnittstelle Collection<Float>
      Angegeben von:
      iterator in Schnittstelle FloatCollection
      Angegeben von:
      iterator in Schnittstelle FloatIterable
      Angegeben von:
      iterator in Schnittstelle FloatOrderedSet
      Angegeben von:
      iterator in Schnittstelle FloatSet
      Angegeben von:
      iterator in Schnittstelle Iterable<Float>
      Angegeben von:
      iterator in Schnittstelle Set<Float>
      Angegeben von:
      iterator in Klasse AbstractFloatSet
      Gibt zurück:
      a iterator of the collection
      Siehe auch:
    • iterator

      public FloatBidirectionalIterator iterator(float fromElement)
      Beschreibung aus Schnittstelle kopiert: FloatOrderedSet
      A type Specific Iterator starting from a given key
      Angegeben von:
      iterator in Schnittstelle FloatOrderedSet
      Parameter:
      fromElement - the element the iterator should start from
      Gibt zurück:
      a iterator starting from the given element
    • toFloatArray

      public float[] toFloatArray(float[] a)
      Beschreibung aus Klasse kopiert: AbstractFloatCollection
      A Type-Specific implementation of toArray. This implementation iterates over all elements and unwraps them into primitive type.
      Angegeben von:
      toFloatArray in Schnittstelle FloatCollection
      Setzt außer Kraft:
      toFloatArray in Klasse AbstractFloatCollection
      Parameter:
      a - array that the elements should be injected to. If null or to small a new array with the right size is created
      Gibt zurück:
      an array containing all of the elements in this collection
      Siehe auch:
    • toArray

      @Deprecated public Object[] toArray()
      Veraltet.
      Angegeben von:
      toArray in Schnittstelle Collection<Float>
      Angegeben von:
      toArray in Schnittstelle Set<Float>
      Setzt außer Kraft:
      toArray in Klasse AbstractCollection<Float>
    • toArray

      @Deprecated public <E> E[] toArray(E[] a)
      Veraltet.
      Angegeben von:
      toArray in Schnittstelle Collection<Float>
      Angegeben von:
      toArray in Schnittstelle Set<Float>
      Setzt außer Kraft:
      toArray in Klasse AbstractCollection<Float>
    • copy

      Beschreibung aus Schnittstelle kopiert: FloatCollection
      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 FloatCollection
      Angegeben von:
      copy in Schnittstelle FloatOrderedSet
      Angegeben von:
      copy in Schnittstelle FloatSet
      Setzt außer Kraft:
      copy in Klasse AbstractFloatSet
      Gibt zurück:
      a Shallow Copy of the collection
    • clear

      public void clear()
      Angegeben von:
      clear in Schnittstelle Collection<Float>
      Angegeben von:
      clear in Schnittstelle Set<Float>
      Setzt außer Kraft:
      clear in Klasse AbstractCollection<Float>
    • size

      public int size()
      Angegeben von:
      size in Schnittstelle Collection<Float>
      Angegeben von:
      size in Schnittstelle ISizeProvider
      Angegeben von:
      size in Schnittstelle Set<Float>
      Angegeben von:
      size in Klasse AbstractCollection<Float>
      Gibt zurück:
      the size of the implementing Collection