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.

        This implementation always throws an UnsupportedOperationException.

        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.

        This implementation delegates to indexOf().

        Specified by:
        contains in interface java.util.Collection<K>
        Overrides:
        contains in class AbstractObjectBigList<K>
        See Also:
        Collection.contains(Object)
      • toArray

        public java.lang.Object[] toArray()
        Specified by:
        toArray in interface java.util.Collection<K>
        Overrides:
        toArray in class java.util.AbstractCollection<K>
      • 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()