Documentation of 'de.erichseifert.gral.util.SortedList' Java class
SortedList
de.erichseifert.gral.util

Class SortedList<T extends java.lang.Comparable<T>>

  • Type Parameters:
    T - Data type of stored elements.
    All Implemented Interfaces:
    java.lang.Iterable<T>, java.util.Collection<T>, java.util.List<T>


    public class SortedList<T extends java.lang.Comparable<T>>
    extends java.util.AbstractList<T>
    Resizable implementation of the List interface that automatically sorts all values. It implements the methods get, size, add, and size. The stored elements must implement the interface Comparable.
    • Constructor Summary

      Constructors 
      Constructor and Description
      SortedList()
      Constructs an empty list with an initial capacity of ten.
      SortedList(java.util.Collection<? extends T> c)
      Constructs a list containing the elements of the specified collection.
      SortedList(int initialCapacity)
      Constructs an empty list with the specified initial capacity.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean add(T e) 
      T get(int index) 
      int indexOf(java.lang.Object o) 
      T remove(int index) 
      int size() 
      • Methods inherited from class java.util.AbstractList

        add, addAll, clear, equals, hashCode, iterator, lastIndexOf, listIterator, listIterator, set, subList
      • Methods inherited from class java.util.AbstractCollection

        addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.List

        addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
      • Methods inherited from interface java.util.Collection

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

        forEach
    • Constructor Detail

      • SortedList

        public SortedList(int initialCapacity)
        Constructs an empty list with the specified initial capacity.
        Parameters:
        initialCapacity - Initial capacity of the list.
      • SortedList

        public SortedList(java.util.Collection<? extends T> c)
        Constructs a list containing the elements of the specified collection.
        Parameters:
        c - Collection whose elements are to be added.
      • SortedList

        public SortedList()
        Constructs an empty list with an initial capacity of ten.
    • Method Detail

      • get

        public T get(int index)
        Specified by:
        get in interface java.util.List<T extends java.lang.Comparable<T>>
        Specified by:
        get in class java.util.AbstractList<T extends java.lang.Comparable<T>>
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<T extends java.lang.Comparable<T>>
        Specified by:
        size in interface java.util.List<T extends java.lang.Comparable<T>>
        Specified by:
        size in class java.util.AbstractCollection<T extends java.lang.Comparable<T>>
      • add

        public boolean add(T e)
        Specified by:
        add in interface java.util.Collection<T extends java.lang.Comparable<T>>
        Specified by:
        add in interface java.util.List<T extends java.lang.Comparable<T>>
        Overrides:
        add in class java.util.AbstractList<T extends java.lang.Comparable<T>>
      • remove

        public T remove(int index)
        Specified by:
        remove in interface java.util.List<T extends java.lang.Comparable<T>>
        Overrides:
        remove in class java.util.AbstractList<T extends java.lang.Comparable<T>>
      • indexOf

        public int indexOf(java.lang.Object o)
        Specified by:
        indexOf in interface java.util.List<T extends java.lang.Comparable<T>>
        Overrides:
        indexOf in class java.util.AbstractList<T extends java.lang.Comparable<T>>

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.