Constructor and Description |
---|
EntityCollectionBuilder(EntityType type) |
Modifier and Type | Method and Description |
---|---|
EntityCollectionBuilder |
add(Entity e)
Add an entity to the collection.
|
EntityCollectionBuilder |
add(Entity e,
boolean replace)
Add an entity to the collection.
|
EntityCollectionBuilder |
addAll(Entity... entities)
Add multiple entities to the collection.
|
EntityCollectionBuilder |
addAll(Iterable<Entity> entities)
Add multiple entities to the collection.
|
EntityCollectionBuilder |
addIndex(String attrName)
Add an index to an entity collection to speed up lookups.
|
<T> EntityCollectionBuilder |
addIndex(TypedName<T> attribute)
Add an index to an entity collection to speed up lookups.
|
EntityCollection |
build()
Build the entity collection.
|
Collection<Entity> |
entities()
Get a view of the entities added, for iteration and re-processing.
|
public EntityCollectionBuilder(EntityType type)
public <T> EntityCollectionBuilder addIndex(TypedName<T> attribute)
Add an index to an entity collection to speed up lookups.
attribute
- The attribute to index.T
- The attribute typepublic EntityCollectionBuilder addIndex(String attrName)
Add an index to an entity collection to speed up lookups.
attrName
- The name of the attribute to index.public EntityCollectionBuilder add(Entity e)
Add an entity to the collection.
e
- The entity to add.public EntityCollectionBuilder add(Entity e, boolean replace)
Add an entity to the collection.
e
- The entity to add.replace
- Whether to replace. If false
, and an entity with the same ID as e
has already been added, this entity is silently ignored.public EntityCollectionBuilder addAll(Entity... entities)
Add multiple entities to the collection.
entities
- The entity to add.public EntityCollectionBuilder addAll(Iterable<Entity> entities)
Add multiple entities to the collection.
entities
- The entity to add.public Collection<Entity> entities()
Get a view of the entities added, for iteration and re-processing.
public EntityCollection build()
Build the entity collection.