public interface MDWCollection<E> extends Collection<E>
MDWObject
element of this collection. MDWCollection
enables to:
String
using concat(String scriptName)
detect(String scriptName, Object value)
MDWObject
elements of this collection using sort(String scriptName)
This interface is not intended to be implemented by clients.
Modifier and Type | Method and Description |
---|---|
<T> MDWList<T> |
collect(EStructuralFeature feature)
Evaluates the specified feature on each
MDWObject of this collection,
and concatenates the results into a new list. |
<T> MDWList<T> |
collect(String scriptName)
Evaluates the specified script on each
MDWObject of this collection,
and concatenates the results into a new list. |
<T> MDWList<T> |
collect(String scriptName,
List<?> arguments)
Evaluates the specified script on each
MDWObject of this collection,
and concatenates the results into a new list. |
String |
concat(EStructuralFeature feature)
Evaluates the specified feature on each
MDWObject of this collection,
and concatenates the results into a String . |
String |
concat(EStructuralFeature feature,
String separator)
Evaluates the specified feature on each
MDWObject of this collection,
and concatenates the results into a String . |
String |
concat(String scriptName)
Evaluates the specified script on each
MDWObject of this collection,
and concatenates the results into a String . |
String |
concat(String scriptName,
List<?> arguments)
Evaluates the specified script on each
MDWObject of this collection,
and concatenates the results into a String . |
String |
concat(String scriptName,
List<?> arguments,
String separator)
Evaluates the specified script on each
MDWObject of this collection,
and concatenates the results into a String . |
String |
concat(String scriptName,
String separator)
Evaluates the specified script on each
MDWObject of this collection,
and concatenates the results into a String . |
<T extends MDWObject> |
detect(EStructuralFeature feature,
Object value)
Returns the first
MDWObject of this collection whose feature matches the specified value. |
<T extends MDWObject> |
detect(String scriptName,
List<?> arguments,
Object value)
Returns the first
MDWObject of this collection whose script evaluation result matches the specified value. |
<T extends MDWObject> |
detect(String scriptName,
Object value)
Returns the first
MDWObject of this collection whose script evaluation result matches the specified value. |
MDWList<E> |
sort(EStructuralFeature feature)
Returns a sorted list into ascending order induced by the specified feature.
|
MDWList<E> |
sort(String scriptName)
Returns a sorted list into ascending order induced by the specified script.
|
MDWList<E> |
sort(String scriptName,
List<?> arguments)
Returns a sorted list into ascending order induced by the specified script.
|
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray
String concat(String scriptName)
MDWObject
of this collection,
and concatenates the results into a String
.
This collection is expected to contain only MDWObject
instances. A ClassCastException
is thrown if any other kind of
element is found (null
values are silently ignored).
scriptName
- the name of the script to evaluate on each MDWObject
.
This script must not expect any parameter.ClassCastException
- if the collection contains anything else than MDWObject
instances.String concat(String scriptName, String separator)
MDWObject
of this collection,
and concatenates the results into a String
.
This collection is expected to contain only MDWObject
instances. A ClassCastException
is thrown if any other kind of
element is found (null
values are silently ignored).
The separator is inserted between each concatenated (non empty) script result.
scriptName
- the name of the script to evaluate on each MDWObject
.
This script must not expect any parameter.separator
- a separator to insert between each concatenated script resultClassCastException
- if the collection contains anything else than MDWObject
instances.String concat(String scriptName, List<?> arguments)
MDWObject
of this collection,
and concatenates the results into a String
.
This collection is expected to contain only MDWObject
instances. A ClassCastException
is thrown if any other kind of
element is found (null
values are silently ignored).
The number and type of arguments must match the parameters of the script.
scriptName
- the name of the script to evaluate on each MDWObject
.arguments
- the script arguments.ClassCastException
- if the collection contains anything else than MDWObject
instances.String concat(String scriptName, List<?> arguments, String separator)
MDWObject
of this collection,
and concatenates the results into a String
.
This collection is expected to contain only MDWObject
instances. A ClassCastException
is thrown if any other kind of
element is found (null
values are silently ignored).
The number and type of arguments must match the parameters of the script.
The separator is inserted between each concatenated (non empty) script result.
scriptName
- the name of the script to evaluate on each MDWObject
.arguments
- the script arguments.separator
- a separator to insert between each concatenated script result.ClassCastException
- if the collection contains anything else than MDWObject
instances.String concat(EStructuralFeature feature)
MDWObject
of this collection,
and concatenates the results into a String
.
This collection is expected to contain only MDWObject
instances. A ClassCastException
is thrown if any other kind of
element is found (null
values are silently ignored).
feature
- the feature to evaluate on each MDWObject
.ClassCastException
- if the collection contains anything else than MDWObject
instances.String concat(EStructuralFeature feature, String separator)
MDWObject
of this collection,
and concatenates the results into a String
.
This collection is expected to contain only MDWObject
instances. A ClassCastException
is thrown if any other kind of
element is found (null
values are silently ignored).
The separator is inserted between each concatenated (non empty) feature result.
feature
- the feature to evaluate on each MDWObject
.separator
- a separator to insert between each concatenated script resultClassCastException
- if the collection contains anything else than MDWObject
instances.<T extends MDWObject> T detect(String scriptName, Object value)
MDWObject
of this collection whose script evaluation result matches the specified value.
This collection is expected to contain only MDWObject
instances. A ClassCastException
is thrown if any other kind of
element is found (null
values are silently ignored).
T
- the type of elements in the returned collection.scriptName
- the name of the script to evaluate on each MDWObject
.
This script must not expect any parameter.value
- the comparison criterium (can be null
).MDWObject
instances whose script result matches the specified value, null
if no instance matches
the value.ClassCastException
- if the collection contains anything else than MDWObject
instances.<T extends MDWObject> T detect(String scriptName, List<?> arguments, Object value)
MDWObject
of this collection whose script evaluation result matches the specified value.
This collection is expected to contain only MDWObject
instances. A ClassCastException
is thrown if any other kind of
element is found (null
values are silently ignored).
The number and type of arguments must match the parameters of the script.
T
- the type of elements in the returned collection.scriptName
- the name of the script to evaluate on each MDWObject
.arguments
- the script arguments.value
- the comparison criterium (can be null
).MDWObject
instances whose script result matches the specified value, null
if no instance matches
the value.ClassCastException
- if the collection contains anything else than MDWObject
instances.<T extends MDWObject> T detect(EStructuralFeature feature, Object value)
MDWObject
of this collection whose feature matches the specified value.
This collection is expected to contain only MDWObject
instances. A ClassCastException
is thrown if any other kind of
element is found (null
values are silently ignored).
T
- the type of elements in the returned collection.feature
- the feature to evaluate on each MDWObject
.value
- the comparison criterium (can be null
).MDWObject
instances whose feature matches the specified value, null
if no instance matches the
value.ClassCastException
- if the collection contains anything else than MDWObject
instances.<T> MDWList<T> collect(String scriptName)
MDWObject
of this collection,
and concatenates the results into a new list.
The returned list is always flattened: if a script result is a collection (Collection
, Map
, Iterator
or
array
), we iterate on this collection and add each element into the returned list.
This collection is expected to contain only MDWObject
instances. A ClassCastException
is thrown if any other kind of
element is found (null
values are silently ignored).
T
- the type of elements in the returned collection.scriptName
- the name of the script to evaluate on each MDWObject
.
This script must not expect any parameter.ClassCastException
- if the collection contains anything else than MDWObject
instances.<T> MDWList<T> collect(String scriptName, List<?> arguments)
MDWObject
of this collection,
and concatenates the results into a new list.
The returned list is always flattened: if a script result is a collection (Collection
, Map
, Iterator
or
array
), we iterate on this collection and add each element into the returned list.
This collection is expected to contain only MDWObject
instances. A ClassCastException
is thrown if any other kind of
element is found (null
values are silently ignored).
The number and type of arguments must match the parameters of the script.
T
- the type of elements in the returned collection.scriptName
- the name of the script to evaluate on each MDWObject
.arguments
- the script arguments.ClassCastException
- if the collection contains anything else than MDWObject
instances.<T> MDWList<T> collect(EStructuralFeature feature)
MDWObject
of this collection,
and concatenates the results into a new list.
The returned list is always flattened: if a feature is a collection, we iterate on this collection and add each element into the returned list.
This collection is expected to contain only MDWObject
instances. A ClassCastException
is thrown if any other kind of
element is found (null
values are silently ignored).
T
- the type of elements in the returned collection.feature
- the feature to evaluate on each MDWObject
.ClassCastException
- if the collection contains anything else than MDWObject
instances.MDWList<E> sort(String scriptName)
The script is evaluated on each MDWObject
of this collection, the script results are then used to compare elements. This sort is
guaranteed to be stable: equal elements will not be reordered as a result of the sort.
This collection is expected to contain only MDWObject
instances. A ClassCastException
is thrown if any other kind of
element is found (null
values are silently ignored).
scriptName
- the name of the script to evaluate on each MDWObject
.
This script must not expect any parameter.ClassCastException
- if the collection contains anything else than MDWObject
instances,
or if the script results that are not mutually comparable (for example, strings and integers).MDWList<E> sort(String scriptName, List<?> arguments)
The script is evaluated on each MDWObject
of this collection, the script results are then used to compare elements. This sort is
guaranteed to be stable: equal elements will not be reordered as a result of the sort.
This collection is expected to contain only MDWObject
instances. A ClassCastException
is thrown if any other kind of
element is found (null
values are silently ignored).
The number and type of arguments must match the parameters of the script.
scriptName
- the name of the script to evaluate on each MDWObject
.arguments
- the script arguments.ClassCastException
- if the collection contains anything else than MDWObject
instances,
or if the script results that are not mutually comparable (for example, strings and integers).MDWList<E> sort(EStructuralFeature feature)
The feature is evaluated on each MDWObject
of this collection, the feature results are then used to compare elements. This sort is
guaranteed to be stable: equal elements will not be reordered as a result of the sort.
This collection is expected to contain only MDWObject
instances. A ClassCastException
is thrown if any other kind of
element is found (null
values are silently ignored).
feature
- the feature to evaluate on each MDWObject
.ClassCastException
- if the collection contains anything else than MDWObject
instances.