public class ReplaceRunnable extends Object implements Runnable, Comparator<int[]>, GenericListener<FileSearchListener>, Stoppable, Measurable, FileMapConsumer
T-Plan Robot Enterprise, (C) 2009-2022 T-Plan Limited. All rights reserved.
Constructor and Description |
---|
ReplaceRunnable(String pattern,
String replacement,
boolean caseSensitive) |
Modifier and Type | Method and Description |
---|---|
void |
addSearchListener(FileSearchListener listener) |
int |
compare(int[] o1,
int[] o2) |
void |
genericEvent(FileSearchListener listener,
EventObject event,
Object customObject)
Call the listener method on a particular listener.
|
float |
getProgress()
Get the task progress where 0 means "0% done" and 1 means "100% done".
|
boolean |
isStopped()
Find out whether the task has been already stopped.
|
void |
removeSearchListener(FileSearchListener listener) |
void |
run() |
void |
setFileMap(Map<File,List<int[]>> map) |
void |
stop()
Call this method to request the implementing object to stop the current
task or activity.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public void setFileMap(Map<File,List<int[]>> map)
setFileMap
in interface FileMapConsumer
public void genericEvent(FileSearchListener listener, EventObject event, Object customObject)
GenericListener
ChangeListener
the method should call
listener.stateChanged((ChangeEvent)event)
. This method will
be called by the GenericListenerSupport.fireEvent(com.tplan.robot.util.GenericListener, java.util.EventObject, java.lang.Object)
method for each registered listener.genericEvent
in interface GenericListener<FileSearchListener>
listener
- the registered listener.event
- an event to fire to the listener. The implementing class should
check whether it is an appropriate event matching the listener type and
throw an IllegalArgumentException
if not. For example, if the listener
is a ChangeListener
the event must be a ChangeEvent
.customObject
- an optional object allowing the implementing class to transfer
data between individual call of this method. For example, the argument may be a
List where the method will store all exceptions thrown by the listener to.public void addSearchListener(FileSearchListener listener)
public void removeSearchListener(FileSearchListener listener)
public int compare(int[] o1, int[] o2)
compare
in interface Comparator<int[]>
public void stop()
Stoppable
public boolean isStopped()
Stoppable
public float getProgress()
Measurable
getProgress
in interface Measurable