org.expasy.jpl.commons.collection.symbol.seq
Class AbstractSequencePositioner<T>
java.lang.Object
org.expasy.jpl.commons.collection.symbol.seq.AbstractSequencePositioner<T>
- All Implemented Interfaces:
- Iterable<Integer>, ExtraIterable<Integer>, IndexIterable, SequenceIterable<T>
- Direct Known Subclasses:
- MotifMatcher
public abstract class AbstractSequencePositioner<T>
- extends Object
- implements SequenceIterable<T>
This class provides a skeletal implementation of the PositionIterable
interface, to minimize the effort required to implement this interface.
To implement a JPL positioner on a Sequence, the programmer needs only to
extend this class and provide implementations for the iterator. (The iterator
returned by the iterator method must implement the
foundNextPosition() method).
- Version:
- 1.0
- Author:
- nikitin
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
sequence
protected SymbolSequence<T> sequence
- Iterator will iterate over found positions on this sequence.
numberOfPositions
protected int numberOfPositions
AbstractSequencePositioner
public AbstractSequencePositioner()
setSequence
public void setSequence(SymbolSequence<T> sequence)
- Set the sequence for future searches.
- Specified by:
setSequence in interface SequenceIterable<T>
- Parameters:
sequence - the sequence where motif search will be done.
- Throws:
IllegalArgumentException - if sequence is not defined.
getNumberOfSites
public int getNumberOfSites()
- Description copied from interface:
SequenceIterable
- get number of positions
- Specified by:
getNumberOfSites in interface SequenceIterable<T>
iterator
public IndexIterable.Iterator iterator(SymbolSequence<T> sequence)
- Description copied from interface:
SequenceIterable
- coupling sequence with iterator
- Specified by:
iterator in interface SequenceIterable<T>
Copyright (c) 2012 Swiss Institute of Bioinformatics. All rights reserved.