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 TypeMethodDescriptionboolean
boolean
addAll
(Collection<? extends T> c) void
clear()
boolean
boolean
containsAll
(Collection<?> c) protected abstract void
entryAdded
(T value, int index) An entry was added to the collection.protected abstract void
entryChanged
(T oldvalue, T newvalue, int index) An entry was changed in the collection.protected abstract void
entryRemoved
(T value, int index) An entry was removed from the collection.boolean
Test if this object equals another.int
hashCode()
Get the hashcode of the object.boolean
isEmpty()
iterator()
boolean
boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) int
size()
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, wait
Methods 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:
size
in interfaceCollection<T>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceCollection<T>
-
contains
- Specified by:
contains
in interfaceCollection<T>
-
iterator
-
toArray
- Specified by:
toArray
in interfaceCollection<T>
-
toArray
public <T> T[] toArray(T[] a) - Specified by:
toArray
in interfaceCollection<T>
-
add
- Specified by:
add
in interfaceCollection<T>
-
remove
- Specified by:
remove
in interfaceCollection<T>
-
containsAll
- Specified by:
containsAll
in interfaceCollection<T>
-
addAll
- Specified by:
addAll
in interfaceCollection<T>
-
removeAll
- Specified by:
removeAll
in interfaceCollection<T>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<T>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<T>
-
hashCode
public int hashCode()Get the hashcode of the object.- Specified by:
hashCode
in interfaceCollection<T>
- Overrides:
hashCode
in classObject
- Returns:
- The hashcode.
-
equals
Test if this object equals another.- Specified by:
equals
in interfaceCollection<T>
- Overrides:
equals
in 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.
-