Class SortedArraySet<T>

  • All Implemented Interfaces:
    java.lang.Iterable<T>, java.util.Collection<T>, java.util.Set<T>

    public class SortedArraySet<T>
    extends java.util.AbstractSet<T>
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      (package private) class  SortedArraySet.Itr  
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Comparator<T> comparator  
      private T[] contents  
      private int size  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private SortedArraySet​(int p_i225697_1_, java.util.Comparator<T> p_i225697_2_)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean add​(T p_add_1_)  
      private void addInternal​(T p_226176_1_, int p_226176_2_)  
      T addOrGet​(T p_226175_1_)  
      private static <T> T[] castRawArray​(java.lang.Object[] p_226177_0_)  
      void clear()  
      boolean contains​(java.lang.Object p_contains_1_)  
      static <T extends java.lang.Comparable<T>>
      SortedArraySet<T>
      create​(int p_226172_0_)  
      boolean equals​(java.lang.Object p_equals_1_)  
      private int findIndex​(T p_226182_1_)  
      T first()  
      private static int getInsertionPosition​(int p_226179_0_)  
      private T getInternal​(int p_226184_1_)  
      private void grow​(int p_226181_1_)  
      java.util.Iterator<T> iterator()  
      boolean remove​(java.lang.Object p_remove_1_)  
      private void removeInternal​(int p_226183_1_)  
      int size()  
      java.lang.Object[] toArray()  
      <U> U[] toArray​(U[] p_toArray_1_)  
      • Methods inherited from class java.util.AbstractSet

        hashCode, removeAll
      • Methods inherited from class java.util.AbstractCollection

        addAll, containsAll, isEmpty, retainAll, toString
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.Set

        addAll, containsAll, isEmpty, retainAll, spliterator
    • Field Detail

      • comparator

        private final java.util.Comparator<T> comparator
      • contents

        private T[] contents
      • size

        private int size
    • Constructor Detail

      • SortedArraySet

        private SortedArraySet​(int p_i225697_1_,
                               java.util.Comparator<T> p_i225697_2_)
    • Method Detail

      • create

        public static <T extends java.lang.Comparable<T>> SortedArraySet<T> create​(int p_226172_0_)
      • castRawArray

        private static <T> T[] castRawArray​(java.lang.Object[] p_226177_0_)
      • findIndex

        private int findIndex​(T p_226182_1_)
      • getInsertionPosition

        private static int getInsertionPosition​(int p_226179_0_)
      • add

        public boolean add​(T p_add_1_)
        Specified by:
        add in interface java.util.Collection<T>
        Specified by:
        add in interface java.util.Set<T>
        Overrides:
        add in class java.util.AbstractCollection<T>
      • grow

        private void grow​(int p_226181_1_)
      • addInternal

        private void addInternal​(T p_226176_1_,
                                 int p_226176_2_)
      • removeInternal

        private void removeInternal​(int p_226183_1_)
      • getInternal

        private T getInternal​(int p_226184_1_)
      • addOrGet

        public T addOrGet​(T p_226175_1_)
      • remove

        public boolean remove​(java.lang.Object p_remove_1_)
        Specified by:
        remove in interface java.util.Collection<T>
        Specified by:
        remove in interface java.util.Set<T>
        Overrides:
        remove in class java.util.AbstractCollection<T>
      • first

        public T first()
      • contains

        public boolean contains​(java.lang.Object p_contains_1_)
        Specified by:
        contains in interface java.util.Collection<T>
        Specified by:
        contains in interface java.util.Set<T>
        Overrides:
        contains in class java.util.AbstractCollection<T>
      • iterator

        public java.util.Iterator<T> iterator()
        Specified by:
        iterator in interface java.util.Collection<T>
        Specified by:
        iterator in interface java.lang.Iterable<T>
        Specified by:
        iterator in interface java.util.Set<T>
        Specified by:
        iterator in class java.util.AbstractCollection<T>
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<T>
        Specified by:
        size in interface java.util.Set<T>
        Specified by:
        size in class java.util.AbstractCollection<T>
      • toArray

        public java.lang.Object[] toArray()
        Specified by:
        toArray in interface java.util.Collection<T>
        Specified by:
        toArray in interface java.util.Set<T>
        Overrides:
        toArray in class java.util.AbstractCollection<T>
      • toArray

        public <U> U[] toArray​(U[] p_toArray_1_)
        Specified by:
        toArray in interface java.util.Collection<T>
        Specified by:
        toArray in interface java.util.Set<T>
        Overrides:
        toArray in class java.util.AbstractCollection<T>
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Collection<T>
        Specified by:
        clear in interface java.util.Set<T>
        Overrides:
        clear in class java.util.AbstractCollection<T>
      • equals

        public boolean equals​(java.lang.Object p_equals_1_)
        Specified by:
        equals in interface java.util.Collection<T>
        Specified by:
        equals in interface java.util.Set<T>
        Overrides:
        equals in class java.util.AbstractSet<T>