All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class collage.kernel.Edge

java.lang.Object
   |
   +----collage.kernel.Edge

public class Edge
extends Object
implements Transformable
Abstract edge class.

In a technical sense, an Edge is a labeled object in a given equivalence class that can be transformed and that can evaluate a transformation given an arbitrary point sequence.

In the Java version of the CollageSystem, the Edge class is also the base class for all Parts of a collage, i.e. there is no distinction between hyperedges and parts in the kernel of the Java CollageSystem. More precisely, the kernel does not know anything about parts at all. Because the CollageSystem supports type-0 grammars, all produced objects (parts or hyperedges) are a possible target for a replacement operation. Thus, there is no need for the kernel to separate parts and hyperedges.

Version:
09 Apr 1997
Author:
Nils Schwabe

Variable Index

 o eqClass
 o label

Constructor Index

 o Edge()
 o Edge(String)

Method Index

 o clone()
This is supposed to make a deep copy of the Edge.
 o findTrans(PointSequence, TransFinder, boolean)
Returns a transformation that maps the PointSequence to this edge using the given TransFinder.
 o getEqClass()
 o getLabel()
 o setEqClass(int)
Sets the equivalence class of the Edge.
 o setLabel(String)
Sets the label string of the Edge

The label is the character or string that the user sees and uses in a grammar to refer to a specific set (or class, but not meant in the usual programmatic sense) of objects.

 o transform(Transformation)
Transforms the edge with the given transformation.

Variables

 o label
  protected String label
 o eqClass
  protected int eqClass

Constructors

 o Edge
  public Edge()
 o Edge
  public Edge(String initLabel)

Methods

 o transform
  public abstract void transform(Transformation t)
Transforms the edge with the given transformation.

The semantic of this operation depends on the implementation and the needs of the derived class. A classical hyperedge or part will apply the transformation to its own shape.

 o findTrans
  public abstract Transformation findTrans(PointSequence s,
                                           TransFinder finder,
                                           boolean inverse)
Returns a transformation that maps the PointSequence to this edge using the given TransFinder. This method is typically used to determine the transformation that must be applied to a collage in order to replace this Edge object by the collage.

null is returned if no such transformation can be found. If the boolean parameter is true then it is tried to find the inverse mapping instead.

Depending on the actual type, i.e. derived class, of this Edge object, an overridden implementation of this method may decide to ignore specific, or all, parameters and return an arbitrary transformation, or null.

 o clone
  public Object clone()
This is supposed to make a deep copy of the Edge. This method must be overridden in all subclasses.

This implementation of the method always returns null, indicating that it is not possible to make a copy of an abstract object.

Overrides:
clone in class Object
 o setLabel
  public void setLabel(String label)
Sets the label string of the Edge

The label is the character or string that the user sees and uses in a grammar to refer to a specific set (or class, but not meant in the usual programmatic sense) of objects. Usually, the label uniquely identifies objects with equal replacement behaviour.

 o getLabel
  public String getLabel()
 o setEqClass
  public void setEqClass(int eqClass)
Sets the equivalence class of the Edge.

The CollageSystem automatically normalizes every collage grammar. As a part of the normalization process, each Edge object is assigned an equivalence class. The equivalence class is the internal label of an edge. In the special case of Hyperedge objects, two hyperedges with the same label may be assigned different equivalence classes (under some rarely used special conditions). For all other derived Edge sub-classes, two edges belong to the same equivalence class simply if they have the same label.

 o getEqClass
  public int getEqClass()

All Packages  Class Hierarchy  This Package  Previous  Next  Index