Class ObjectBigLists.Singleton<K>

java.lang.Object
java.util.AbstractCollection<K>
All Implemented Interfaces:
BigList<K>, ObjectBigList<K>, ObjectCollection<K>, ObjectIterable<K>, Size64, Stack<K>, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<BigList<? extends K>>, java.lang.Iterable<K>, java.util.Collection<K>
Enclosing class:
ObjectBigLists

public static class ObjectBigLists.Singleton<K>
extends AbstractObjectBigList<K>
implements java.io.Serializable, java.lang.Cloneable
An immutable class representing a type-specific singleton big list.

This class may be useful to implement your own in case you subclass a type-specific big list.

See Also:
Serialized Form
  • Method Details

    • get

      public K get​(long i)
      Description copied from interface: BigList
      Returns the element at the specified position.
      Specified by:
      get in interface BigList<K>
      Parameters:
      i - a position in the big list.
      Returns:
      the element at the specified position.
      See Also:
      List.get(int)
    • remove

      public boolean remove​(java.lang.Object k)
      Specified by:
      remove in interface java.util.Collection<K>
      Overrides:
      remove in class java.util.AbstractCollection<K>
    • remove

      public K remove​(long i)
      Description copied from class: AbstractObjectBigList
      Removes the element at the specified position.
      Specified by:
      remove in interface BigList<K>
      Overrides:
      remove in class AbstractObjectBigList<K>
      Parameters:
      i - a position in the big list.
      Returns:
      the element previously at the specified position.
      See Also:
      List.remove(int)
    • contains

      public boolean contains​(java.lang.Object k)
      Description copied from class: AbstractObjectBigList
      Returns true if this list contains the specified element.
      Specified by:
      contains in interface java.util.Collection<K>
      Overrides:
      contains in class AbstractObjectBigList<K>
      See Also:
      Collection.contains(Object)
    • indexOf

      public long indexOf​(java.lang.Object k)
      Description copied from interface: BigList
      Returns the index of the first occurrence of the specified element in this big list, or -1 if this big list does not contain the element.
      Specified by:
      indexOf in interface BigList<K>
      Overrides:
      indexOf in class AbstractObjectBigList<K>
      Parameters:
      k - the object to search for.
      Returns:
      the index of the first occurrence of the specified element in this big list, or -1 if this big list does not contain the element.
      See Also:
      List.indexOf(Object)
    • toArray

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

      public ObjectBigListIterator<K> listIterator()
      Description copied from class: AbstractObjectBigList
      Returns a type-specific big-list iterator on this type-specific big list.
      Specified by:
      listIterator in interface BigList<K>
      Specified by:
      listIterator in interface ObjectBigList<K>
      Overrides:
      listIterator in class AbstractObjectBigList<K>
      Returns:
      a big-list iterator over the elements in this big list.
      See Also:
      BigList.listIterator()
    • listIterator

      public ObjectBigListIterator<K> listIterator​(long i)
      Description copied from class: AbstractObjectBigList
      Returns a type-specific list iterator on this type-specific big list starting at a given index.
      Specified by:
      listIterator in interface BigList<K>
      Specified by:
      listIterator in interface ObjectBigList<K>
      Overrides:
      listIterator in class AbstractObjectBigList<K>
      Parameters:
      i - index of first element to be returned from the big-list iterator.
      Returns:
      a big-list iterator of the elements in this big list, starting at the specified position in this big list.
      See Also:
      BigList.listIterator(long)
    • spliterator

      public ObjectSpliterator<K> spliterator()
      Description copied from interface: ObjectBigList
      Returns a type-specific spliterator on the elements of this big-list.

      BigList spliterators must report at least Spliterator.SIZED and Spliterator.ORDERED.

      See List.spliterator() for more documentation on the requirements of the returned spliterator (despite BigList not being a List, most of the same requirements apply.

      Specified by:
      spliterator in interface java.util.Collection<K>
      Specified by:
      spliterator in interface java.lang.Iterable<K>
      Specified by:
      spliterator in interface ObjectBigList<K>
      Specified by:
      spliterator in interface ObjectCollection<K>
      Specified by:
      spliterator in interface ObjectIterable<K>
      Returns:
      a type-specific spliterator on the elements of this collection.
    • subList

      public ObjectBigList<K> subList​(long from, long to)
      Description copied from interface: ObjectBigList
      Returns a type-specific view of the portion of this type-specific big list from the index from, inclusive, to the index to, exclusive.
      Specified by:
      subList in interface BigList<K>
      Specified by:
      subList in interface ObjectBigList<K>
      Overrides:
      subList in class AbstractObjectBigList<K>
      Parameters:
      from - the starting element (inclusive).
      to - the ending element (exclusive).
      Returns:
      a big sublist view of this big list.
      See Also:
      BigList.subList(long,long)
    • addAll

      public boolean addAll​(long i, java.util.Collection<? extends K> c)
      Description copied from class: AbstractObjectBigList
      Adds all of the elements in the specified collection to this list (optional operation).
      Specified by:
      addAll in interface BigList<K>
      Overrides:
      addAll in class AbstractObjectBigList<K>
      Parameters:
      i - index at which to insert the first element from the specified collection.
      c - collection containing elements to be added to this big list.
      Returns:
      true if this big list changed as a result of the call
      See Also:
      List.addAll(int, Collection)
    • addAll

      public boolean addAll​(java.util.Collection<? extends K> c)
      Description copied from class: AbstractObjectBigList
      Specified by:
      addAll in interface java.util.Collection<K>
      Overrides:
      addAll in class AbstractObjectBigList<K>
    • removeAll

      public boolean removeAll​(java.util.Collection<?> c)
      Specified by:
      removeAll in interface java.util.Collection<K>
      Overrides:
      removeAll in class java.util.AbstractCollection<K>
    • retainAll

      public boolean retainAll​(java.util.Collection<?> c)
      Specified by:
      retainAll in interface java.util.Collection<K>
      Overrides:
      retainAll in class java.util.AbstractCollection<K>
    • clear

      public void clear()
      Description copied from class: AbstractObjectBigList
      Specified by:
      clear in interface java.util.Collection<K>
      Overrides:
      clear in class AbstractObjectBigList<K>
    • size64

      public long size64()
      Description copied from interface: Size64
      Returns the size of this data structure as a long.
      Specified by:
      size64 in interface Size64
      Returns:
      the size of this data structure.
    • clone

      public java.lang.Object clone()