chemaxon.struc
Class CEdge

java.lang.Object
  extended bychemaxon.struc.CEdge
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
MolBond

public class CEdge
extends java.lang.Object
implements java.io.Serializable

Edge in a chemical graph.

Version:
3.1.4, 06/05/2003
Author:
Peter Csizmadia
See Also:
CGraph, Serialized Form

Field Summary
protected  CNode node1
          Node at one end of the edge.
protected  CNode node2
          Node at the other end of the edge.
 
Constructor Summary
CEdge(CNode node1, CNode node2)
          Create an edge between two nodes.
 
Method Summary
 java.lang.Object clone()
          Clones this edge.
 boolean equals(java.lang.Object obj)
          Two edges equal if their endpoints are the same.
protected  java.lang.Object getLock()
          Gets lock object for synchronization.
 CNode getNode1()
          Gets the first endpoint.
 CNode getNode2()
          Gets the second endpoint.
 CNode getOtherNode(CNode node)
          Gets the other end of the edge.
 CGraph getParent()
          Gets the parent graph.
 void swap()
          Change orientation.
 java.lang.String toString()
          Overrides Object.toString() to ease debugging.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

node1

protected transient CNode node1
Node at one end of the edge.


node2

protected transient CNode node2
Node at the other end of the edge.

Constructor Detail

CEdge

public CEdge(CNode node1,
             CNode node2)
Create an edge between two nodes.

Parameters:
node1 - the first node
node2 - the second node
Method Detail

getNode1

public final CNode getNode1()
Gets the first endpoint.

Returns:
the first node

getNode2

public final CNode getNode2()
Gets the second endpoint.

Returns:
the second node

getOtherNode

public final CNode getOtherNode(CNode node)
Gets the other end of the edge.

Parameters:
node - one of the edge endpoints
Returns:
the other end

getParent

public final CGraph getParent()
Gets the parent graph.

Returns:
the parent graph

swap

public void swap()
Change orientation.


equals

public final boolean equals(java.lang.Object obj)
Two edges equal if their endpoints are the same.

Parameters:
obj - the other object
Returns:
true if the other object is a CEdge and equals this object, false otherwise

clone

public java.lang.Object clone()
Clones this edge.

Returns:
the clone

toString

public java.lang.String toString()
Overrides Object.toString() to ease debugging. Returns a string consisting of the classname (without the package name!), the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object.

Returns:
a string representation of the object

getLock

protected final java.lang.Object getLock()
Gets lock object for synchronization.

Returns:
reference to the top parent graph