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
ConstructorsConstructorDescriptionModelElementIterator(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 TypeMethodDescriptionbooleanhasNext()next()voidremove()voidsetIterateRemoved(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, waitMethods 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:
hasNextin interfaceIterator<ModelElement>
-
next
- Specified by:
nextin interfaceIterator<ModelElement>
-
remove
public void remove()- Specified by:
removein interfaceIterator<ModelElement>
-