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.String
ADDED
protected java.util.List<IChangeListener<E>>
listeners
The listeners.protected java.lang.Object
mutex
static java.lang.String
REMOVED
-
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 boolean
add(E e)
boolean
addAll(java.util.Collection<? extends E> coll)
void
addChangeListener(IChangeListener<E> lis)
Add a change listener.void
clear()
boolean
contains(java.lang.Object o)
boolean
containsAll(java.util.Collection<?> coll)
protected void
entryAdded(E value, int index)
An entry was added to the collection.protected void
entryChanged(E oldvalue, E newvalue, int index)
An entry was changed in the collection.protected void
entryRemoved(E value, int index)
An entry was removed from the collection.boolean
equals(java.lang.Object o)
Test if this object equals another.int
hashCode()
Get the hashcode of the object.boolean
isEmpty()
java.util.Iterator<E>
iterator()
protected void
notifyListeners(ChangeEvent<E> event)
Notify listeners of a change event.boolean
remove(java.lang.Object o)
boolean
removeAll(java.util.Collection<?> coll)
void
removeChangeListener(IChangeListener<E> lis)
Add a change listener.boolean
retainAll(java.util.Collection<?> coll)
int
size()
Get the size.java.lang.Object[]
toArray()
<T> T[]
toArray(T[] a)
java.lang.String
toString()
Get the string representation.java.lang.Object
transform()
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:CollectionWrapper
Get the size.- Specified by:
size
in interfacejava.util.Collection<E>
- Specified by:
size
in interfacejava.util.Set<E>
- Overrides:
size
in classCollectionWrapper<E>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacejava.util.Collection<E>
- Specified by:
isEmpty
in interfacejava.util.Set<E>
- Overrides:
isEmpty
in classCollectionWrapper<E>
-
contains
public boolean contains(java.lang.Object o)
- Specified by:
contains
in interfacejava.util.Collection<E>
- Specified by:
contains
in interfacejava.util.Set<E>
- Overrides:
contains
in classCollectionWrapper<E>
-
toArray
public java.lang.Object[] toArray()
- Specified by:
toArray
in interfacejava.util.Collection<E>
- Specified by:
toArray
in interfacejava.util.Set<E>
- Overrides:
toArray
in classCollectionWrapper<E>
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArray
in interfacejava.util.Collection<E>
- Specified by:
toArray
in interfacejava.util.Set<E>
- Overrides:
toArray
in classCollectionWrapper<E>
-
iterator
public java.util.Iterator<E> iterator()
-
add
public boolean add(E e)
- Specified by:
add
in interfacejava.util.Collection<E>
- Specified by:
add
in interfacejava.util.Set<E>
- Overrides:
add
in classCollectionWrapper<E>
-
remove
public boolean remove(java.lang.Object o)
- Specified by:
remove
in interfacejava.util.Collection<E>
- Specified by:
remove
in interfacejava.util.Set<E>
- Overrides:
remove
in classCollectionWrapper<E>
-
containsAll
public boolean containsAll(java.util.Collection<?> coll)
- Specified by:
containsAll
in interfacejava.util.Collection<E>
- Specified by:
containsAll
in interfacejava.util.Set<E>
- Overrides:
containsAll
in classCollectionWrapper<E>
-
addAll
public boolean addAll(java.util.Collection<? extends E> coll)
- Specified by:
addAll
in interfacejava.util.Collection<E>
- Specified by:
addAll
in interfacejava.util.Set<E>
- Overrides:
addAll
in classCollectionWrapper<E>
-
removeAll
public boolean removeAll(java.util.Collection<?> coll)
- Specified by:
removeAll
in interfacejava.util.Collection<E>
- Specified by:
removeAll
in interfacejava.util.Set<E>
- Overrides:
removeAll
in classCollectionWrapper<E>
-
retainAll
public boolean retainAll(java.util.Collection<?> coll)
- Specified by:
retainAll
in interfacejava.util.Collection<E>
- Specified by:
retainAll
in interfacejava.util.Set<E>
- Overrides:
retainAll
in classCollectionWrapper<E>
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Collection<E>
- Specified by:
clear
in interfacejava.util.Set<E>
- Overrides:
clear
in classCollectionWrapper<E>
-
toString
public java.lang.String toString()
Description copied from class:CollectionWrapper
Get the string representation.- Overrides:
toString
in classCollectionWrapper<E>
- Returns:
- The string representation.
-
equals
public boolean equals(java.lang.Object o)
Description copied from class:CollectionWrapper
Test if this object equals another.- Specified by:
equals
in interfacejava.util.Collection<E>
- Specified by:
equals
in interfacejava.util.Set<E>
- Overrides:
equals
in classCollectionWrapper<E>
- Parameters:
o
- The other object.- Returns:
- True, if equal.
-
hashCode
public int hashCode()
Description copied from class:CollectionWrapper
Get the hashcode of the object.- Specified by:
hashCode
in interfacejava.util.Collection<E>
- Specified by:
hashCode
in interfacejava.util.Set<E>
- Overrides:
hashCode
in classCollectionWrapper<E>
- Returns:
- The hashcode.
-
transform
public java.lang.Object transform()
Return a transformed object.- Specified by:
transform
in 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:
entryAdded
in classCollectionWrapper<E>
-
entryRemoved
protected void entryRemoved(E value, int index)
An entry was removed from the collection.- Specified by:
entryRemoved
in classCollectionWrapper<E>
-
entryChanged
protected void entryChanged(E oldvalue, E newvalue, int index)
An entry was changed in the collection.- Specified by:
entryChanged
in 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.
-
-