|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Replacer
Project: sstringsearch
File: Replacer.java
Class: Replacer
Created: 6. mai. 2008
Description:
For performing search and replace.
Method Summary | |
---|---|
void |
addSearchTerm(String term,
ReplacingHitListener listener)
Adds a new searchterm with a ReplacingHitListener. |
long |
getNumberOfSearchTerms()
Get the number of defined searchterms. |
void |
removeSearchTerm(String term)
Removes a searchterm. |
void |
save(OutputStream outputStream)
Serialize the finite state automata to an outputstream. |
void |
save(String filename)
Convience-method to save a finite state automata to file. |
State |
searchAndReplace(Reader input,
Writer result,
Object... callbackArguments)
Does a search and replace on all that provided by the Reader. |
State |
searchAndReplace(Reader input,
Writer result,
State state,
Object... callbackArguments)
Does a search and replace on all that provided by the Reader. |
Method Detail |
---|
void addSearchTerm(String term, ReplacingHitListener listener) throws IllegalArgumentException
term
- The searchterm to add.listener
- The ReplacingHitListener used to replace this term in the result.
IllegalArgumentException
ReplacingHitListener
State searchAndReplace(Reader input, Writer result, Object... callbackArguments) throws IOException, IllegalArgumentException, IllegalStateException
input
- A reader that provides the data to search through.result
- A Writer where the result is written tocallbackArguments
- Arguments that may be included when calling the listener.
IOException
- If there is a problem reading the data.
IllegalArgumentException
- If any of the arguments are invalid.
IllegalStateException
- If the FSA is not ready to perform search, e.g. if no searchterms are defined.State searchAndReplace(Reader input, Writer result, State state, Object... callbackArguments) throws IOException, IllegalArgumentException, IllegalStateException
input
- A reader that provides the data to search through.result
- A Writer where the result is written tostate
- The state to start from.callbackArguments
- Arguments that may be included when calling the listener.
IOException
- If there is a problem reading the data.
IllegalArgumentException
- If any of the arguments are invalid.
IllegalStateException
- If the FSA is not ready to perform search, e.g. if no searchterms are defined.void removeSearchTerm(String term)
term
- The searchterm to remove.void save(OutputStream outputStream) throws IOException
outputStream
- The outputstream to write finite state automata to.
IOException
- If something goes wrong while serializing the class.void save(String filename) throws IOException
filename
- The file to write finite state automata to.
IOException
- If something goes wrong while serializing the class.long getNumberOfSearchTerms()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |