org.decisiondeck.utils.collections
Class OrderDecoratedSet<E>
java.lang.Object
com.google.common.collect.ForwardingObject
com.google.common.collect.ForwardingCollection<E>
com.google.common.collect.ForwardingSet<E>
org.decisiondeck.utils.collections.OrderDecoratedSet<E>
- All Implemented Interfaces:
- Iterable<E>, Collection<E>, Set<E>
public class OrderDecoratedSet<E>
- extends ForwardingSet<E>
OrderDecoratedSet
public OrderDecoratedSet(ExternalOrderingSet<E> order,
Set<E> delegate,
boolean changeOrder)
- Parameters:
order - not null.delegate - writeable.changeOrder - if false, the given order is considered as containing every objects that may be added or
queried in the given delegate set. The order will not be changed. If an object is added to the given
set and is not in the order, an IllegalStateException is thrown. If true, when an
object is added to this set, it is added as the best one in the given order (override add to modify
this behavior), and when removed, it is removed from the given order (override remove and clear to
modify this behavior).
add
public boolean add(E element)
- Specified by:
add in interface Collection<E>- Specified by:
add in interface Set<E>- Overrides:
add in class ForwardingCollection<E>
clear
public void clear()
- Specified by:
clear in interface Collection<E>- Specified by:
clear in interface Set<E>- Overrides:
clear in class ForwardingCollection<E>
remove
public boolean remove(Object object)
- Specified by:
remove in interface Collection<E>- Specified by:
remove in interface Set<E>- Overrides:
remove in class ForwardingCollection<E>
iterator
public Iterator<E> iterator()
- Specified by:
iterator in interface Iterable<E>- Specified by:
iterator in interface Collection<E>- Specified by:
iterator in interface Set<E>- Overrides:
iterator in class ForwardingCollection<E>
removeAll
public boolean removeAll(Collection<?> collection)
- Specified by:
removeAll in interface Collection<E>- Specified by:
removeAll in interface Set<E>- Overrides:
removeAll in class ForwardingCollection<E>
addAll
public boolean addAll(Collection<? extends E> collection)
- Specified by:
addAll in interface Collection<E>- Specified by:
addAll in interface Set<E>- Overrides:
addAll in class ForwardingCollection<E>
retainAll
public boolean retainAll(Collection<?> collection)
- Specified by:
retainAll in interface Collection<E>- Specified by:
retainAll in interface Set<E>- Overrides:
retainAll in class ForwardingCollection<E>
toArray
public Object[] toArray()
- Specified by:
toArray in interface Collection<E>- Specified by:
toArray in interface Set<E>- Overrides:
toArray in class ForwardingCollection<E>
toArray
public <T> T[] toArray(T[] array)
- Specified by:
toArray in interface Collection<E>- Specified by:
toArray in interface Set<E>- Overrides:
toArray in class ForwardingCollection<E>
Copyright © 2011. All Rights Reserved.