public abstract class AbstractConverterPlugIn extends java.lang.Object implements java.io.Serializable, PlugInListener
Modifier and Type | Field and Description |
---|---|
protected java.util.Vector |
pluginListeners
A vector of objects that are listening to this object for plug-in (data changed) events.
|
Constructor and Description |
---|
AbstractConverterPlugIn()
Creates a new instance of AbstractConverterPlugIn
|
AbstractConverterPlugIn(java.lang.String anAdvancedSerieSelector)
Creates a new instance of AbstractConverterPlugIn
|
Modifier and Type | Method and Description |
---|---|
boolean |
addPlugIn(AbstractConverterPlugIn aNewPlugIn)
Adds a plug-in at the end of the list of plug-ins.
|
void |
addPlugInListener(PlugInListener aListener)
Adds an
PlugInListener to this plug-in. |
protected boolean |
apply()
Applies all the conversions on the patterns contained by
InputVector |
protected boolean |
applyOnColumns()
Applies the conversion on the patterns contained by
InputVector and on the
columns specifed by the call to setAdvancedSerieSelector#setAdvancedSerieSelector . |
protected boolean |
applyOnRows()
Applies the conversion on the patterns contained by
InputVector
on all the rows. |
protected void |
cascade()
Cascades the
convertPatterns() method call to the next plug-in. |
java.util.TreeSet |
check(java.util.TreeSet checks)
This method is called to perform a check on this converter's properties to
ensure there are no errors or problems.
|
protected abstract boolean |
convert(int serie)
Applies the conversion on the Nth serie of the buffered pattern data.
|
void |
convertPatterns()
Converts all the patterns contained by
InputVector and on the
serie specifed by the call to setAdvancedSerieSelector#setAdvancedSerieSelector . |
void |
dataChanged(PlugInEvent anEvent)
This method is called by plug-ins whenever data is changed.
|
protected void |
fireDataChanged()
Fires a data changed event to all
PlugInListeners that are registered
to receive events from this plug-in object. |
java.lang.String |
getAdvancedSerieSelector()
Gets the AdvancedSerieSelector.
|
protected java.util.Vector |
getInputVector()
Gets the input vector of
Patterns with which this converter must process. |
java.lang.String |
getName()
Gets the name of this plug-in object.
|
AbstractConverterPlugIn |
getNextPlugIn()
Gets the next converter plug-in within this cascading series of plug-ins.
|
protected java.util.Vector |
getPluginListeners()
Gets a vector of all the
PlugInListener s that have been registerd
to receive events from this plug-in. |
protected int |
getSerieIndexNumber(int serie)
Gets the index of the current serie number.
|
protected int[] |
getSerieSelected()
Getter for property
serieSelected . |
protected double |
getValuePoint(int point,
int serie)
Gets the double value at the specified row (point) in the specifed serie /
column.
|
boolean |
isConnected()
Getter for property connected.
|
void |
removeAllPlugIns()
Removes (and disconnects) all (cascading) plug ins.
|
void |
removePlugInListener(PlugInListener aListener)
Removes a
PlugInListener that was previously registered to receive
plugin (data changed) events. |
void |
setAdvancedSerieSelector(java.lang.String aNewSerieSelector)
Sets the AdvancedSerieSelector for this plugin.
|
void |
setConnected(boolean aConnected)
Setter for property connected.
|
void |
setInputVector(java.util.Vector newInputVector)
Sets the input vector of
Patterns that this converter plugin should process. |
void |
setName(java.lang.String aName)
Sets the name of this plug-in object.
|
boolean |
setNextPlugin(AbstractConverterPlugIn aNewNextPlugIn)
Deprecated.
|
void |
setNextPlugIn(AbstractConverterPlugIn newNextPlugIn)
Added for XML serialization
|
protected java.util.Vector pluginListeners
public AbstractConverterPlugIn()
public AbstractConverterPlugIn(java.lang.String anAdvancedSerieSelector)
anAdvancedSerieSelector
- the advanced serie selector to use.setAdvancedSerieSelector()
public void convertPatterns()
InputVector
and on the
serie specifed by the call to setAdvancedSerieSelector#setAdvancedSerieSelector
.
It cascades also the conversion to the next-plugin connected in the chain.protected boolean apply()
InputVector
protected boolean applyOnColumns()
InputVector
and on the
columns specifed by the call to setAdvancedSerieSelector#setAdvancedSerieSelector
.protected boolean applyOnRows()
InputVector
on all the rows. Override this empty method to apply any change to the
order of the input vector's rows.protected void cascade()
convertPatterns()
method call to the next plug-in.protected abstract boolean convert(int serie)
getInputVector()
method. The result is a
Vector
of Pattern
objects which this method should use by converting
the requested serie.serie
- the serie to convertprotected double getValuePoint(int point, int serie)
point
- The row at which to get the pattern's double value.serie
- The serie or column from which to obtain the value.public java.lang.String getName()
public void setName(java.lang.String aName)
aName
- New name for this object.public boolean isConnected()
public void setConnected(boolean aConnected)
aConnected
- New value of property connected.public void addPlugInListener(PlugInListener aListener)
PlugInListener
to this plug-in. Usually this will be the
previous plug-in in the series of cascading plug-ins or the stream
input/output synapse.aListener
- The listener that requires notification of events from
this plug-in whenever data changes.public void removePlugInListener(PlugInListener aListener)
PlugInListener
that was previously registered to receive
plugin (data changed) events.aListener
- The listener that does not want to receive any events
anymore from this plug-in.protected java.util.Vector getPluginListeners()
PlugInListener
s that have been registerd
to receive events from this plug-in.PlugInListener
s listening to this
converter plug-in object.public void dataChanged(PlugInEvent anEvent)
PlugInListener
dataChanged
in interface PlugInListener
anEvent
- the event that is send, i.e. the event indicating that the
data is changed.protected void fireDataChanged()
PlugInListeners
that are registered
to receive events from this plug-in object. This method calls the
InputPlugInListener#dataChanged()
method in all registered listeners.public java.lang.String getAdvancedSerieSelector()
public void setAdvancedSerieSelector(java.lang.String aNewSerieSelector)
The AdvancedSerieSelector instructs this plug-in what serie/columns it should process. The format of this specification is a common seperated list of values and ranges. E.g '1,2,5,7' will instruct the converter to convert serie 1 and 2 and 5 and 7. A range can also be used e.g '2,4,5-8,9' will instruct the converter to process serie 2 and 4 and 5 and 6 and 7 and 8 and 9. A range is specifed using a '-' character with the number of the serie on either side.
Note NO negative numbers can be used in the AdvancedSerieSelector
.
aNewSerieSelector
- New value for the AdvancedSerieSelector
.protected int[] getSerieSelected()
serieSelected
. Returns the list of
selected columns to elaborate.serieSelected
.public boolean addPlugIn(AbstractConverterPlugIn aNewPlugIn)
aNewPlugIn
- the new plug in to add at the end of plug ins.true
when the plug in is added succesfully,
false
when the plug in is not added, e.g. in case the
plug in is already added / connected to another synapse / plug-in.public void removeAllPlugIns()
public boolean setNextPlugin(AbstractConverterPlugIn aNewNextPlugIn)
addPlugIn(AbstractConverterPlugIn)
aNewNextPlugIn
- The next plug-in in the series.true
when the plug-in is successfully added,
false
otherwise.public AbstractConverterPlugIn getNextPlugIn()
public void setNextPlugIn(AbstractConverterPlugIn newNextPlugIn)
**** DO NOT USE ****
public void setInputVector(java.util.Vector newInputVector)
Patterns
that this converter plugin should process.newInputVector
- The vector of Pattern objects to process.protected java.util.Vector getInputVector()
Patterns
with which this converter must process.public java.util.TreeSet check(java.util.TreeSet checks)
TreeSet
object.checks
- A TreeSet
of issues that should be added to by this
plug-in.TreeSet
of errors or problems relating to the setup of
this converter plug-in object.Synapse
protected int getSerieIndexNumber(int serie)
Submit Feedback to pmarrone@users.sourceforge.net