apollo.datamodel.seq
Class PFetchSequence

java.lang.Object
  extended by apollo.datamodel.AbstractSequence
      extended by apollo.datamodel.seq.AbstractLazySequence
          extended by apollo.datamodel.seq.PFetchSequence
All Implemented Interfaces:
LazySequenceI, SequenceI, java.io.Serializable

public class PFetchSequence
extends AbstractLazySequence
implements LazySequenceI

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class apollo.datamodel.seq.AbstractLazySequence
AbstractLazySequence.LazyLoadControlledObject
 
Field Summary
 
Fields inherited from class apollo.datamodel.seq.AbstractLazySequence
cacher, llco
 
Fields inherited from class apollo.datamodel.AbstractSequence
genomic_errors, genomicRange, length
 
Fields inherited from interface apollo.datamodel.SequenceI
AA, CLEAR_EDIT, DELETION, DNA, INSERTION, RNA, SUBSTITUTION
 
Constructor Summary
PFetchSequence(java.lang.String id, Controller c)
           
 
Method Summary
 int getLength()
           
 RangeI getRange()
          CacheSequenceLoader requires a Range - getRange will set one up from 1 to length if there has not been a range set yet - should this go in AbstractSeq?
protected  java.lang.String getResiduesFromSourceImpl(int low, int high)
           
 SequenceI getSubSequence(int start, int end)
          Clean up dangling reference as listener to controller that will make old instances persist - no longer needed as doesnt listen to controller anymore
static void main(java.lang.String[] argv)
           
 void setRange(RangeI loc)
          I (SUZ) am removing the call to setLength, because the length of the viewed range should not logically change the length of the sequence.
 
Methods inherited from class apollo.datamodel.seq.AbstractLazySequence
createCacher, getCacher, getResiduesFromSource, getResiduesImpl, getResiduesImpl, isLazy, needInclusiveEnd, setCacher, setController
 
Methods inherited from class apollo.datamodel.AbstractSequence
addDbXref, addDbXref, addDbXref, addSequenceEdit, addSequencingErrorPosition, clearResidues, getAccessionNo, getBaseAt, getChecksum, getDbXrefs, getDescription, getFrame, getGenomicErrors, getName, getOrganism, getResidues, getResidues, getResidueType, getReverseComplement, getSequencingErrorAtPosition, hasName, hasRange, hasResidues, hasResidueType, isAA, isNewerThan, isSequenceAvailable, isSequencingErrorPosition, needShiftFromOneToZeroBasedCoords, pegLimits, removeSequenceEdit, setAccessionNo, setChecksum, setDate, setDescription, setLength, setName, setNeedShiftFromOneToZeroBasedCoords, setOrganism, setResidues, setResidueType, shiftFromOneToZeroBased, usesGenomicCoords
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface apollo.datamodel.seq.LazySequenceI
getResiduesFromSource
 
Methods inherited from interface apollo.datamodel.SequenceI
addDbXref, addDbXref, addDbXref, addSequenceEdit, addSequencingErrorPosition, clearResidues, getAccessionNo, getBaseAt, getChecksum, getDbXrefs, getDescription, getFrame, getGenomicErrors, getName, getOrganism, getResidues, getResidues, getResidueType, getReverseComplement, getSequencingErrorAtPosition, hasName, hasResidues, hasResidueType, isAA, isLazy, isSequenceAvailable, isSequencingErrorPosition, removeSequenceEdit, setAccessionNo, setChecksum, setDate, setDescription, setLength, setName, setOrganism, setResidues, setResidueType, usesGenomicCoords
 

Constructor Detail

PFetchSequence

public PFetchSequence(java.lang.String id,
                      Controller c)
Method Detail

getRange

public RangeI getRange()
Description copied from class: AbstractLazySequence
CacheSequenceLoader requires a Range - getRange will set one up from 1 to length if there has not been a range set yet - should this go in AbstractSeq?

Specified by:
getRange in interface SequenceI
Overrides:
getRange in class AbstractLazySequence

setRange

public void setRange(RangeI loc)
Description copied from class: AbstractSequence
I (SUZ) am removing the call to setLength, because the length of the viewed range should not logically change the length of the sequence. This may have a negative effect if there is any code around that was assuming the length of the sequence would be set this way. When this happens the code should be changed to independently call seq.setLength() This was having very bad effects when the sequence length was already being set. Then when setRefSequence was called the length was being silently changed to 1 (because the range was not yet set) Then the range could no longer be set because the sequence length was 0. Ugh.

Specified by:
setRange in interface SequenceI
Overrides:
setRange in class AbstractSequence

getSubSequence

public SequenceI getSubSequence(int start,
                                int end)
Description copied from class: AbstractLazySequence
Clean up dangling reference as listener to controller that will make old instances persist - no longer needed as doesnt listen to controller anymore

Specified by:
getSubSequence in interface SequenceI
Specified by:
getSubSequence in class AbstractLazySequence

getLength

public int getLength()
Specified by:
getLength in interface SequenceI
Overrides:
getLength in class AbstractSequence

getResiduesFromSourceImpl

protected java.lang.String getResiduesFromSourceImpl(int low,
                                                     int high)
Specified by:
getResiduesFromSourceImpl in class AbstractLazySequence

main

public static void main(java.lang.String[] argv)