Class ObjectBigLists.Singleton<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 Detail

      • 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>
      • 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.
      • 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)
      • 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>
      • 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()