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.5.5, 02/16/2005
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
protected CEdge(CEdge e)
          Copy constructor.
  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.
 boolean haveEqualProperties(CEdge e)
          Tests whether two bonds have the same properties.
protected  boolean overridesAtMerge(CEdge e)
          Checks if this bond should override another one when two structures are merged.
 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

CEdge

protected CEdge(CEdge e)
Copy constructor.

Parameters:
e - the original edge
Since:
3.5.2, 12/15/2004
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

haveEqualProperties

public boolean haveEqualProperties(CEdge e)
Tests whether two bonds have the same properties. The default implementation always returns true.

Returns:
true if they have the same properties, false otherwise
Since:
Marvin 3.4.1, 07/06/2004

overridesAtMerge

protected boolean overridesAtMerge(CEdge e)
Checks if this bond should override another one when two structures are merged.

Parameters:
e - the other bond
Returns:
true if it overrides e, false otherwise
Since:
Marvin 3.5, 09/30/2004