DataType - the type of the actual datapublic final class OrderedData<DataType> extends Object
index, the more accurate the data
is.
This class is intended to be used with AsyncDataLink instances when
it is hard forward data in the order of their accuracy but the accuracy can
be quantified with an index. This way wrapping listeners using the
AsyncHelper.makeSafeOrderedListener(AsyncDataListener) method can
guarantee that a less accurate data will not be forwarded to the actual,
generic listener after a more accurate data.
data if it is mutable. In case this data
object is immutable (and it is recommended to be so), then the
OrderedData instance is completely immutable.
| Constructor and Description |
|---|
OrderedData(long index,
DataType rawData)
|
| Modifier and Type | Method and Description |
|---|---|
long |
getIndex()
Returns the index defining how accurate the associated
data is. |
DataType |
getRawData()
Returns the actual data whose accuracy is described by the
index. |
String |
toString()
Returns the string representation of this
OrderedData in no
particular format. |
public long getIndex()
data is. Higher index means more accurate data.data is. This method returns the value specified
at construction time and can be any possible long value.public DataType getRawData()
index. Higher index means more accurate data.index. This method returns the value specified
at construction time and may return null.public String toString()