vec_math
Interface DataSink

All Known Implementing Classes:
AbstractDataSink, JDataSink, JPhasePlot

public interface DataSink

A data sink acts as an rmi-server capable of handling data of a certain type issued to it via an RMI-call. The only data format allowed is a list of VectorG elements, which can either be added, addData(java.util.List) or set (i.e. replace old data if there is any) with setData(java.util.List). Some sinks may also need metaData(java.util.Map) assigned to before they can definitely answer the acceptsData(java.lang.String) question. Metadata might be as simple as a designation which indices carries dependent and independent variables, error estimates to this data etc. Some sinks may further be RmiVariableDepending.

Proper implementations of this interface may display data in a datacanvas.


Method Summary
 boolean acceptsData(String type)
          Return true, if this sink accepts the flavour of this data.
 boolean addData(List<VectorG> d)
          Adds this data to the sink.
 boolean addData(Map<Object,VectorG> d)
          For data that is not discernible by an index, but rather by a key.
 boolean clearData()
          Clears all data.
 boolean metaData(Map<String,? extends Serializable> meta)
          Assigns some meta-data to the data sink, providing additional information on how to interpret the data.
 boolean setData(List<VectorG> d)
          Sets this data as the only data in the sink.
 boolean setData(Map<Object,VectorG> d)
          For data that is not discernible by an index, but rather by a key.
 

Method Detail

acceptsData

boolean acceptsData(String type)
Return true, if this sink accepts the flavour of this data. Returning true here does not guarantee that addData(java.util.List) or setData(java.util.List) return true, but returning false here guarantees that these both methods will return false and thus the effort can be spared.
Must accept the null-String, as clients may not know their data type.

Returns:
True, if this sink might use thi type of data.

metaData

boolean metaData(Map<String,? extends Serializable> meta)
Assigns some meta-data to the data sink, providing additional information on how to interpret the data. Some common keys may include index of the independt variable(s), the index of a measurement error etc. If the provided information is sufficient, maybe also including some default settings, this method should return true.

Returns:
False, if we cannot interprete data with the information available.

clearData

boolean clearData()
Clears all data. Calling setData(java.util.List) should have the same effect as calling this method, followed by an addData.

Returns:
True, if at least a single data point has been deleted.

addData

boolean addData(List<VectorG> d)
Adds this data to the sink. If processing the data takes too long, an individual thread should be started.

Returns:
True, if we can interprete this data.

addData

boolean addData(Map<Object,VectorG> d)
For data that is not discernible by an index, but rather by a key.


setData

boolean setData(List<VectorG> d)
Sets this data as the only data in the sink. If processing the data takes too long, an individual thread should be started.

Returns:
True, if we can interprete this data.

setData

boolean setData(Map<Object,VectorG> d)
For data that is not discernible by an index, but rather by a key.