Graph models should use java.util.Iterator
A science API for Java
Status: Beta
Brought to you by:
markhale
The design of the Graph2DModel interface does not allow
multiple clients to get access to series data unless
the client classes coordinate their access so that
client A does not call firstSeries() whilst client B is
calling nextSeries() (Ideally the model interface
should return an instance of java.util.Iterator that
the client class can use to iterate over the serieses)
Logged In: YES
user_id=133877
See 764666. All updates should be coordinated via
SwingUtilities.invokeLater(). This will be treated as a
feature request for Graph2DModel to support the Iterator
interface.
Logged In: YES
user_id=133877
Moved to feature requests.
Logged In: YES
user_id=133877
Possible design:
Single unified GraphModel interface {
addGraphDataListener(GraphDataListener l);
removeGraphDataListener(GraphDataListener l);
Enumeration/Iterator series();
}
With separate Data2DSeries, Data3DSeries, CategoryDataSeries
interfaces, returned by the series iterator.
Disadvantages: possible performance decrease: requires extra
object creation and casting operations.
Logged In: YES
user_id=133877
Java Generics would make the Iterator run-time safe.