Class ModelElementIterator
java.lang.Object
ch.tocco.nice2.model.entity.api.util.ModelElementIterator
- All Implemented Interfaces:
Iterator<ModelElement>
Iterator that is iterating over all model elements (
FieldModel
and/or
RelationModel
) of an entity model or all entity models of a given set.-
Constructor Summary
ConstructorDescriptionModelElementIterator
(EntityModel entityModel, boolean includeFields, boolean includeRelations) If both includeFields and includeRelations are false, this degenerates to an empty iterator with bad performance.ModelElementIterator
(Iterator<EntityModel> entityIterator, boolean includeFields, boolean includeRelations) -
Method Summary
Modifier and TypeMethodDescriptionboolean
hasNext()
next()
void
remove()
void
setIterateRemoved
(boolean iterateRemoved) Sets whether to iterate over removed relation and fields or the existing relation and fields.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
ModelElementIterator
public ModelElementIterator(EntityModel entityModel, boolean includeFields, boolean includeRelations) If both includeFields and includeRelations are false, this degenerates to an empty iterator with bad performance.- Parameters:
includeFields
- whether to include field modelsincludeRelations
- whether to include relation models
-
ModelElementIterator
public ModelElementIterator(Iterator<EntityModel> entityIterator, boolean includeFields, boolean includeRelations)
-
-
Method Details
-
setIterateRemoved
public void setIterateRemoved(boolean iterateRemoved) Sets whether to iterate over removed relation and fields or the existing relation and fields. -
getCurrentEntityModel
-
hasNext
public boolean hasNext()- Specified by:
hasNext
in interfaceIterator<ModelElement>
-
next
- Specified by:
next
in interfaceIterator<ModelElement>
-
remove
public void remove()- Specified by:
remove
in interfaceIterator<ModelElement>
-