apollo.datamodel.seq
Class AbstractLazySequence

java.lang.Object
  extended by apollo.datamodel.AbstractSequence
      extended by apollo.datamodel.seq.AbstractLazySequence
All Implemented Interfaces:
LazySequenceI, SequenceI, java.io.Serializable
Direct Known Subclasses:
AlternateEnsJSequence, AlternateEnsJSequence, DASLazySequence, DebugLazySequence, EnsCGISequence, EnsJSequence, GAMESequence, PFetchSequence, SRSSequence

public abstract class AbstractLazySequence
extends AbstractSequence
implements LazySequenceI

i wonder if this should move to dataadapter package as its a sequence loader basically - so it loads stuff just like a data adapter

See Also:
Serialized Form

Nested Class Summary
protected  class AbstractLazySequence.LazyLoadControlledObject
           
 
Field Summary
protected  CacheSequenceLoader cacher
           
protected  AbstractLazySequence.LazyLoadControlledObject 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
AbstractLazySequence(java.lang.String id, Controller c)
           
 
Method Summary
protected  CacheSequenceLoader createCacher()
          Overriden by GAMESequence
 CacheSequenceLoader getCacher()
           
 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?
 java.lang.String getResiduesFromSource(int low, int high)
           
protected abstract  java.lang.String getResiduesFromSourceImpl(int low, int high)
           
protected  java.lang.String getResiduesImpl(int start)
           
protected  java.lang.String getResiduesImpl(int start, int end)
           
abstract  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
 boolean isLazy()
          Cleanup dangling references when SequenceI not needed anymore.
protected  boolean needInclusiveEnd()
          Whether the end needs adding to, to make it inclusive.
 void setCacher(CacheSequenceLoader csl)
           
 void setController(Controller c)
           
 
Methods inherited from class apollo.datamodel.AbstractSequence
addDbXref, addDbXref, addDbXref, addSequenceEdit, addSequencingErrorPosition, clearResidues, getAccessionNo, getBaseAt, getChecksum, getDbXrefs, getDescription, getFrame, getGenomicErrors, getLength, 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, setRange, 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.SequenceI
addDbXref, addDbXref, addDbXref, addSequenceEdit, addSequencingErrorPosition, clearResidues, getAccessionNo, getBaseAt, getChecksum, getDbXrefs, getDescription, getFrame, getGenomicErrors, getLength, getName, getOrganism, getResidues, getResidues, getResidueType, getReverseComplement, getSequencingErrorAtPosition, hasName, hasResidues, hasResidueType, isAA, isSequenceAvailable, isSequencingErrorPosition, removeSequenceEdit, setAccessionNo, setChecksum, setDate, setDescription, setLength, setName, setOrganism, setRange, setResidues, setResidueType, usesGenomicCoords
 

Field Detail

llco

protected AbstractLazySequence.LazyLoadControlledObject llco

cacher

protected CacheSequenceLoader cacher
Constructor Detail

AbstractLazySequence

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

getRange

public 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?

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

getSubSequence

public abstract 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

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

createCacher

protected CacheSequenceLoader createCacher()
Overriden by GAMESequence


setController

public void setController(Controller c)

setCacher

public void setCacher(CacheSequenceLoader csl)

getCacher

public CacheSequenceLoader getCacher()

getResiduesImpl

protected java.lang.String getResiduesImpl(int start,
                                           int end)
Specified by:
getResiduesImpl in class AbstractSequence

getResiduesImpl

protected java.lang.String getResiduesImpl(int start)
Specified by:
getResiduesImpl in class AbstractSequence

getResiduesFromSource

public java.lang.String getResiduesFromSource(int low,
                                              int high)
Specified by:
getResiduesFromSource in interface LazySequenceI

needInclusiveEnd

protected boolean needInclusiveEnd()
Whether the end needs adding to, to make it inclusive. EnsCGISequence does not need an inclusive end and overrides this to return false.

Overrides:
needInclusiveEnd in class AbstractSequence

getResiduesFromSourceImpl

protected abstract java.lang.String getResiduesFromSourceImpl(int low,
                                                              int high)

isLazy

public boolean isLazy()
Description copied from interface: SequenceI
Cleanup dangling references when SequenceI not needed anymore. Is this funny to have in SequenceI? (needed for AbstractLazySequence)

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