org.jutil.structure
Class StructureElement

java.lang.Object
  |
  +--org.jutil.structure.StructureElement

public class StructureElement
extends java.lang.Object

DEPRECATEDA class of "components" for inplementing a 1-n binding. This class is the n side of the binding (the side where the "n" is in a UML diagram).

This is actually a lightweight version of the APSet-APElement combination of the Beedra framework of Jan Dockx.

This class is typically using in the following way. See class StructureElement for class B.


public class B {
public B() {
$a = new StructureElement(this);
}
public A getA() {
return (A)$a.getOtherEnd();
}
StructureElement getALink() {
return $a;
}
private StructureElement $a;
}
 

The binding is controlled in class A. Of course you can add a setA(A a) method to class B.


Class Specifications
public invariant getStructureSet() != null ==> getStructureSet().contains(this);

Field Summary
static java.lang.String CVS_REVISION
          Deprecated.  
 
Constructor Summary
StructureElement(java.lang.Object object)
          Deprecated. Initialize a new StructureElement for the given object.
StructureElement(java.lang.Object object, StructureSet structureSet)
          Deprecated. Initialize a new StructureElement for the given object, connected to the given StructureSet.
 
Method Summary
 void connectTo(StructureSet structureSet)
          Deprecated. Set the 1 side of this 10n binding.
 java.lang.Object getObject()
          Deprecated. Return the object on the n side of the 1-n binding represented by this StructureElement
 java.lang.Object getOtherEnd()
          Deprecated. Return the Object at the other end of this double binding.
 StructureSet getStructureSet()
          Deprecated. return the structureSet this StructureElement belongs to
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CVS_REVISION

public static final java.lang.String CVS_REVISION
Deprecated. 
Constructor Detail

StructureElement

public StructureElement(java.lang.Object object)
Deprecated. 
Initialize a new StructureElement for the given object. The new StructureElement will be unconnected.

Parameters:
object - The object at the n side of the 1-n binding.

Specifications:
public behavior
requires object != null;
ensures getObject() == object;
ensures getStructureSet() == null;

StructureElement

public StructureElement(java.lang.Object object,
                        StructureSet structureSet)
Deprecated. 
Initialize a new StructureElement for the given object, connected to the given StructureSet.

Parameters:
object - The object at the n side of the 1-n binding.

Specifications:
public behavior
requires object != null;
ensures getObject() == object;
ensures getStructureSet() == structureSet;
ensures structureSet != null ==> structureSet.contains(this);
Method Detail

getOtherEnd

public java.lang.Object getOtherEnd()
Deprecated. 
Return the Object at the other end of this double binding.

Specifications:
public behavior
ensures getStructureSet() == null ==> \result == null;
ensures getStructureSet() != null ==> \result == getStructureSet().getObject();

connectTo

public void connectTo(StructureSet structureSet)
Deprecated. 
Set the 1 side of this 10n binding.

Parameters:
set - The new StructureSet this StructureElement will be connected to.

Specifications:
public behavior
ensures getStructureSet() == structureSet;
ensures \old(getStructureSet()) != null&&\old(getStructureSet()) != structureSet ==> !\old(getStructureSet()).contains(this);
ensures structureSet != null ==> structureSet.contains(this);

getObject

public java.lang.Object getObject()
Deprecated. 
Return the object on the n side of the 1-n binding represented by this StructureElement

Specifications:
public behavior
ensures \result != null;

getStructureSet

public StructureSet getStructureSet()
Deprecated. 
return the structureSet this StructureElement belongs to