ST-Developer Java Reference

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.


Field Summary
protected  Set<Attribute> all_redecls
           
 
Constructor Summary
protected EntityDomain()
           
 
Method Summary
static EntityDomain domain(Collection<StaticEntityDomain> supers)
          Gets or (possibly) creates complex domain.
static EntityDomain domain(StaticEntityDomain[] sups)
          Gets or creates (possibly) complex domain.
 List<Attribute> getAllAttributes()
          Gets the all the attributes (local and inherited) of this domain.
 Set<EntityDomain> getAllKnownSubtypes()
          Gets all the subtypes of this domain.
 Set<Attribute> getAllRedeclaredAttributes()
          Gets the list of explicit attributes that are redeclated as derived by this domain or its supertypes.
 List<StaticEntityDomain> getAllSupertypes()
          Gets all the supertypes of the domain.
 Attribute getAttribute(String name)
          Finds an attribute by name.
abstract  Set<EntityDomain> getKnownSubtypes()
          Gets the immediate subtypes of this domain.
 Attribute getLocalAttribute(String name)
          Finds a non-inherited attribute by name.
abstract  List<Attribute> getLocalAttributes()
          Gets the immediate (EXPRESS defined) attributes of this domain.
abstract  List<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(Class cls)
           
 boolean typeIsa(Domain other)
          Tests if this Domain is assignable to the other Domain.
 
Methods inherited from class com.steptools.stdev.Domain
convert, domainClass, forClass, getName, isAggregate, isBoolean, isEnumeration, isInteger, isLogical, isReal, isSelect, isString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

all_redecls

protected Set<Attribute> all_redecls
Constructor Detail

EntityDomain

protected EntityDomain()
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 List<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 List<StaticEntityDomain> getAllSupertypes()
Gets all the supertypes of the domain.

Returns:
The list of supertypes.

getLocalAttributes

public abstract List<Attribute> getLocalAttributes()
Gets the immediate (EXPRESS defined) attributes of this domain.

Returns:
The list of attributes.

getAllAttributes

public List<Attribute> getAllAttributes()
Gets the all the attributes (local and inherited) of this domain.

Returns:
The list of attribute.

getAttribute

public Attribute getAttribute(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(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.

typeIsa

public boolean typeIsa(Class cls)
                throws DomainNotFoundException
Throws:
DomainNotFoundException

getKnownSubtypes

public abstract Set<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 Set<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(Collection<StaticEntityDomain> supers)
Gets or (possibly) creates complex domain. If an instance of the specified domain has already 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(StaticEntityDomain[] 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 Set<Attribute> 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

ST-Developer Java Reference