soot.util
Class SingletonList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList
          extended by soot.util.SingletonList
All Implemented Interfaces:
Iterable, Collection, List

public class SingletonList
extends AbstractList

A list containing exactly one object, immutable.

Author:
Ondrej Lhotak

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
SingletonList(Object o)
           
 
Method Summary
 boolean contains(Object other)
           
 Object get(int index)
           
 int size()
           
 
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
addAll, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 

Constructor Detail

SingletonList

public SingletonList(Object o)
Method Detail

size

public int size()
Specified by:
size in interface Collection
Specified by:
size in interface List
Specified by:
size in class AbstractCollection

contains

public boolean contains(Object other)
Specified by:
contains in interface Collection
Specified by:
contains in interface List
Overrides:
contains in class AbstractCollection

get

public Object get(int index)
Specified by:
get in interface List
Specified by:
get in class AbstractList