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

java.lang.Object
  extended byit.unimi.dsi.fastutil.objects.AbstractReferenceCollection
      extended byit.unimi.dsi.fastutil.objects.AbstractReferenceList
          extended byit.unimi.dsi.fastutil.objects.ReferenceLists.Singleton
All Implemented Interfaces:
Cloneable, Collection, List, ReferenceCollection, ReferenceList, Serializable, Stack
Enclosing class:
ReferenceLists

public static class ReferenceLists.Singleton
extends AbstractReferenceList
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

Nested Class Summary
 
Nested classes inherited from class it.unimi.dsi.fastutil.objects.AbstractReferenceList
AbstractReferenceList.ReferenceSubList
 
Field Summary
static long serialVersionUID
           
 
Method Summary
 void add(int i, Object k)
           
 boolean add(Object k)
           
 boolean addAll(int i, ReferenceCollection c)
          Delegates to a more generic method.
 boolean addAll(int i, ReferenceList c)
          Delegates to a more generic method.
 boolean addAll(ReferenceCollection c)
          Delegates to a more generic method.
 boolean addAll(ReferenceList 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.
 ReferenceList referenceSubList(int from, int to)
           
 boolean rem(Object k)
           
 Object remove(int i)
           
 boolean removeAll(ReferenceCollection c)
           
 boolean retainAll(ReferenceCollection c)
           
 int size()
           
 void size(int size)
          Sets the size of this list.
 Object[] toArray()
           
 
Methods inherited from class it.unimi.dsi.fastutil.objects.AbstractReferenceList
addAll, addAll, addElements, addElements, 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.AbstractReferenceCollection
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 AbstractReferenceList

add

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

add

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

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 AbstractReferenceList

contains

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

addAll

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

Overrides:
addAll in class AbstractReferenceList

addAll

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

Overrides:
addAll in class AbstractReferenceList

addAll

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

Overrides:
addAll in class AbstractReferenceList

addAll

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

Overrides:
addAll in class AbstractReferenceList

removeAll

public boolean removeAll(ReferenceCollection c)

retainAll

public boolean retainAll(ReferenceCollection c)

toArray

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

objectListIterator

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

Specified by:
objectListIterator in interface ReferenceList
Overrides:
objectListIterator in class AbstractReferenceList

objectListIterator

public ObjectListIterator objectListIterator(int i)
Description copied from interface: ReferenceList
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 ReferenceList
Overrides:
objectListIterator in class AbstractReferenceList

referenceSubList

public ReferenceList referenceSubList(int from,
                                      int to)
Specified by:
referenceSubList in interface ReferenceList
Overrides:
referenceSubList in class AbstractReferenceList

size

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

size

public void size(int size)
Description copied from interface: ReferenceList
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 ReferenceList
Overrides:
size in class AbstractReferenceList

clear

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

clone

public Object clone()