|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- The type of domain objects in this collection.public interface DomainObjectCollection<T>
A DomainObjectCollection
represents a read-only set of domain objects of type T
.
You can use the methods of this interface to query the elements of the collection. You can also add actions which are executed as elements are added to this collection.
Method Summary | ||
---|---|---|
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 |
allObjects(Action<? super T> action)
Deprecated. Use all(Action) instead. |
|
void |
allObjects(Closure action)
Deprecated. Use all(groovy.lang.Closure) instead. |
|
Set<T> |
findAll(Spec<? super T> spec)
Returns the objects in this collection which meet the given specification. |
|
Set<T> |
getAll()
Returns the objects in this collection. |
|
DomainObjectCollection<T> |
matching(Closure spec)
Returns a collection which contains the objects in this collection which meet the given closure specification. |
|
DomainObjectCollection<T> |
matching(Spec<? super T> spec)
Returns a collection which contains the objects in this collection which meet the given specification. |
|
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. |
|
|
withType(Class<S> type)
Returns a collection containing the objects in this collection of the given type. |
|
|
withType(Class<S> type,
Action<? super S> configureAction)
Returns a collection containing the objects in this collection of the given type. |
|
|
withType(Class<S> type,
Closure configureClosure)
Returns a collection containing the objects in this collection of the given type. |
Methods inherited from interface java.lang.Iterable |
---|
iterator |
Method Detail |
---|
Set<T> getAll()
Set<T> findAll(Spec<? super T> spec)
spec
- The specification to use.
<S extends T> DomainObjectCollection<S> withType(Class<S> type)
type
- The type of objects to find.
<S extends T> DomainObjectCollection<S> withType(Class<S> type, Action<? super S> configureAction)
withType(type).all(configureAction)
type
- The type of objects to find.configureAction
- The action to execute for each object in the resulting collection.
<S extends T> DomainObjectCollection<S> withType(Class<S> type, Closure configureClosure)
withType(type).all(configureClosure)
.
type
- The type of objects to find.configureClosure
- The closure to execute for each object in the resulting collection.
DomainObjectCollection<T> matching(Spec<? super T> spec)
spec
- The specification to use.
DomainObjectCollection<T> matching(Closure spec)
spec
- The specification to use. The closure gets a collection element as an argument.
Action<? super T> whenObjectAdded(Action<? super T> action)
Action
to be executed when an object is added to this collection.
action
- The action to be executed
void whenObjectAdded(Closure action)
action
- The closure to be calledAction<? super T> whenObjectRemoved(Action<? super T> action)
Action
to be executed when an object is removed from this collection.
action
- The action to be executed
@Deprecated void allObjects(Action<? super T> action)
all(Action)
instead.
action
- The action to be executed@Deprecated void allObjects(Closure action)
all(groovy.lang.Closure)
instead.
action
- The closure to be calledvoid all(Action<? super T> action)
action
- The action to be executedvoid all(Closure action)
action
- The action to be executed
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |