|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jutil.structure.StructureElement
A 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.
Field Summary | |
static java.lang.String |
CVS_REVISION
|
Constructor Summary | |
StructureElement(java.lang.Object object)
public invariant getStructureSet() != null => getStructureSet().contains(this); public behavior pre object != null; post getObject() == object; post getStructuredSet() == null; Initialize a new StructureElement for the given object. |
|
StructureElement(java.lang.Object object,
StructureSet set)
public behavior pre object != null; post getObject() == object; post getStructuredSet() == set; post set != null => set.contains(this); Initialize a new StructureElement for the given object, connected to the given StructureSet. |
Method Summary | |
void |
connectTo(StructureSet set)
public behavior post getStructureSet() == set; // If this StructureElement was connected before, and will now be // connected to another StructureSet, it will be removed from the first one. post \old(getStructureSet()) != null && \old(getStructureSet()) != set => ! \old(getStructureSet()).contains(this); post set != null ==> set.contains(this); Set the 1 side of this 10n binding. |
java.lang.Object |
getObject()
public behavior post \result != null; Return the object on the n side of the 1-n binding represented by this StructureElement |
java.lang.Object |
getOtherEnd()
public behavior post getStructureSet() == null => \result == null; post getStructureSet() != null => \result == getStructureSet().getObject(); Return the Object at the other end of this double binding. |
StructureSet |
getStructureSet()
return the set this StructureElement belongs to |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String CVS_REVISION
Constructor Detail |
public StructureElement(java.lang.Object object)
object
- The object at the n side of the 1-n binding.public StructureElement(java.lang.Object object, StructureSet set)
object
- The object at the n side of the 1-n binding.Method Detail |
public java.lang.Object getOtherEnd()
public void connectTo(StructureSet set)
set
- The new StructureSet this StructureElement will be connected to.public java.lang.Object getObject()
public StructureSet getStructureSet()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |