Package jadex.collection
Class CollectionWrapper<T>
java.lang.Object
jadex.collection.CollectionWrapper<T>
- All Implemented Interfaces:
Iterable<T>,Collection<T>
- Direct Known Subclasses:
ListWrapper,SetWrapper
Wrapper for collections. Creates rule events on add/remove/change operation calls.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanaddAll(Collection<? extends T> c) voidclear()booleanbooleancontainsAll(Collection<?> c) protected abstract voidentryAdded(T value, int index) An entry was added to the collection.protected abstract voidentryChanged(T oldvalue, T newvalue, int index) An entry was changed in the collection.protected abstract voidentryRemoved(T value, int index) An entry was removed from the collection.booleanTest if this object equals another.inthashCode()Get the hashcode of the object.booleanisEmpty()iterator()booleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) intsize()Get the size.Object[]toArray()<T> T[]toArray(T[] a) toString()Get the string representation.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, spliterator, stream, toArray
-
Field Details
-
delegate
The delegate list.
-
-
Constructor Details
-
CollectionWrapper
Create a new wrapper.- Parameters:
delegate- The delegate.
-
-
Method Details
-
size
public int size()Get the size.- Specified by:
sizein interfaceCollection<T>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<T>
-
contains
- Specified by:
containsin interfaceCollection<T>
-
iterator
-
toArray
- Specified by:
toArrayin interfaceCollection<T>
-
toArray
public <T> T[] toArray(T[] a) - Specified by:
toArrayin interfaceCollection<T>
-
add
- Specified by:
addin interfaceCollection<T>
-
remove
- Specified by:
removein interfaceCollection<T>
-
containsAll
- Specified by:
containsAllin interfaceCollection<T>
-
addAll
- Specified by:
addAllin interfaceCollection<T>
-
removeAll
- Specified by:
removeAllin interfaceCollection<T>
-
retainAll
- Specified by:
retainAllin interfaceCollection<T>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<T>
-
hashCode
public int hashCode()Get the hashcode of the object.- Specified by:
hashCodein interfaceCollection<T>- Overrides:
hashCodein classObject- Returns:
- The hashcode.
-
equals
Test if this object equals another.- Specified by:
equalsin interfaceCollection<T>- Overrides:
equalsin classObject- Parameters:
obj- The other object.- Returns:
- True, if equal.
-
toString
Get the string representation. -
entryAdded
An entry was added to the collection. -
entryRemoved
An entry was removed from the collection. -
entryChanged
An entry was changed in the collection.
-