MetaDone
|
Classes | |
class | ValueIterator< T > |
Static Public Member Functions | |
static< T > Iterator< T > | emptyIterator () |
static< T > Iterator< T > | forValue (final T value) |
static< T > Iterator< T > | forValues (final T...values) |
static< T > Iterator< T > | forArray (final T[] arr) |
static< T > ArrayList< T > | readInto (Iterator< T > it) |
static< T, CextendsCollection < T > C | readInto (Iterator<?extends T > it, C dest) |
static boolean | equal (Iterator<?> a, Iterator<?> b) |
static< T > Iterator< T > | concatenate (final Iterator<?extends T > it1, final Iterator<?extends T > it2) |
static< T > Iterator< T > | concatenate (final Iterator<?extends Iterator<?extends T >> its) |
static< R, T > Iterator< R > | map (final MapFct<?super T,?extends R > f, final Iterator< T > it) |
static< R > Iterator< R > | filter (final MapFct<?super R,?extends Boolean > predicate, final Iterator< R > it) |
Private Member Functions | |
IteratorUtil () | |
Static Private Attributes | |
static final Iterator< Object > | EMPTY_ITERATOR |
Functions for manipulating iterators.
metadone.util.IteratorUtil.IteratorUtil | ( | ) | [private] |
static <T> Iterator<T> metadone.util.IteratorUtil.concatenate | ( | final Iterator<?extends T > | it1, |
final Iterator<?extends T > | it2 | ||
) | [static] |
Concatenates two iterators.
<T> | The type of the values |
it1 | The first iterator |
it2 | The second iterator |
NullPointerException | when it1 or it2 is null |
Referenced by metadone.client.grasyla2.GrasylaEngineFactory.getBuilders(), metadone.client.grasyla2.GrasylaEngineFactory.getBuilderSetClass(), metadone.client.grasyla2.SelectorBestEquation.getRelatedEquations(), and metadone.client.grasyla2.SelectorBestEquation.getRelatedEquationsAnyMetaclass().
static <T> Iterator<T> metadone.util.IteratorUtil.concatenate | ( | final Iterator<?extends Iterator<?extends T >> | its | ) | [static] |
Concatenates iterators returned by an iterator.
<T> | The type of the elements |
its | The iterators |
NullPointerException | when its is null |
static <T> Iterator<T> metadone.util.IteratorUtil.emptyIterator | ( | ) | [static] |
Returns an empty Iterator.
<T> | The type of the iterator |
References metadone.util.IteratorUtil.EMPTY_ITERATOR.
Referenced by metadone.util.IteratorUtil.forArray(), metadone.metabusiness.impl.ConcreteObject_impl.getLinkedObjects(), metadone.client.grasyla2.SelectorBestEquation.getRelatedEquations(), and metadone.client.grasyla2.SelectorBestEquation.getRelatedEquationsAnyMetaclass().
static boolean metadone.util.IteratorUtil.equal | ( | Iterator<?> | a, |
Iterator<?> | b | ||
) | [static] |
Tests whether two iterators produce the same elements in the same order.
If one of the given iterables is null
, the function returns true
only if the other is also null
.
a | The first iterable |
b | The second iterable |
References metadone.util.Objects.equal().
Referenced by metadone.client.grasyla2.base.GrasylaComponent< C >.equals().
static <R> Iterator<R> metadone.util.IteratorUtil.filter | ( | final MapFct<?super R,?extends Boolean > | predicate, |
final Iterator< R > | it | ||
) | [static] |
Filters values of an iterator.
If it = [v_i | i = 0..]
, the returned iterator generates values [v_i | i = 0.. and predicate(v_i)]
.
The Iterator#remove() method works only if it is called just after Iterator#next(). Otherwise, the result is unexpected.
<R> | The type of the values |
predicate | The filter function |
it | The iterator |
NullPointerException | when it or predicate is null |
Referenced by metadone.client.grasyla2.GrasylaEngine.getAttributes(), metadone.client.grasyla2.GrasylaEngine.getChildrenExpressions(), metadone.client.grasyla2.GrasylaEngine.getContainedAttributes(), metadone.client.grasyla2.GrasylaEngine.getContainedExpressions(), metadone.client.grasyla2.GrasylaEngine.getContainedVariables(), metadone.metabusiness.impl.ConcreteObject_impl.getFilteredConcreteRoles(), metadone.metabusiness.impl.ConcreteObject_impl.getLinkedObjects(), and metadone.client.grasyla2.SelectorBestEquation.getRelatedEquations().
static <T> Iterator<T> metadone.util.IteratorUtil.forArray | ( | final T[] | arr | ) | [static] |
Generates an iterator which returns values from the given array.
<T> | The type of the values |
arr | The input array |
References metadone.util.IteratorUtil.emptyIterator().
Referenced by metadone.util.IteratorUtil.forValues().
static <T> Iterator<T> metadone.util.IteratorUtil.forValue | ( | final T | value | ) | [static] |
Generates an iterator which contains one value.
<T> | The type of the value |
value | The value |
Referenced by metadone.client.grasyla2.GrasylaEngineFactory.getBuilderSetClass().
static <T> Iterator<T> metadone.util.IteratorUtil.forValues | ( | final T... | values | ) | [static] |
Generates an iterator which contains the given values.
<T> | The type of the values |
values | The values |
References metadone.util.IteratorUtil.forArray().
static <R,T> Iterator<R> metadone.util.IteratorUtil.map | ( | final MapFct<?super T,?extends R > | f, |
final Iterator< T > | it | ||
) | [static] |
Maps a function to each element of an iterator.
If it = [v_i | i = 0..]
, the returned iterator generates values [f(v_i) | i = 0..]
.
<R> | The returned type |
<T> | The iterator type |
f | The function to apply |
it | The iterator object |
NullPointerException | when it or f is null |
Referenced by metadone.client.grasyla2.GrasylaEngine.getAttributes(), metadone.client.grasyla2.GrasylaEngineFactory.getBuilders(), metadone.client.grasyla2.GrasylaEngine.getContainedAttributes(), metadone.metabusiness.impl.ConcreteObject_impl.getFilteredConcreteRolesCO(), metadone.client.grasyla2.value.Value.getValueAsCO(), and metadone.metabusiness.impl.ConcreteObject_impl.MapMetaToConcrete.map().
static <T> ArrayList<T> metadone.util.IteratorUtil.readInto | ( | Iterator< T > | it | ) | [static] |
Reads an iterator into an array list.
<T> | The type of the elements |
it | The iterator |
NullPointerException | when it is null |
Referenced by metadone.client.grasyla2.ref.RefSpecEngine.activate(), metadone.client.grasyla2.ref.CORefSpecEngine.activate(), metadone.client.grasyla2.ref.CORefRoleEngine.activate(), metadone.client.grasyla2.ref.CORefObjectEngine.activate(), metadone.client.grasyla2.ref.RefSpecEngine.buildNewComponent(), metadone.client.grasyla2.ref.ActionDeleteRoleEngine.delete_roles(), metadone.client.grasyla2.ref.CORefSpecEngine.evaluateComponent(), metadone.client.grasyla2.ref.CORefRoleEngine.evaluateComponent(), metadone.client.grasyla2.ref.CORefObjectEngine.evaluateComponent(), metadone.client.grasyla2.GrasylaEngineFactory.getAdaptedBuildersLevel(), metadone.client.grasyla2.GrasylaEngineFactory.getBuilders(), metadone.client.grasyla2.ref.RefRoleEngine.getRelatedObjects(), and metadone.client.grasyla2.value.Value.getValueAsCO().
static <T,CextendsCollection<T> C metadone.util.IteratorUtil.readInto | ( | Iterator<?extends T > | it, |
C | dest | ||
) | [static] |
Reads an iterator into a collection.
<T> | The type of elements in the collection |
<C> | The collection type |
it | The iterator |
dest | The destination collection |
NullPointerException | when it, dest is null or when the collection does not support adding null elements and a null element has been returned by the iterator |
final Iterator<Object> metadone.util.IteratorUtil.EMPTY_ITERATOR [static, private] |
new Iterator<Object>() { @Override public boolean hasNext() { return false; } @Override public Object next() { throw new NoSuchElementException(); } @Override public void remove() { throw new UnsupportedOperationException(); } @Override public String toString() { return "EmptyIterator"; } }
Referenced by metadone.util.IteratorUtil.emptyIterator().