Class TransformSet<E>
- java.lang.Object
-
- jadex.commons.collection.wrappers.CollectionWrapper<T>
-
- jadex.commons.collection.wrappers.SetWrapper<E>
-
- jadex.commons.transformation.traverser.TransformSet<E>
-
- All Implemented Interfaces:
ITransformableObject,java.lang.Iterable<E>,java.util.Collection<E>,java.util.Set<E>
public class TransformSet<E> extends SetWrapper<E> implements ITransformableObject
A set that transforms itself, i.e. makes a copy of itself. This ensures that the serializer has no concurrent access to the base object.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringADDEDprotected java.util.List<IChangeListener<E>>listenersThe listeners.protected java.lang.Objectmutexstatic java.lang.StringREMOVED-
Fields inherited from class jadex.commons.collection.wrappers.CollectionWrapper
delegate
-
-
Constructor Summary
Constructors Constructor Description TransformSet()Create a new TransformSet.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(E e)booleanaddAll(java.util.Collection<? extends E> coll)voidaddChangeListener(IChangeListener<E> lis)Add a change listener.voidclear()booleancontains(java.lang.Object o)booleancontainsAll(java.util.Collection<?> coll)protected voidentryAdded(E value, int index)An entry was added to the collection.protected voidentryChanged(E oldvalue, E newvalue, int index)An entry was changed in the collection.protected voidentryRemoved(E value, int index)An entry was removed from the collection.booleanequals(java.lang.Object o)Test if this object equals another.inthashCode()Get the hashcode of the object.booleanisEmpty()java.util.Iterator<E>iterator()protected voidnotifyListeners(ChangeEvent<E> event)Notify listeners of a change event.booleanremove(java.lang.Object o)booleanremoveAll(java.util.Collection<?> coll)voidremoveChangeListener(IChangeListener<E> lis)Add a change listener.booleanretainAll(java.util.Collection<?> coll)intsize()Get the size.java.lang.Object[]toArray()<T> T[]toArray(T[] a)java.lang.StringtoString()Get the string representation.java.lang.Objecttransform()Return a transformed object.
-
-
-
Field Detail
-
ADDED
public static final java.lang.String ADDED
- See Also:
- Constant Field Values
-
REMOVED
public static final java.lang.String REMOVED
- See Also:
- Constant Field Values
-
listeners
protected java.util.List<IChangeListener<E>> listeners
The listeners.
-
mutex
protected final java.lang.Object mutex
-
-
Method Detail
-
size
public int size()
Description copied from class:CollectionWrapperGet the size.- Specified by:
sizein interfacejava.util.Collection<E>- Specified by:
sizein interfacejava.util.Set<E>- Overrides:
sizein classCollectionWrapper<E>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfacejava.util.Collection<E>- Specified by:
isEmptyin interfacejava.util.Set<E>- Overrides:
isEmptyin classCollectionWrapper<E>
-
contains
public boolean contains(java.lang.Object o)
- Specified by:
containsin interfacejava.util.Collection<E>- Specified by:
containsin interfacejava.util.Set<E>- Overrides:
containsin classCollectionWrapper<E>
-
toArray
public java.lang.Object[] toArray()
- Specified by:
toArrayin interfacejava.util.Collection<E>- Specified by:
toArrayin interfacejava.util.Set<E>- Overrides:
toArrayin classCollectionWrapper<E>
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArrayin interfacejava.util.Collection<E>- Specified by:
toArrayin interfacejava.util.Set<E>- Overrides:
toArrayin classCollectionWrapper<E>
-
iterator
public java.util.Iterator<E> iterator()
-
add
public boolean add(E e)
- Specified by:
addin interfacejava.util.Collection<E>- Specified by:
addin interfacejava.util.Set<E>- Overrides:
addin classCollectionWrapper<E>
-
remove
public boolean remove(java.lang.Object o)
- Specified by:
removein interfacejava.util.Collection<E>- Specified by:
removein interfacejava.util.Set<E>- Overrides:
removein classCollectionWrapper<E>
-
containsAll
public boolean containsAll(java.util.Collection<?> coll)
- Specified by:
containsAllin interfacejava.util.Collection<E>- Specified by:
containsAllin interfacejava.util.Set<E>- Overrides:
containsAllin classCollectionWrapper<E>
-
addAll
public boolean addAll(java.util.Collection<? extends E> coll)
- Specified by:
addAllin interfacejava.util.Collection<E>- Specified by:
addAllin interfacejava.util.Set<E>- Overrides:
addAllin classCollectionWrapper<E>
-
removeAll
public boolean removeAll(java.util.Collection<?> coll)
- Specified by:
removeAllin interfacejava.util.Collection<E>- Specified by:
removeAllin interfacejava.util.Set<E>- Overrides:
removeAllin classCollectionWrapper<E>
-
retainAll
public boolean retainAll(java.util.Collection<?> coll)
- Specified by:
retainAllin interfacejava.util.Collection<E>- Specified by:
retainAllin interfacejava.util.Set<E>- Overrides:
retainAllin classCollectionWrapper<E>
-
clear
public void clear()
- Specified by:
clearin interfacejava.util.Collection<E>- Specified by:
clearin interfacejava.util.Set<E>- Overrides:
clearin classCollectionWrapper<E>
-
toString
public java.lang.String toString()
Description copied from class:CollectionWrapperGet the string representation.- Overrides:
toStringin classCollectionWrapper<E>- Returns:
- The string representation.
-
equals
public boolean equals(java.lang.Object o)
Description copied from class:CollectionWrapperTest if this object equals another.- Specified by:
equalsin interfacejava.util.Collection<E>- Specified by:
equalsin interfacejava.util.Set<E>- Overrides:
equalsin classCollectionWrapper<E>- Parameters:
o- The other object.- Returns:
- True, if equal.
-
hashCode
public int hashCode()
Description copied from class:CollectionWrapperGet the hashcode of the object.- Specified by:
hashCodein interfacejava.util.Collection<E>- Specified by:
hashCodein interfacejava.util.Set<E>- Overrides:
hashCodein classCollectionWrapper<E>- Returns:
- The hashcode.
-
transform
public java.lang.Object transform()
Return a transformed object.- Specified by:
transformin interfaceITransformableObject- Returns:
- A transformed version of the object.
-
entryAdded
protected void entryAdded(E value, int index)
An entry was added to the collection.- Specified by:
entryAddedin classCollectionWrapper<E>
-
entryRemoved
protected void entryRemoved(E value, int index)
An entry was removed from the collection.- Specified by:
entryRemovedin classCollectionWrapper<E>
-
entryChanged
protected void entryChanged(E oldvalue, E newvalue, int index)
An entry was changed in the collection.- Specified by:
entryChangedin classCollectionWrapper<E>
-
notifyListeners
protected void notifyListeners(ChangeEvent<E> event)
Notify listeners of a change event.- Parameters:
event- The event.
-
addChangeListener
public void addChangeListener(IChangeListener<E> lis)
Add a change listener.- Parameters:
lis- The listener.
-
removeChangeListener
public void removeChangeListener(IChangeListener<E> lis)
Add a change listener.- Parameters:
lis- The listener.
-
-