com.steptools.stdev
Interface EntityInstance

All Superinterfaces:
java.lang.Cloneable, Instance
All Known Implementing Classes:
EntityInstanceImpl

public interface EntityInstance
extends Instance

An instance of an EXPRESS-defined entity.


Method Summary
 EntityInstance castTo(Domain supertype)
          Gets a view of the object that can be cast to the requested type.
 EntityInstance getFinalObject()
          Gets the base object for this instance.
 EntityDomain getLocalDomain()
          Gets the domain for the view object.
 boolean isa(Domain dom)
          This method determines if this EntityInstance is an instance of the specified domain.
 boolean isView()
          This function determines if this object is a view, or if it is the final object.
 EntityInstanceSet usedin(EntityInstanceSet scope, Attribute att)
          This method implements an EXPRESS-like USEDIN facility.
 EntityInstanceSet usedin(EntityInstanceSet scope, EntityDomain start, Attribute att)
          This method implements an EXPRESS-like USEDIN facility.
 
Methods inherited from interface com.steptools.stdev.Instance
clone, domain
 

Method Detail

getFinalObject

EntityInstance getFinalObject()
Gets the base object for this instance. There are cases where the EXPRESS inheritance model cannot be cleanly mapped to Java. In this case, one or more proxy classes may be created what provide a view of the entity instance as a particular supertype. This method returns the non-view object.

You should use this method to obtain a canonical view of an EntityInstance before comparing two objects.

Returns:
The non-view version of the instance.

getLocalDomain

EntityDomain getLocalDomain()
Gets the domain for the view object. This will be different from the value returned by domain() when this instance is a view object

Returns:
The domain corresponding class of this object.

castTo

EntityInstance castTo(Domain supertype)
                      throws EntityCastException
Gets a view of the object that can be cast to the requested type. This may be the same object, or it may be a view object. In either case, it will be safe to use a Java cast to convert the result to the requested type.

Parameters:
supertype - The domain to cast the current object to.
Returns:
An object that implements the interface associated with the domain
Throws:
EntityCastException - If this instance cannot be cast to the requested type

isa

boolean isa(Domain dom)
This method determines if this EntityInstance is an instance of the specified domain. This function retuns the same value regardless of which view of the EntityInstance is is called on.

Returns:
true If this instance can be cast to the requested type.

isView

boolean isView()
This function determines if this object is a view, or if it is the final object.

Returns:
true If this is a view object.

usedin

EntityInstanceSet usedin(EntityInstanceSet scope,
                         EntityDomain start,
                         Attribute att)
This method implements an EXPRESS-like USEDIN facility. This can be used to locate the instances that point to this instance through a specified attribute. This method processes attributes that are of types Select and Aggregate by looking searching the underlying Select or Aggregate for this object.

Parameters:
scope - The set of instances to search for references to this.
start - Further limit the scope of instances.
att - The attribute that is being queried.
Returns:
The set of EntityInstances that reference this via the specified attribute.

usedin

EntityInstanceSet usedin(EntityInstanceSet scope,
                         Attribute att)
This method implements an EXPRESS-like USEDIN facility. This can be used to locate the instances that point to this instance through a specified attribute. This method processes attributes that are of types Select and Aggregate by looking searching the underlying Select or Aggregate for this object.

Parameters:
scope - The set of instances to search for references to this.
start - Further limit the scope of instances.
att - The attribute that is being queried.
Returns:
The set of EntityInstances that reference this via the specified attribute.