ST-Developer Java Reference

com.steptools.stdev
Class Model

java.lang.Object
  extended by com.steptools.stdev.Model

public class Model
extends Object

A unit of persistence for STEP data. A model is the in-memory representation for the data in a STEP File. A model holds the EntityInstances, as well some management data.

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 Summary
Model()
           
Model(SchemaBase sch)
          Create a model with the specified schema as the default schema
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Model

public Model(SchemaBase sch)
Create a model with the specified schema as the default schema

Parameters:
sch - The schema

Model

public Model()
Method Detail

newPopulation

public PopulationBase newPopulation(SchemaBase sch,
                                    Object id)
                             throws DuplicatePopulationIDException
Creates a new population in the model. The population is identified by the specified object. Generally, the identifier is a String, but it does not need to be.

Parameters:
sch - The schema for which to create a population.
id - The identifier for the newly created section.
Returns:
The newly created population.
Throws:
DuplicateSectionIDException - - When a population already exists with the given identifier
DuplicatePopulationIDException

removePopulation

public void removePopulation(PopulationBase pop)
Removes a population from the model.

Parameters:
pop - The population to remove.

removePopulation

public void removePopulation(Object id)
Removes a population from the model

Parameters:
id - The identifier for the population to remove.

getPopulations

public Collection<PopulationBase> getPopulations()
Gets all the populations in model.

Returns:
A collection of the populations in this Model.

getPopulation

public PopulationBase getPopulation()
Gets the default population in model. The default population is the one whose identifier is null. If the default population does not exist, one is created, if a default schema has been set.

Returns:
The default population.

getPopulation

public PopulationBase getPopulation(Object id)
Gets the requested population by identifier.

Parameters:
id - The identifier of the population to retreive.
Returns:
The requested population.

addProperty

public void addProperty(Object key,
                        Object value)
Adds a property to the model. Properties may implement the RemoveListener interface, in which case, they will be notified when an instance is removed from any population in the model.

Parameters:
key - The identifier for the property.
value - The object that acts as the property.

getProperty

public Object getProperty(Object key)
Gets the property for the specified key.

Parameters:
key - The identifier for the property.
Returns:
The requested population.

removeProperty

public void removeProperty(Object key)
Remove the property for the specified key.

Parameters:
key - The identifier for the property.

propertyKeys

public Set propertyKeys()
Gets all the property keys.

Returns:
the set of keys.

ST-Developer Java Reference