com.steptools.stdev
Class EntityDomain

java.lang.Object
  extended by com.steptools.stdev.Domain
      extended by com.steptools.stdev.EntityDomain
Direct Known Subclasses:
StaticEntityDomain

public abstract class EntityDomain
extends Domain

Representation of an EXPRESS Entity.


Method Summary
static EntityDomain domain(EntityDomain[] sups)
          Gets or creates (possibly) complex domain.
static EntityDomain domain(java.util.List supers)
          Gets or creates (possibly) complex domain.
 Attribute[] getAllAttributes()
          Gets the all the attributes (local and inherited) of this domain.
 EntityDomain[] getAllKnownSubtypes()
          Gets all the subtypes of this domain.
 java.util.Set getAllRedeclaredAttributes()
          Gets the list of explicit attributes that are redeclated as derived by this domain or its supertypes.
 StaticEntityDomain[] getAllSupertypes()
          Gets all the supertypes of the domain.
 Attribute getAttribute(java.lang.String name)
          Finds an attribute by name.
abstract  EntityDomain[] getKnownSubtypes()
          Gets the immediate subtypes of this domain.
 Attribute getLocalAttribute(java.lang.String name)
          Finds a non-inherited attribute by name.
abstract  Attribute[] getLocalAttributes()
          Gets the immediate (EXPRESS defined) attributes of this domain.
abstract  StaticEntityDomain[] getLocalSupertypes()
          Gets the immediate (EXPRESS defined) supertypes of the domain.
 boolean isAttributeRedeclared(Attribute att)
          Determines if the specified attribute is redeclared as derived in this entity.
abstract  boolean isComplex()
          Determines if this domain is an AND-OR domain.
 boolean isEntity()
           
abstract  boolean isInSchema(SchemaBase sch)
          Determined if this Domain is a member of this schema.
 EntityInstance newInstance()
          Create a new non-persistent instance of the entity
abstract  EntityInstance newInstance(PopulationBase pop)
          Creates a new instance of the entity.
 boolean typeIsa(Domain other)
          Tests if this Domain is assignable to the other Domain.
 
Methods inherited from class com.steptools.stdev.Domain
getName, isAggregate, isBoolean, isEnumeration, isInteger, isLogical, isReal, isSelect, isString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newInstance

public abstract EntityInstance newInstance(PopulationBase pop)
Creates a new instance of the entity. This method provides a late-bound interface for creating instances. The preferred, early bound interface for creating instances is to call the newXXX method on a population.

Parameters:
pop - The population in which the entity will be created. null may be specified to create non-persistent objects
Returns:
The newly created instance.

newInstance

public EntityInstance newInstance()
Create a new non-persistent instance of the entity

Returns:
The newly created instance.

getLocalSupertypes

public abstract StaticEntityDomain[] getLocalSupertypes()
Gets the immediate (EXPRESS defined) supertypes of the domain.

Returns:
The list of supertypes.

isInSchema

public abstract boolean isInSchema(SchemaBase sch)
Determined if this Domain is a member of this schema.

Parameters:
sch - The schema we are checking
Returns:
true If this instance is in the specified schema.

getAllSupertypes

public StaticEntityDomain[] getAllSupertypes()
Gets all the supertypes of the domain.

Returns:
The list of supertypes.

getLocalAttributes

public abstract Attribute[] getLocalAttributes()
Gets the immediate (EXPRESS defined) attributes of this domain.

Returns:
The list of attributes.

getAllAttributes

public Attribute[] getAllAttributes()
Gets the all the attributes (local and inherited) of this domain.

Returns:
The list of attribute.

getAttribute

public Attribute getAttribute(java.lang.String name)
Finds an attribute by name.

Parameters:
name - The attribute to search for
Returns:
The attribute ith the specified name, null if not found.

getLocalAttribute

public Attribute getLocalAttribute(java.lang.String name)
Finds a non-inherited attribute by name.

Parameters:
name - The attribute to search for
Returns:
The attribute ith the specified name, null if not found.

typeIsa

public boolean typeIsa(Domain other)
Description copied from class: Domain
Tests if this Domain is assignable to the other Domain.

Specified by:
typeIsa in class Domain
Parameters:
other - The domain to compare to
Returns:
true If this domain is equal to or a subtype of the other Domain.

getKnownSubtypes

public abstract EntityDomain[] getKnownSubtypes()
Gets the immediate subtypes of this domain. A subtype is known if it has been instances of it have been created, or it has otherwise been initialized. Due to the just-in-time class loading provided by the JVM, and the fact that complex (AND-OR) objects can be created dynamically, it may not be possible to determine all of the subtypes of this domain. This will, however, include at least all of the the subtypes for which instances exist in memory.

Returns:
The list of subtypes.

isComplex

public abstract boolean isComplex()
Determines if this domain is an AND-OR domain.

Returns:
true If this domain is an AND-OR.

getAllKnownSubtypes

public EntityDomain[] getAllKnownSubtypes()
Gets all the subtypes of this domain. A subtype is known if it has been instances of it have been created, or it has otherwise been initialized. Due to the just-in-time class loading provided by the JVM, and the fact that complex (AND-OR) objects can be created dynamically, it may not be possible to determine all of the subtypes of this domain. This will, however, include at least all of the the subtypes for which instances exist in memory.

Returns:
The list of subtypes.

domain

public static EntityDomain domain(java.util.List supers)
Gets or creates (possibly) complex domain. If an instance of the specified domain has alread been created, that Domain object is returned; otherwise, one is created and returned.

Parameters:
supers - The list of supertypes of the domain that needs to be retrieved. This list may include the types that are themselves subtypes of other types in the list.
Returns:
A domain that is the subtype of all the specified types.

domain

public static EntityDomain domain(EntityDomain[] sups)
Gets or creates (possibly) complex domain. If an instance of the specified domain has alread been created, that Domain object is returned; otherwise, one is created and returned.

Parameters:
sups - Array of supertypes of the domain that needs to be retrieved. This list may include the types that are themselves subtypes of other types in the list.
Returns:
A domain that is the subtype of all the specified types.

getAllRedeclaredAttributes

public java.util.Set getAllRedeclaredAttributes()
Gets the list of explicit attributes that are redeclated as derived by this domain or its supertypes.

Returns:
A set containing those Attribues that are declared

isAttributeRedeclared

public boolean isAttributeRedeclared(Attribute att)
Determines if the specified attribute is redeclared as derived in this entity.

Parameters:
att - The attribute to check.
Returns:
true If the attribute is redeclared as derived.

isEntity

public boolean isEntity()
Overrides:
isEntity in class Domain