org.concord.biologica.engine
Interface INucleicAcid

All Known Implementing Classes:
AlgorithmicNucleicAcid, NucleicAcid, RawNucleicAcid

public interface INucleicAcid

This interface presents the API for a nucleic acid, either a full strand of DNA or RNA or just a segment of one.

Version:
$Revision: 1.1.1.1 $ $Date: 2001/04/28 00:39:13 $
Author:
$Author: ed $

Method Summary
 void delete()
          Delete this nucleic acid - redundant with EngineObject in most cases.
 void delete(boolean notifyChange)
          Delete this nucleic acid - redundant with EngineObject in most cases.
 byte getBase(int index)
          Returns the base value at the given index in this acid.
 INucleicAcidHolder getHolder()
          Returns the nucleic acid's holder.
 int getLengthInBases()
          Returns the length of the nucleic acid in bases (vs.
 int getLengthInCodons()
          Returns the length of the nucleic acid in codons (vs.
 int getStartIndexInHolder()
          Returns the start index of this nucleic acid in its holder.
 void setAutomaticLocked(boolean automaticLocked)
          Set the automatic locked state of this object.
 void setLockedState(int lockedState)
          Set the lock state of the object.
 void setManualLocked(boolean manualLocked)
          Set the manual locked state of this object.
 void writeToStream(java.io.PrintWriter stream)
          Writes this object to the given stream in XML format.
 

Method Detail

delete

public void delete()
Delete this nucleic acid - redundant with EngineObject in most cases.


delete

public void delete(boolean notifyChange)
Delete this nucleic acid - redundant with EngineObject in most cases.


getHolder

public INucleicAcidHolder getHolder()
Returns the nucleic acid's holder.

Returns:
INucleicAcidHolder - raw nucleic acid's holder, never null

getLengthInBases

public int getLengthInBases()
Returns the length of the nucleic acid in bases (vs. codons).

Returns:
int - length of this nucleic acid in bases (approx. codons * 3)

getLengthInCodons

public int getLengthInCodons()
Returns the length of the nucleic acid in codons (vs. bases).

Returns:
int - length of this nucleic acid in codons (bases % 3)

getBase

public byte getBase(int index)
Returns the base value at the given index in this acid. Note that this value is along one strand. If the value of the other strand is desired, use Base.getPairBase().

Parameters:
index - int - index into acid, must be 0 to length of acid in bases-1
Returns:
byte - base value at given index
Throws:
java.lang.IllegalArgumentException - - input argument(s) illegal
See Also:
Base.getPairBase(byte, int)

getStartIndexInHolder

public int getStartIndexInHolder()
Returns the start index of this nucleic acid in its holder.

Returns:
int - index in holder

setAutomaticLocked

public void setAutomaticLocked(boolean automaticLocked)
Set the automatic locked state of this object.

setManualLocked

public void setManualLocked(boolean manualLocked)
Set the manual locked state of this object.

setLockedState

public void setLockedState(int lockedState)
Set the lock state of the object.

When this property is changed, a property change event is fired for the property named EngineProp.LOCKED.

It's expected that most derived classes will override this method and recursively lock their children.

Parameters:
locked - boolean - new locked state of this object

writeToStream

public void writeToStream(java.io.PrintWriter stream)
                   throws java.io.IOException
Writes this object to the given stream in XML format. Usually this method is used to write the object to a file for saving it, but that is potentially not the only use.

We could supply a default implementation that knows how to write the id value. But that convenience is not chosen because it's never correct to use just this implementation of these methods, so I'd rather have a compilation fail if a derived class fails to implement this method.

The inverse of this method is a constructor that takes a org.xml.sax.Parser argument and other arguments.

Parameters:
stream - PrintWriter - print stream
Throws:
java.lang.IllegalArgumentException - - input arguments illegal
java.io.IOException - - an IO error occurred in java libraries