iitb.con.core
Class RelationInstance

java.lang.Object
  extended by iitb.con.core.Instance
      extended by iitb.con.core.RelationInstance

public class RelationInstance
extends Instance

Relations are associated with the entities and instances.
RelationIntance interface provides methods to set and remove the relations among the entity instances.

The relation is created between two items, which is considered as left-item and right-item.

See Also:
Instance, Relation

Field Summary
 int leftInstanceId
          Relation's left instance id
 int rightInstanceId
          Relation's right instance id
 
Fields inherited from class iitb.con.core.Instance
id, typeId
 
Constructor Summary
RelationInstance()
           
 
Method Summary
 java.lang.Object getAttributeValue(java.lang.String name)
          Returns the specified attributes value.
This method should be over-ridden by the specialized instances
 byte getDirection()
          Returns the direction kind in the relation.
0 - LEFT_TO_RIGHT
1 - BIDIRECTIONAL
 java.lang.String getLeftRole()
          Returns the left role name of the relation.
 java.lang.String getRightRole()
          Returns the right role name of the relation.
 void setAttributeValue(java.lang.String name, java.lang.Object value)
          Sets the instance's attribute value.
This method should be over-ridden by the specialized instances
 Result setLeftInstance(EntityInstance instance)
          Sets the instance for the left item.
 Result setRightInstance(EntityInstance instance)
          Sets the instance for the right item.
 
Methods inherited from class iitb.con.core.Instance
setType
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

leftInstanceId

public int leftInstanceId
Relation's left instance id


rightInstanceId

public int rightInstanceId
Relation's right instance id

Constructor Detail

RelationInstance

public RelationInstance()
Method Detail

getAttributeValue

public java.lang.Object getAttributeValue(java.lang.String name)
Description copied from class: Instance
Returns the specified attributes value.
This method should be over-ridden by the specialized instances

Overrides:
getAttributeValue in class Instance
Parameters:
name - attribute name
Returns:
attribute value

getDirection

public byte getDirection()
Returns the direction kind in the relation.
0 - LEFT_TO_RIGHT
1 - BIDIRECTIONAL

Returns:
byte - direction kind

getLeftRole

public java.lang.String getLeftRole()
Returns the left role name of the relation.

Returns:
left role name

getRightRole

public java.lang.String getRightRole()
Returns the right role name of the relation.

Returns:
right role name

setAttributeValue

public void setAttributeValue(java.lang.String name,
                              java.lang.Object value)
Description copied from class: Instance
Sets the instance's attribute value.
This method should be over-ridden by the specialized instances

Overrides:
setAttributeValue in class Instance
Parameters:
name - attribute name
value - attribute's value

setLeftInstance

public Result setLeftInstance(EntityInstance instance)
Sets the instance for the left item.

Parameters:
instance - EntityInstance
Returns:
Result

setRightInstance

public Result setRightInstance(EntityInstance instance)
Sets the instance for the right item.

Parameters:
instance - EntityInstance
Returns:
Result