|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jidesoft.chart.model.CopiedChartModel
public final class CopiedChartModel
A ChartModel class that creates a copy of the delegate chart model and does not allow it to be altered. Useful for multi-threading.
This class also attempts to make sure that it gets a 'clean' copy of the original model, i.e., that the model is not altered during the copying add. It does this in an optimistic fashion by going ahead with the copying and then checking whether the model changed during the copying add.
Note that because of the copying that occurs during initialisation, this class is not the exact analogue of the Unmodifiable wrappers for the Collection classes. This class has the disadvantage that it does some copying during initialisation, but has the advantage that we can make stronger guarantees about the contents of the container afterwards (and without having to be worrying about leaking references to the mutable data structure underneath). An unmodifiable ChartModel may also be added in a future release.
Constructor Summary | |
---|---|
CopiedChartModel(ChartModel delegate)
Construct a new ChartModel as a copy of the supplied model. |
Method Summary | |
---|---|
void |
addChartModelListener(ChartModelListener listener)
This method accepts a listener but in fact does nothing with it. |
boolean |
equals(Object other)
Equality is based on the name of the chart model, so that this copy is considered equal to the model from which it originated. |
String |
getName()
Returns the name of the chart model. |
Chartable |
getPoint(int n)
Returns the nth point of the model. |
int |
getPointCount()
Returns the number of points in the model. |
boolean |
isCyclical()
Returns whether the model is cyclical. |
boolean |
isErrorFree()
Enables the caller to enquire whether the copying add was error-free. |
Iterator<Chartable> |
iterator()
Returns an iterator for the model, so the model can be used directly in an advanced for ... |
void |
removeChartModelListener(ChartModelListener listener)
This method is also a no-op method (see addChartModelListener(ChartModelListener) ) |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CopiedChartModel(ChartModel delegate)
delegate
- the ChartModel to copy.Method Detail |
---|
public boolean isErrorFree()
public void addChartModelListener(ChartModelListener listener)
addChartModelListener
in interface ChartModel
listener
- the listener that will receive eventspublic void removeChartModelListener(ChartModelListener listener)
addChartModelListener(ChartModelListener)
)
removeChartModelListener
in interface ChartModel
listener
- the listener that will no longer receive eventspublic String getName()
getName
in interface ChartModel
getName
in interface Named
public Chartable getPoint(int n)
getPoint
in interface ChartModel
n
- the index
public int getPointCount()
getPointCount
in interface ChartModel
public boolean isCyclical()
isCyclical
in interface ChartModel
public Iterator<Chartable> iterator()
iterator
in interface Iterable<Chartable>
public boolean equals(Object other)
equals
in class Object
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |