de.fhstralsund.vinets.structure
Interface HyperEdge

All Superinterfaces:
java.lang.Cloneable, Link, NetElement, java.io.Serializable

public interface HyperEdge
extends Link

An HyperEdge object models a HyperEdge of a HyperGraph. It does not connect the Nodes directly, but via Ports on their border. An HyperEdge may connect an arbitrary large number of Ports, which may be located also on the outer border of the HyperGraph itself. Multiple Ports on one Node are also allowed.


Method Summary
 boolean addPort(Port p)
          Adds a new Port to this HyperEdge.
 int countPorts()
          Returns the number of Ports incident to this HyperEdge.
 java.util.Iterator ports()
          Delivers an Iterator over all Ports of this HyperEdge.
 boolean removePort(Port p)
          Removes a Port from this HyperEdge and its host.
 
Methods inherited from interface de.fhstralsund.vinets.structure.Link
incidentNodes, isDirected, isUndirected
 
Methods inherited from interface de.fhstralsund.vinets.structure.NetElement
clearLabels, containsLabel, getBooleanLabel, getData, getDoubleLabel, getGeometry, getHost, getID, getIntLabel, getLabel, getLabelKeySet, getName, getOriginal, getRepresentation, removeLabel, setBooleanLabel, setData, setDoubleLabel, setGeometry, setIntLabel, setLabel, setName, setRepresentation
 

Method Detail

countPorts

int countPorts()
Returns the number of Ports incident to this HyperEdge.

Returns:
the number of Ports.

ports

java.util.Iterator ports()
Delivers an Iterator over all Ports of this HyperEdge.

Returns:
an Iterator over all Ports of this HyperEdge

addPort

boolean addPort(Port p)
Adds a new Port to this HyperEdge. The Port should be on the border of a Block that has the same host as this HyperEdge (this is an outer Link of the Block) or on the border of the host of this HyperEdge itself (this is an inner Link).

Parameters:
p - the Port to add.
Returns:
true if p was succesfully added, false if it was already present.
Throws:
java.lang.IllegalArgumentException - if the Port has a wrong host.

removePort

boolean removePort(Port p)
Removes a Port from this HyperEdge and its host. If less then 2 Ports remain, the whole HyperEdge is removed.

Parameters:
p - the Port to remove.
Returns:
true if p was succesfully removed.
Throws:
java.lang.IllegalArgumentException - if the Port has a wrong host.