JML

org.jmlspecs.samples.digraph
Class Arc

java.lang.Object
  extended byorg.jmlspecs.samples.digraph.Arc
All Implemented Interfaces:
Cloneable

public class Arc
extends Object
implements Cloneable

Directed arcs for directed graphs.

Author:
Katie Becker, Gary T. Leavens

Field Summary
private  NodeType source
           
private  NodeType target
           
 
Constructor Summary
Arc(NodeType source, NodeType target)
          Initialize this arc with the given source and target.
 
Method Summary
protected  String className()
          Return the name of this class.
 Object clone()
           
 boolean equals(Object o)
           
 void flip()
          Invert the direction of this arc.
 NodeType getSource()
          Get the source node of this arc.
 NodeType getTarget()
          Get the target node of this arc.
 int hashCode()
           
 void setSource(NodeType source)
          Set the source node of this arc to the given node.
 void setTarget(NodeType target)
          Set the target node of this arc to the given node.
 String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

source

private NodeType source

target

private NodeType target
Constructor Detail

Arc

public Arc(NodeType source,
           NodeType target)
Initialize this arc with the given source and target.

Method Detail

equals

public boolean equals(Object o)
Overrides:
equals in class Object

clone

public Object clone()
Overrides:
clone in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

flip

public void flip()
Invert the direction of this arc.


getSource

public NodeType getSource()
Get the source node of this arc.


setSource

public void setSource(NodeType source)
Set the source node of this arc to the given node.


getTarget

public NodeType getTarget()
Get the target node of this arc.


setTarget

public void setTarget(NodeType target)
Set the target node of this arc to the given node.


className

protected String className()
Return the name of this class.


toString

public String toString()
Overrides:
toString in class Object

JML

JML is Copyright (C) 1998-2002 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This release depends on code from the MultiJava project and is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.