public class DelegatingDomainObjectSet<T> extends Object implements DomainObjectSet<T>
| Constructor and Description |
|---|
DelegatingDomainObjectSet(DomainObjectSet<T> backingSet) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(T o) |
boolean |
addAll(Collection<? extends T> c) |
void |
all(Action<? super T> action)
Executes the given action against all objects in this collection, and any objects subsequently added to this
collection.
|
void |
all(Closure action)
Executes the given closure against all objects in this collection, and any objects subsequently added to this collection.
|
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
Set<T> |
findAll(Closure spec)
Returns a collection which contains the objects in this collection which meet the given closure specification.
|
boolean |
isEmpty() |
Iterator<T> |
iterator() |
DomainObjectSet<T> |
matching(Closure spec)
Returns a collection which contains the objects in this collection which meet the given closure specification.
|
DomainObjectSet<T> |
matching(Spec<? super T> spec)
Returns a collection which contains the objects in this collection which meet the given specification.
|
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
int |
size() |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
Action<? super T> |
whenObjectAdded(Action<? super T> action)
Adds an
Action to be executed when an object is added to this collection. |
void |
whenObjectAdded(Closure action)
Adds a closure to be called when an object is added to this collection.
|
Action<? super T> |
whenObjectRemoved(Action<? super T> action)
Adds an
Action to be executed when an object is removed from this collection. |
void |
whenObjectRemoved(Closure action)
Adds a closure to be called when an object is removed from this collection.
|
<S extends T> |
withType(Class<S> type)
Returns a collection containing the objects in this collection of the given type.
|
<S extends T> |
withType(Class<S> type,
Action<? super S> configureAction)
Returns a collection containing the objects in this collection of the given type.
|
<S extends T> |
withType(Class<S> type,
Closure configureClosure)
Returns a collection containing the objects in this collection of the given type.
|
public DelegatingDomainObjectSet(DomainObjectSet<T> backingSet)
public DomainObjectSet<T> matching(Closure spec)
DomainObjectSetmatching in interface DomainObjectCollection<T>matching in interface DomainObjectSet<T>spec - The specification to use. The closure gets a collection element as an argument.public DomainObjectSet<T> matching(Spec<? super T> spec)
DomainObjectSetmatching in interface DomainObjectCollection<T>matching in interface DomainObjectSet<T>spec - The specification to use.public <S extends T> DomainObjectSet<S> withType(Class<S> type)
DomainObjectSetwithType in interface DomainObjectCollection<T>withType in interface DomainObjectSet<T>type - The type of objects to find.public void all(Action<? super T> action)
DomainObjectCollectionall in interface DomainObjectCollection<T>action - The action to be executedpublic void all(Closure action)
DomainObjectCollectionall in interface DomainObjectCollection<T>action - The action to be executedpublic Action<? super T> whenObjectAdded(Action<? super T> action)
DomainObjectCollectionAction to be executed when an object is added to this collection.whenObjectAdded in interface DomainObjectCollection<T>action - The action to be executedpublic void whenObjectAdded(Closure action)
DomainObjectCollectionwhenObjectAdded in interface DomainObjectCollection<T>action - The closure to be calledpublic Action<? super T> whenObjectRemoved(Action<? super T> action)
DomainObjectCollectionAction to be executed when an object is removed from this collection.whenObjectRemoved in interface DomainObjectCollection<T>action - The action to be executedpublic void whenObjectRemoved(Closure action)
DomainObjectCollectionwhenObjectRemoved in interface DomainObjectCollection<T>action - The closure to be calledpublic <S extends T> DomainObjectCollection<S> withType(Class<S> type, Action<? super S> configureAction)
DomainObjectCollectionwithType(type).all(configureAction)withType in interface DomainObjectCollection<T>type - The type of objects to find.configureAction - The action to execute for each object in the resulting collection.public <S extends T> DomainObjectCollection<S> withType(Class<S> type, Closure configureClosure)
DomainObjectCollectionwithType(type).all(configureClosure).withType in interface DomainObjectCollection<T>type - The type of objects to find.configureClosure - The closure to execute for each object in the resulting collection.public boolean add(T o)
public boolean addAll(Collection<? extends T> c)
public void clear()
public boolean contains(Object o)
public boolean containsAll(Collection<?> c)
containsAll in interface Collection<T>containsAll in interface Set<T>public boolean isEmpty()
public boolean remove(Object o)
public boolean removeAll(Collection<?> c)
public boolean retainAll(Collection<?> c)
public int size()
public Object[] toArray()
public <T> T[] toArray(T[] a)
public Set<T> findAll(Closure spec)
DomainObjectSetfindAll in interface DomainObjectCollection<T>findAll in interface DomainObjectSet<T>spec - The specification to use. The closure gets a collection element as an argument.Copyright © 2013. All rights reserved