org.jscience.chemistry.gui.extended.molecule
Class Bond

java.lang.Object
  extended by org.jscience.chemistry.gui.extended.molecule.Bond
All Implemented Interfaces:
PropAttributesInter

public class Bond
extends java.lang.Object
implements PropAttributesInter

Tripos base Bond class

See Also:
Atom

Field Summary
 Atom a1
          From and to atoms, respectively
 Atom a2
          From and to atoms, respectively
static int ANY
          Any bond type
static int AROMATIC
          Aromatic bond type
static int DASH
          Wedge down bond type
static int DOUBLE
          Double bond type
protected  int id
          Bond id
 PropAttributes prop
          Property list at the end of the bond string
protected  int ringId
          Id of ring atom belongs to (0 means atom is not in a ring)
static int SINGLE
          Single bond type
static int TRIPLE
          Triple bond type
protected  int type
          Bond type
static int WEDGE
          Wedge up bond type
 
Constructor Summary
Bond()
          Default constructor
Bond(Atom from, Atom to, int btype)
          Constructor without Properties
Bond(Bond b)
          Copy constructor
Bond(int id, int type, Atom from, Atom to, int ringId)
          Constructor without properties
Bond(int id, int type, Atom from, Atom to, int ringId, java.util.Properties prop)
          Full constructor
 
Method Summary
 boolean equals(Bond b)
          Compares this bond with another
 java.util.Properties getAttributes()
          Get the actual properties object that holds the attributes
 int getId()
          Returns id of the bond
 PropAttributes getPropAttributes()
          Get the encapsluation of the properties object which holds the attributes
 int getRingId()
          Returns id of the ring which this bond associates with
 int getType()
          Returns bond type
 float length()
          Retrun the length of this bond
 void setAttributes(java.util.Properties p)
          Set the attributes for the bond
 void setId(int id)
          Set id of the bond
 void setPropAttributes(PropAttributes p)
          Set the attributes for the bond
 void setRingId(int id)
          Set id of the ring which this bond associate with
 void setType(int n)
          Set bond type
 java.lang.String toString()
          Returns a String representation of bond
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SINGLE

public static final int SINGLE
Single bond type

See Also:
Constant Field Values

DOUBLE

public static final int DOUBLE
Double bond type

See Also:
Constant Field Values

TRIPLE

public static final int TRIPLE
Triple bond type

See Also:
Constant Field Values

AROMATIC

public static final int AROMATIC
Aromatic bond type

See Also:
Constant Field Values

WEDGE

public static final int WEDGE
Wedge up bond type

See Also:
Constant Field Values

DASH

public static final int DASH
Wedge down bond type

See Also:
Constant Field Values

ANY

public static final int ANY
Any bond type

See Also:
Constant Field Values

id

protected int id
Bond id


type

protected int type
Bond type


a1

public Atom a1
From and to atoms, respectively


a2

public Atom a2
From and to atoms, respectively


ringId

protected int ringId
Id of ring atom belongs to (0 means atom is not in a ring)


prop

public PropAttributes prop
Property list at the end of the bond string

Constructor Detail

Bond

public Bond(int id,
            int type,
            Atom from,
            Atom to,
            int ringId,
            java.util.Properties prop)
Full constructor

Parameters:
id - bond id
type - bond type
from - from atom
to - to atom
ringId - id of ring atom belongs to (0 means atom is not in a ring)
prop - properties of the bond, (string pairs on the end)

Bond

public Bond(Atom from,
            Atom to,
            int btype)
Constructor without Properties

Parameters:
type - bond type
from - from atom
to - to atom

Bond

public Bond(int id,
            int type,
            Atom from,
            Atom to,
            int ringId)
Constructor without properties

Parameters:
id - bond id
type - bond type
from - from atom
to - to atom
ringId - id of ring atom belongs to (0 means atom is not in a ring)

Bond

public Bond()
Default constructor


Bond

public Bond(Bond b)
Copy constructor

Parameters:
b - bond to be copied
Method Detail

setType

public void setType(int n)
             throws java.lang.IllegalArgumentException
Set bond type

Parameters:
n - bond type
Throws:
java.lang.IllegalArgumentException - if illegal bond type
See Also:
getType()

getType

public int getType()
Returns bond type

See Also:
setType(int)

equals

public boolean equals(Bond b)
Compares this bond with another

Parameters:
b - bond to compare with
Returns:
true if bonds are equal, else false

toString

public java.lang.String toString()
Returns a String representation of bond

Overrides:
toString in class java.lang.Object

length

public float length()
Retrun the length of this bond

Returns:
the length of this bond

getAttributes

public java.util.Properties getAttributes()
Get the actual properties object that holds the attributes

Specified by:
getAttributes in interface PropAttributesInter
Returns:
DOCUMENT ME!

getPropAttributes

public PropAttributes getPropAttributes()
Get the encapsluation of the properties object which holds the attributes

Specified by:
getPropAttributes in interface PropAttributesInter
Returns:
DOCUMENT ME!

setAttributes

public void setAttributes(java.util.Properties p)
Set the attributes for the bond

Specified by:
setAttributes in interface PropAttributesInter
Parameters:
p - Property for the bond

setPropAttributes

public void setPropAttributes(PropAttributes p)
Set the attributes for the bond

Specified by:
setPropAttributes in interface PropAttributesInter
Parameters:
p - Property for the bond

getId

public int getId()
Returns id of the bond


getRingId

public int getRingId()
Returns id of the ring which this bond associates with


setId

public void setId(int id)
Set id of the bond

Parameters:
id - bond id
See Also:
getId()

setRingId

public void setRingId(int id)
Set id of the ring which this bond associate with

Parameters:
id - ring id
See Also:
getRingId()