Package org.biojava.bio.search
Interface BioMatcher
-
- All Known Implementing Classes:
MaxMismatchMatcher
public interface BioMatcher
Interface for things that perform matches.These will almost always be produced by a factory method on a BioPattern object.
- Author:
- Matthew Pocock
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
end()
Get the last symbol index that matches the pattern.boolean
find()
Attempt to find the next match.SymbolList
group()
Get the matching region as a SymbolList.int
start()
Get the first symbol index that matches the pattern.
-
-
-
Method Detail
-
find
boolean find()
Attempt to find the next match.If the pattern can be found, then this will return true. If it could not, then it will return false. This is convenient within for or while loops.
Each time this is called, the next match will be found. The start() and end() values will increase each time, regardless of wether you called any other methods.
- Returns:
- true if there is another match
-
start
int start()
Get the first symbol index that matches the pattern.- Returns:
- the start of the current match
- Throws:
IllegalStateException
- if there is no current match
-
end
int end()
Get the last symbol index that matches the pattern.- Returns:
- the end of the current match
- Throws:
IllegalStateException
- if there is no current match
-
group
SymbolList group()
Get the matching region as a SymbolList.- Returns:
- the matching symbols
- Throws:
IllegalStateException
- if there is no current match
-
-