it.unimi.dsi.fastutil.objects
Class ObjectLists.Singleton

java.lang.Object
  extended byit.unimi.dsi.fastutil.objects.AbstractObjectCollection
      extended byit.unimi.dsi.fastutil.objects.AbstractObjectList
          extended byit.unimi.dsi.fastutil.objects.ObjectLists.Singleton
All Implemented Interfaces:
Cloneable, Collection, Comparable, List, ObjectCollection, ObjectList, Serializable, Stack
Enclosing class:
ObjectLists

public static class ObjectLists.Singleton
extends AbstractObjectList
implements Serializable, Cloneable

An immutable class representing a type-specific singleton list.

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

See Also:
Serialized Form

Field Summary
static long serialVersionUID
           
 
Method Summary
 void add(int i, Object k)
           
 boolean add(Object k)
           
 boolean addAll(int i, ObjectCollection c)
          Delegates to a more generic method.
 boolean addAll(int i, ObjectList c)
          Delegates to a more generic method.
 boolean addAll(ObjectCollection c)
          Delegates to a more generic method.
 boolean addAll(ObjectList c)
          Delegates to a more generic method.
 void clear()
           
 Object clone()
           
 boolean contains(Object k)
           
 Object get(int i)
           
 ObjectListIterator objectListIterator()
          Delegates to the corresponding list-iterator method.
 ObjectListIterator objectListIterator(int i)
          Returns a type-specific list iterator on the list starting at a given index.
 ObjectList objectSubList(int from, int to)
           
 boolean rem(Object k)
           
 Object remove(int i)
           
 boolean removeAll(ObjectCollection c)
           
 boolean retainAll(ObjectCollection c)
           
 int size()
           
 void size(int size)
          Sets the size of this list.
 Object[] toArray()
           
 
Methods inherited from class it.unimi.dsi.fastutil.objects.AbstractObjectList
addAll, addAll, addElements, addElements, compareTo, equals, getElements, hashCode, indexOf, lastIndexOf, listIterator, listIterator, objectIterator, peek, pop, push, removeElements, set, subList, top, toString
 
Methods inherited from class it.unimi.dsi.fastutil.objects.AbstractObjectCollection
containsAll, isEmpty, iterator, remove, removeAll, retainAll, toArray
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, isEmpty, iterator, remove, removeAll, retainAll, toArray
 
Methods inherited from interface it.unimi.dsi.fastutil.Stack
isEmpty
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values
Method Detail

rem

public boolean rem(Object k)
Overrides:
rem in class AbstractObjectList

add

public boolean add(Object k)
Specified by:
add in interface List
Overrides:
add in class AbstractObjectCollection

add

public void add(int i,
                Object k)
Specified by:
add in interface List
Overrides:
add in class AbstractObjectList

get

public Object get(int i)
Specified by:
get in interface List

remove

public Object remove(int i)
Specified by:
remove in interface List
Overrides:
remove in class AbstractObjectList

contains

public boolean contains(Object k)
Specified by:
contains in interface List
Overrides:
contains in class AbstractObjectList

addAll

public boolean addAll(ObjectList c)
Description copied from class: AbstractObjectList
Delegates to a more generic method.

Overrides:
addAll in class AbstractObjectList

addAll

public boolean addAll(ObjectCollection c)
Description copied from class: AbstractObjectList
Delegates to a more generic method.

Overrides:
addAll in class AbstractObjectList

addAll

public boolean addAll(int i,
                      ObjectList c)
Description copied from class: AbstractObjectList
Delegates to a more generic method.

Overrides:
addAll in class AbstractObjectList

addAll

public boolean addAll(int i,
                      ObjectCollection c)
Description copied from class: AbstractObjectList
Delegates to a more generic method.

Overrides:
addAll in class AbstractObjectList

removeAll

public boolean removeAll(ObjectCollection c)

retainAll

public boolean retainAll(ObjectCollection c)

toArray

public Object[] toArray()
Specified by:
toArray in interface List
Overrides:
toArray in class AbstractObjectCollection

objectListIterator

public ObjectListIterator objectListIterator()
Description copied from class: AbstractObjectList
Delegates to the corresponding list-iterator method.

Specified by:
objectListIterator in interface ObjectList
Overrides:
objectListIterator in class AbstractObjectList

objectListIterator

public ObjectListIterator objectListIterator(int i)
Description copied from interface: ObjectList
Returns a type-specific list iterator on the list starting at a given index.

The iterator returned by the List.listIterator() method and by this method are identical; however, using this method you can save a type casting.

Specified by:
objectListIterator in interface ObjectList
See Also:
List.listIterator(int)

objectSubList

public ObjectList objectSubList(int from,
                                int to)
Specified by:
objectSubList in interface ObjectList
Overrides:
objectSubList in class AbstractObjectList

size

public int size()
Specified by:
size in interface List

size

public void size(int size)
Description copied from interface: ObjectList
Sets the size of this list.

If the specified size is smaller than the current size, the last elements are discarded. Otherwise, they are filled with 0/null/false.

Specified by:
size in interface ObjectList
Overrides:
size in class AbstractObjectList

clear

public void clear()
Specified by:
clear in interface List
Overrides:
clear in class AbstractObjectCollection

clone

public Object clone()