Package soot.util
Class EmptyChain<T>
- java.lang.Object
-
- soot.util.EmptyChain<T>
-
- Type Parameters:
T-
- All Implemented Interfaces:
Serializable,Iterable<T>,Collection<T>,Chain<T>
public class EmptyChain<T> extends Object implements Chain<T>
Class representing an unmodifiable empty chain- Author:
- Steven Arzt
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description EmptyChain()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(T e)booleanaddAll(Collection<? extends T> c)voidaddFirst(T u)Adds the given object at the beginning of the Chain.voidaddLast(T u)Adds the given object at the end of the Chain.voidclear()booleancontains(Object o)booleancontainsAll(Collection<?> c)booleanfollows(T someObject, T someReferenceObject)Returns true if objectsomeObjectfollows objectsomeReferenceObjectin the Chain, i.e.Collection<T>getElementsUnsorted()Gets all elements in the chain.TgetFirst()Returns the first object in this Chain.TgetLast()Returns the last object in this Chain.longgetModificationCount()Returns the number of times this chain has been modified.TgetPredOf(T point)Returns the object immediately precedingpoint.TgetSuccOf(T point)Returns the object immediately followingpoint.voidinsertAfter(Collection<? extends T> toInsert, T point)InsertstoInsertin the Chain afterpoint.voidinsertAfter(List<T> toInsert, T point)InsertstoInsertin the Chain afterpoint.voidinsertAfter(Chain<T> toInsert, T point)InsertstoInsertin the Chain afterpoint.voidinsertAfter(T toInsert, T point)InsertstoInsertin the Chain afterpoint.voidinsertBefore(Collection<? extends T> toInsert, T point)InsertstoInsertin the Chain beforepoint.voidinsertBefore(List<T> toInsert, T point)InsertstoInsertin the Chain beforepoint.voidinsertBefore(Chain<T> toInsert, T point)InsertstoInsertin the Chain beforepoint.voidinsertBefore(T toInsert, T point)InsertstoInsertin the Chain beforepoint.booleanisEmpty()Iterator<T>iterator()Returns an iterator over this Chain.Iterator<T>iterator(T u)Returns an iterator over this Chain, starting at the given object.Iterator<T>iterator(T head, T tail)Returns an iterator over this Chain, starting at head and reaching tail (inclusive).booleanremove(Object u)Removes the given object from this Chain.booleanremoveAll(Collection<?> c)voidremoveFirst()Removes the first object contained in this Chain.voidremoveLast()Removes the last object contained in this Chain.booleanretainAll(Collection<?> c)intsize()Returns the size of this Chain.Iterator<T>snapshotIterator()Returns an iterator over a copy of this chain.voidswapWith(T out, T in)Replacesoutin the Chain byin.Object[]toArray()<X> X[]toArray(X[] a)StringtoString()static <X> EmptyChain<X>v()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
-
-
-
-
Method Detail
-
v
public static <X> EmptyChain<X> v()
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceCollection<T>
-
contains
public boolean contains(Object o)
- Specified by:
containsin interfaceCollection<T>
-
toArray
public Object[] toArray()
- Specified by:
toArrayin interfaceCollection<T>
-
toArray
public <X> X[] toArray(X[] a)
- Specified by:
toArrayin interfaceCollection<T>
-
add
public boolean add(T e)
- Specified by:
addin interfaceCollection<T>
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAllin interfaceCollection<T>
-
addAll
public boolean addAll(Collection<? extends T> c)
- Specified by:
addAllin interfaceCollection<T>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAllin interfaceCollection<T>
-
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAllin interfaceCollection<T>
-
clear
public void clear()
- Specified by:
clearin interfaceCollection<T>
-
insertBefore
public void insertBefore(List<T> toInsert, T point)
Description copied from interface:ChainInsertstoInsertin the Chain beforepoint.- Specified by:
insertBeforein interfaceChain<T>
-
insertAfter
public void insertAfter(List<T> toInsert, T point)
Description copied from interface:ChainInsertstoInsertin the Chain afterpoint.- Specified by:
insertAfterin interfaceChain<T>
-
insertAfter
public void insertAfter(T toInsert, T point)
Description copied from interface:ChainInsertstoInsertin the Chain afterpoint.- Specified by:
insertAfterin interfaceChain<T>
-
insertBefore
public void insertBefore(T toInsert, T point)
Description copied from interface:ChainInsertstoInsertin the Chain beforepoint.- Specified by:
insertBeforein interfaceChain<T>
-
insertBefore
public void insertBefore(Chain<T> toInsert, T point)
Description copied from interface:ChainInsertstoInsertin the Chain beforepoint.- Specified by:
insertBeforein interfaceChain<T>
-
insertAfter
public void insertAfter(Chain<T> toInsert, T point)
Description copied from interface:ChainInsertstoInsertin the Chain afterpoint.- Specified by:
insertAfterin interfaceChain<T>
-
swapWith
public void swapWith(T out, T in)
Description copied from interface:ChainReplacesoutin the Chain byin.
-
remove
public boolean remove(Object u)
Description copied from interface:ChainRemoves the given object from this Chain. Parameter has to be of typeObjectto be compatible with theCollectioninterface.
-
addFirst
public void addFirst(T u)
Description copied from interface:ChainAdds the given object at the beginning of the Chain.
-
addLast
public void addLast(T u)
Description copied from interface:ChainAdds the given object at the end of the Chain.
-
removeFirst
public void removeFirst()
Description copied from interface:ChainRemoves the first object contained in this Chain.- Specified by:
removeFirstin interfaceChain<T>
-
removeLast
public void removeLast()
Description copied from interface:ChainRemoves the last object contained in this Chain.- Specified by:
removeLastin interfaceChain<T>
-
follows
public boolean follows(T someObject, T someReferenceObject)
Description copied from interface:ChainReturns true if objectsomeObjectfollows objectsomeReferenceObjectin the Chain, i.e. someReferenceObject comes first and then someObject.
-
getFirst
public T getFirst()
Description copied from interface:ChainReturns the first object in this Chain.
-
getLast
public T getLast()
Description copied from interface:ChainReturns the last object in this Chain.
-
getSuccOf
public T getSuccOf(T point)
Description copied from interface:ChainReturns the object immediately followingpoint.
-
getPredOf
public T getPredOf(T point)
Description copied from interface:ChainReturns the object immediately precedingpoint.
-
snapshotIterator
public Iterator<T> snapshotIterator()
Description copied from interface:ChainReturns an iterator over a copy of this chain. This avoids ConcurrentModificationExceptions from being thrown if the underlying Chain is modified during iteration. Do not use this to remove elements which have not yet been iterated over!- Specified by:
snapshotIteratorin interfaceChain<T>
-
iterator
public Iterator<T> iterator()
Description copied from interface:ChainReturns an iterator over this Chain.
-
iterator
public Iterator<T> iterator(T u)
Description copied from interface:ChainReturns an iterator over this Chain, starting at the given object.
-
iterator
public Iterator<T> iterator(T head, T tail)
Description copied from interface:ChainReturns an iterator over this Chain, starting at head and reaching tail (inclusive).
-
size
public int size()
Description copied from interface:ChainReturns the size of this Chain.
-
getModificationCount
public long getModificationCount()
Description copied from interface:ChainReturns the number of times this chain has been modified.- Specified by:
getModificationCountin interfaceChain<T>
-
getElementsUnsorted
public Collection<T> getElementsUnsorted()
Description copied from interface:ChainGets all elements in the chain. There is no guarantee on sorting. On the other hand, the collection returned by this method is thread-safe. You can iterate over it even in the case of concurrent modifications to the underlying chain.- Specified by:
getElementsUnsortedin interfaceChain<T>- Returns:
- All elements in the chain in an unsorted collection
-
insertAfter
public void insertAfter(Collection<? extends T> toInsert, T point)
Description copied from interface:ChainInsertstoInsertin the Chain afterpoint.- Specified by:
insertAfterin interfaceChain<T>
-
insertBefore
public void insertBefore(Collection<? extends T> toInsert, T point)
Description copied from interface:ChainInsertstoInsertin the Chain beforepoint.- Specified by:
insertBeforein interfaceChain<T>
-
-