belka.mol
Class Bond

java.lang.Object
  extended by belka.mol.Bond
All Implemented Interfaces:
Serializable

public abstract class Bond
extends Object
implements Serializable

Abstract class describing behavior of a bond. Bond is a relation between two atoms. It can be, for example, covalent bond, hydrogen bond, edge of DT tessellation, etc.

Author:
Alexej Abyzov
See Also:
Serialized Form

Constructor Summary
Bond()
           
 
Method Summary
static Bond create(Atom a1, Atom a2)
          Static method to create a new bond
abstract  void disassemble()
          Disassembles bond into null pointers to help garbage collector to free memory.
abstract  Color getColor()
          Returns color of the cylinder representing the bond on a screen.
abstract  Atom getFAtom()
          Returns first atom of the bond.
abstract  double getRadius()
          Returns radius of the cylinder representing the bond.
abstract  Atom getSAtom()
          Returns second atom of the bond.
abstract  int getScreenRadius()
          Returns radius of the cylinder representing the bond on a screen.
abstract  void setColor(Color color)
          Sets bond's color on a screen.
abstract  void setRadius(double r)
          Sets radius of the cylinder representing the bond.
abstract  void setScreenRadius(double r)
          Sets radius of the cylinder representing the bond on a screen.
 String toString()
          Returns string representation of the bond.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Bond

public Bond()
Method Detail

create

public static Bond create(Atom a1,
                          Atom a2)
Static method to create a new bond

Parameters:
a1 - bond's first atom.
a2 - bond's second atom.
Returns:
new created bond.

disassemble

public abstract void disassemble()
Disassembles bond into null pointers to help garbage collector to free memory.


getFAtom

public abstract Atom getFAtom()
Returns first atom of the bond.

Returns:
first atom of the bond.

getSAtom

public abstract Atom getSAtom()
Returns second atom of the bond.

Returns:
second atom of the bond.

getColor

public abstract Color getColor()
Returns color of the cylinder representing the bond on a screen.

Returns:
color of the cylinder representing the bond on a screen.

getRadius

public abstract double getRadius()
Returns radius of the cylinder representing the bond.

Returns:
radius of the cylinder representing the bond.

setRadius

public abstract void setRadius(double r)
Sets radius of the cylinder representing the bond.

Parameters:
r - of the cylinder representing the bond.

getScreenRadius

public abstract int getScreenRadius()
Returns radius of the cylinder representing the bond on a screen.

Returns:
radius of the cylinder representing the bond on a screen.

setScreenRadius

public abstract void setScreenRadius(double r)
Sets radius of the cylinder representing the bond on a screen. Value is rescaled to int.

Parameters:
r - radius of the cylinder representing the bond on a screen.

setColor

public abstract void setColor(Color color)
Sets bond's color on a screen.

Parameters:
color - bond's color on a screen.

toString

public String toString()
Returns string representation of the bond.

Overrides:
toString in class Object
Returns:
string representation of the bond.