public class Model extends Object
The instances are contained in population
objects.
In addition, the model may contain properties which are used to annotate
the in-memory representation of the data.
Constructor and Description |
---|
Model() |
Model(SchemaBase sch)
Create a model with the specified schema as the default schema
|
Modifier and Type | Method and Description |
---|---|
void |
addProperty(Object key,
Object value)
Adds a property to the model.
|
PopulationBase |
getPopulation()
Gets the default population in model.
|
PopulationBase |
getPopulation(Object id)
Gets the requested population by identifier.
|
Collection<PopulationBase> |
getPopulations()
Gets all the populations in model.
|
Object |
getProperty(Object key)
Gets the property for the specified key.
|
PopulationBase |
newPopulation(SchemaBase sch,
Object id)
Creates a new population in the model.
|
Set |
propertyKeys()
Gets all the property keys.
|
void |
removePopulation(Object id)
Removes a population from the model
|
void |
removePopulation(PopulationBase pop)
Removes a population from the model.
|
void |
removeProperty(Object key)
Remove the property for the specified key.
|
public Model(SchemaBase sch)
sch
- The schemapublic Model()
public PopulationBase newPopulation(SchemaBase sch, Object id) throws DuplicatePopulationIDException
sch
- The schema for which to create a population.id
- The identifier for the newly created section.DuplicateSectionIDException
- - When a population already exists
with the given identifierDuplicatePopulationIDException
public void removePopulation(PopulationBase pop)
pop
- The population to remove.public void removePopulation(Object id)
id
- The identifier for the population to remove.public Collection<PopulationBase> getPopulations()
public PopulationBase getPopulation()
public PopulationBase getPopulation(Object id)
id
- The identifier of the population to retreive.public void addProperty(Object key, Object value)
RemoveListener
interface, in which case, they will be notified
when an instance is removed from any population in the model.key
- The identifier for the property.value
- The object that acts as the property.public Object getProperty(Object key)
key
- The identifier for the property.public void removeProperty(Object key)
key
- The identifier for the property.public Set propertyKeys()