Klasse ObjectAVLTreeSet<T>

Typparameter:
T - the keyType of elements maintained by this Collection
Alle implementierten Schnittstellen:
Iterable<T>, Collection<T>, NavigableSet<T>, Set<T>, SortedSet<T>, ObjectCollection<T>, ObjectIterable<T>, ObjectNavigableSet<T>, ObjectSet<T>, ObjectSortedSet<T>, ISizeProvider

public class ObjectAVLTreeSet<T> extends AbstractObjectSet<T> implements ObjectNavigableSet<T>
A Simple Type Specific AVL TreeSet implementation that reduces boxing/unboxing. It is using a bit more memory then FastUtil, but it saves a lot of Performance on the Optimized removal and iteration logic. Which makes the implementation actually useable and does not get outperformed by Javas default implementation.
  • Konstruktordetails

    • ObjectAVLTreeSet

      public ObjectAVLTreeSet()
      Default Constructor
    • ObjectAVLTreeSet

      public ObjectAVLTreeSet(Comparator<T> comp)
      Constructor that allows to define the sorter
      Parameter:
      comp - the function that decides how the tree is sorted, can be null
    • ObjectAVLTreeSet

      public ObjectAVLTreeSet(T[] array)
      Helper constructor that allow to create a set from an array
      Parameter:
      array - the elements that should be used
    • ObjectAVLTreeSet

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

      public ObjectAVLTreeSet(T[] array, Comparator<T> comp)
      Helper constructor that allow to create a set from an array
      Parameter:
      array - the elements that should be used
      comp - the sorter of the tree, can be null
    • ObjectAVLTreeSet

      public ObjectAVLTreeSet(T[] array, int offset, int length, Comparator<T> comp)
      Helper constructor that allow to create a set from an array
      Parameter:
      array - the elements that should be used
      offset - the starting index within the array
      length - the amount of elements that are within the array
      comp - the sorter of the tree, can be null
      Löst aus:
      IllegalStateException - if offset and length causes to step outside of the arrays range
    • ObjectAVLTreeSet

      public ObjectAVLTreeSet(ObjectSortedSet<T> sortedSet)
      A Helper constructor that allows to create a Set with exactly the same values as the provided SortedSet.
      Parameter:
      sortedSet - the set the elements should be added to the TreeSet
      Note:
      this also includes the Comparator if present
    • ObjectAVLTreeSet

      public ObjectAVLTreeSet(Collection<? extends T> 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 TreeSet
    • ObjectAVLTreeSet

      public ObjectAVLTreeSet(Collection<? extends T> collection, Comparator<T> comp)
      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 TreeSet
      comp - the sorter of the tree, can be null
    • ObjectAVLTreeSet

      public ObjectAVLTreeSet(ObjectCollection<T> 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 TreeSet
    • ObjectAVLTreeSet

      public ObjectAVLTreeSet(ObjectCollection<T> collection, Comparator<T> comp)
      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 TreeSet
      comp - the sorter of the tree, can be null
    • ObjectAVLTreeSet

      public ObjectAVLTreeSet(Iterator<T> 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
    • ObjectAVLTreeSet

      public ObjectAVLTreeSet(Iterator<T> iterator, Comparator<T> comp)
      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
      comp - the sorter of the tree, can be null
    • ObjectAVLTreeSet

      public ObjectAVLTreeSet(ObjectIterator<T> 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
    • ObjectAVLTreeSet

      public ObjectAVLTreeSet(ObjectIterator<T> iterator, Comparator<T> comp)
      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
      comp - the sorter of the tree, can be null
  • Methodendetails