Class Assembly

java.lang.Object
  extended byAssembly

public class Assembly
extends java.lang.Object

Assembly holds an Assembly of Subunits and the AssemblyGraphic. It also tracks the next Event for this Assembly and its validity. Assemblies can be bonded, split, or relaxed.


Constructor Summary
Assembly()
          Constructs an default Assembly with no Subunits and no valid Events
Assembly(java.util.Vector s, java.lang.String name)
          Constructs an Assembly named name with Subunits from s
 
Method Summary
 Assembly bindAssemblies(Assembly bindasm, FormBondEvent e, Subunit bsSub1, Subunit bsSub2)
          Carries out the FormBondEvent e by binding bindasm to this through a bond between bsSub1 in this Assembly and bsSub2 in bindasm.Both Assembly(s) should be different.
 void compoundTransforms()
          Composes Assembly and Subunit transforms so that the Subunits hold all the significant location information and the Assembly location information is all the identity function
 boolean containsSubunit(Subunit s)
          Returns true if s is in this Assembly
 boolean equals(Assembly a)
          Returns this true if this Assembly is the same object as Assembly a
 void fastBind(FormBondEvent e)
          bind an broken bond which breaks a loop in an assembly
 AssemblyGraphic getAssemblyGraphic()
          Returns this Assembly's AssemblyGraphic
 javax.vecmath.Vector3d getBindingSitePos(Subunit sub, BindingSite bs)
          Returns the position of the binding site relative to the real axis system
 javax.vecmath.Quat4d getBindingSiteRot(Subunit sub, BindingSite bs)
          Returns the rotation of the binding site relative to the real axis system
 javax.vecmath.Vector3d getBindingSiteTipPos(Subunit sub, BindingSite bs)
           
 int[] getBSCounts()
          get the amounts of different types of free BindingSite(s) in an assembly
 java.util.Vector getFreebss()
          Gets all the free BindingSite(s) in an assembly, and put them in an vector
 java.lang.String getName()
          Returns this Assembly's name
 javax.vecmath.Vector3d getPos()
          Returns this Assembly's position
 javax.vecmath.Quat4d getRot()
          Returns this Assembly's rotation
 Subunit getSubunit(BindingSite bs)
          Returns the Subunit in this Assembly that holds bs, if that's not found returns a new blank Subunit
 java.util.Vector getSubunits()
          Returns a Vector of this Assembly's Subunits
 javax.media.j3d.Transform3D getTransform()
          Returns this Assembly's transform
 Event nextEvent()
          Returns this Assembly's next Event
 double nextEventEndTime()
          Returns this Assembly's next Event's end time
 int numSubunits()
          public boolean containsSubunit(Subunit s) { return mysubs.contains(s); } /** Returns number of subunits in this Assembly
 void rotate(javax.vecmath.Quat4d rot)
           
 void setNextEvent(Event ev)
          Sets the next event for this Assembly to ev
 void setPos(javax.vecmath.Vector3d v)
          Sets this Assembly's position to v
 void setValidTime(double time)
          Sets the valid time for this Assembly to time
 Assembly splitAssembly(BreakBondEvent e, int newasmnum)
          Used to split this Assembly when indicated by a BreakBondEvent.
 java.lang.String toString()
          Returns a String version of this Assembly
 void updateLocation(javax.vecmath.Quat4d q, javax.vecmath.Vector3d v)
          Sets this Assembly's position to v and rotation to q
 void updateLocation(javax.media.j3d.Transform3D tr)
          Sets this Assembly's transform to tr
 double validTime()
          Returns this Assembly's valid time
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Assembly

public Assembly()
Constructs an default Assembly with no Subunits and no valid Events


Assembly

public Assembly(java.util.Vector s,
                java.lang.String name)
Constructs an Assembly named name with Subunits from s

Parameters:
s - Vector, all the Subunits to be in this Assembly
name - String, the name of this Assembly
Method Detail

getFreebss

public java.util.Vector getFreebss()
Gets all the free BindingSite(s) in an assembly, and put them in an vector

Returns:
Vector

getSubunit

public Subunit getSubunit(BindingSite bs)
Returns the Subunit in this Assembly that holds bs, if that's not found returns a new blank Subunit

Parameters:
bs - BindingSite
Returns:
Subunit

fastBind

public void fastBind(FormBondEvent e)
bind an broken bond which breaks a loop in an assembly

Parameters:
e - void

getBSCounts

public int[] getBSCounts()
get the amounts of different types of free BindingSite(s) in an assembly

Returns:
int[]

splitAssembly

public Assembly splitAssembly(BreakBondEvent e,
                              int newasmnum)
Used to split this Assembly when indicated by a BreakBondEvent. Returns the newly split off Assembly, or null if the split didn't make a new Assembly (rather, it broke a loop)

Parameters:
e - BreakBondEvent, the event that causes the split
newasmnum - int, the number of the Assembly to be split off
Returns:
Assembly

bindAssemblies

public Assembly bindAssemblies(Assembly bindasm,
                               FormBondEvent e,
                               Subunit bsSub1,
                               Subunit bsSub2)
Carries out the FormBondEvent e by binding bindasm to this through a bond between bsSub1 in this Assembly and bsSub2 in bindasm.Both Assembly(s) should be different. If the binding can not occur (because of steric hindrance), returns a modified version of bindasm, otherwise returns null.

Parameters:
bindasm - Assembly, assembly to be bound
e - FormBondEvent, the event that causes the binding
bsSub1 - Subunit, the Subunit on this Assembly that holds the BindingSite which forms the bond
bsSub2 - Subunit, the Subunit on bindasm that holds the BindingSite which forms the bond
Returns:
Assembly

compoundTransforms

public void compoundTransforms()
Composes Assembly and Subunit transforms so that the Subunits hold all the significant location information and the Assembly location information is all the identity function


rotate

public void rotate(javax.vecmath.Quat4d rot)

getBindingSitePos

public javax.vecmath.Vector3d getBindingSitePos(Subunit sub,
                                                BindingSite bs)
Returns the position of the binding site relative to the real axis system

Parameters:
sub - Subunit, holds bs
bs - BindingSite
Returns:
Vector3d

getBindingSiteTipPos

public javax.vecmath.Vector3d getBindingSiteTipPos(Subunit sub,
                                                   BindingSite bs)

getBindingSiteRot

public javax.vecmath.Quat4d getBindingSiteRot(Subunit sub,
                                              BindingSite bs)
Returns the rotation of the binding site relative to the real axis system

Parameters:
sub - Subunit, holds bs
bs - BindingSite
Returns:
Quat4d

getAssemblyGraphic

public AssemblyGraphic getAssemblyGraphic()
Returns this Assembly's AssemblyGraphic

Returns:
AssemblyGraphic

getTransform

public javax.media.j3d.Transform3D getTransform()
Returns this Assembly's transform

Returns:
Transform3D

getRot

public javax.vecmath.Quat4d getRot()
Returns this Assembly's rotation

Returns:
Quat4d

getPos

public javax.vecmath.Vector3d getPos()
Returns this Assembly's position

Returns:
Vector3d

getName

public java.lang.String getName()
Returns this Assembly's name

Returns:
String

getSubunits

public java.util.Vector getSubunits()
Returns a Vector of this Assembly's Subunits

Returns:
Vector

setPos

public void setPos(javax.vecmath.Vector3d v)
Sets this Assembly's position to v

Parameters:
v - Vector3d

updateLocation

public void updateLocation(javax.vecmath.Quat4d q,
                           javax.vecmath.Vector3d v)
Sets this Assembly's position to v and rotation to q

Parameters:
q - Quat4d
v - Vector3d

updateLocation

public void updateLocation(javax.media.j3d.Transform3D tr)
Sets this Assembly's transform to tr

Parameters:
tr - Transform3D

containsSubunit

public boolean containsSubunit(Subunit s)
Returns true if s is in this Assembly

Parameters:
s - Subunit
Returns:
boolean

numSubunits

public int numSubunits()
public boolean containsSubunit(Subunit s) { return mysubs.contains(s); } /** Returns number of subunits in this Assembly

Returns:
int

setNextEvent

public void setNextEvent(Event ev)
Sets the next event for this Assembly to ev

Parameters:
ev - Event

nextEvent

public Event nextEvent()
Returns this Assembly's next Event

Returns:
Event

nextEventEndTime

public double nextEventEndTime()
Returns this Assembly's next Event's end time

Returns:
double

setValidTime

public void setValidTime(double time)
Sets the valid time for this Assembly to time

Parameters:
time - double

validTime

public double validTime()
Returns this Assembly's valid time

Returns:
double

equals

public boolean equals(Assembly a)
Returns this true if this Assembly is the same object as Assembly a

Parameters:
a - Assembly
Returns:
boolean

toString

public java.lang.String toString()
Returns a String version of this Assembly

Returns:
String