Class ModelElementIterator

java.lang.Object
ch.tocco.nice2.model.entity.api.util.ModelElementIterator
All Implemented Interfaces:
Iterator<ModelElement>

public class ModelElementIterator extends Object implements 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 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 models
      includeRelations - 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

      public EntityModel getCurrentEntityModel()
    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<ModelElement>
    • next

      public ModelElement next()
      Specified by:
      next in interface Iterator<ModelElement>
    • remove

      public void remove()
      Specified by:
      remove in interface Iterator<ModelElement>