org.jutil.structure
Class StructureSet

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

public class StructureSet
extends java.lang.Object

DEPRECATEDA class of "components" for inplementing a 1-n binding. This class is the 1 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 A {
public A() {
$b= new StructureSet(this);
}
public Set getBs() {
return $b.getOtherEnds();
}
public void addB(B b) {
$b.add(b.getALink());
}
public void removeB(B b) {
$b.remove(b.getALink());
}
private StructureSet $b;
}
 


Class Specifications
public invariant contains(null) == false;
public invariant getObject() != null;
public invariant ( \forall StructureElement e; contains(e); e.getStructureSet() == this);

Field Summary
static java.lang.String CVS_REVISION
          Deprecated.  
 
Constructor Summary
StructureSet(java.lang.Object object)
          Deprecated. Initialize an empty StructureSet for the given object.
 
Method Summary
 void add(StructureElement element)
          Deprecated. Remove the given StructureElement from this StructureSet.
 boolean contains(StructureElement element)
          Deprecated. Check whether or not the given element is connected to this StructureSet.
 java.lang.Object getObject()
          Deprecated. Return the object at the 1 side of the 1-n binding.
 java.util.Set getOtherEnds()
          Deprecated. Return a set containing the objects at the n side of the 1-n binding.
 java.util.Set getStructureElements()
          Deprecated. Return a set containing the StructureElements at the n side of the 1-n binding.
(package private)  void register(StructureElement element)
          Deprecated. Add the given StructureElement to this StructureSet
 void remove(StructureElement element)
          Deprecated. Add the given StructureElement to this StructureSet.
 int size()
          Deprecated. Return the size of the StructureSet
(package private)  void unregister(StructureElement element)
          Deprecated. Remove the given StructureElement from this StructureSet
 
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

StructureSet

public StructureSet(java.lang.Object object)
Deprecated. 
Initialize an empty StructureSet for the given object.

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

Specifications:
public behavior
requires object != null;
ensures getObject() == object;
ensures ( \forall StructureElement s; ; !contains(s));
Method Detail

getObject

public java.lang.Object getObject()
Deprecated. 
Return the object at the 1 side of the 1-n binding.

remove

public void remove(StructureElement element)
Deprecated. 
Add the given StructureElement to this StructureSet.

Parameters:
element - The StructureElement to be added.

Specifications:
public behavior
ensures contains(element) ==> element.getStructureSet() == null;
ensures contains(element) ==> !contains(element);

add

public void add(StructureElement element)
Deprecated. 
Remove the given StructureElement from this StructureSet.

Parameters:
element - The StructureElement to be removed.

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

getOtherEnds

public java.util.Set getOtherEnds()
Deprecated. 
Return a set containing the objects at the n side of the 1-n binding.

Specifications:
public behavior
ensures ( \forall Object o; ; \result .contains(o) <==> ( \exists StructureElement s; contains(s); s.getObject().equals(o)));
ensures \result != null;

getStructureElements

public java.util.Set getStructureElements()
Deprecated. 
Return a set containing the StructureElements at the n side of the 1-n binding.

Specifications:
public behavior
ensures ( \forall StructureElement s; ; contains(s) <==> \result .contains(s));
ensures \result != null;

unregister

void unregister(StructureElement element)
Deprecated. 
Remove the given StructureElement from this StructureSet

Parameters:
element - The element to be removed.

Specifications:
behavior
requires element != null;
ensures !contains(element);

register

void register(StructureElement element)
Deprecated. 
Add the given StructureElement to this StructureSet

Parameters:
element - The element to be added.

Specifications:
behavior
requires element != null;
ensures contains(element);

size

public int size()
Deprecated. 
Return the size of the StructureSet

Specifications:
public behavior
ensures \result == ( \num_of StructureElement e; contains(e); true);

contains

public boolean contains(StructureElement element)
Deprecated. 
Check whether or not the given element is connected to this StructureSet.

Parameters:
element - The element of which one wants to know if it is in this StructureSet.