WebServiceDataCacheNode Class
A WebServiceDataCacheNode represents a single node in the doubly-linked list holding the data for a WebServiceDataCache. The WebServiceDataCacheNode has an array of data (which may actually be null, if the node's data has not yet been loaded), next and prev pointers to the next and previous nodes in the linked list, and coveredMin and coveredMax values that indicate the min and max values of the "covered" range of data for this node.
The "covered" range is the interval of the data number line for which this node is responsible for storing data; Multigraph uses range this to avoid requesting the same data twice --- it never requests data for a range already covered by an existing cache node.
Initially, when the WebServiceDataCacheNode is created, the limits of the covered range are specified in the constructor. Later on, when the node's data is actually populated, the limits are potentially adjusted outward, if the range of data received is larger than the initially specified covered range. So in all cases, the covered range indicates the range for which no more data is needed, because it's covered by this node.
Note that the covered range is never adjusted to be smaller.
The WebServiceDataCacheNode does not actually fetch any data --- it is simply a storage container for fetched data; it's up to other code outside of this object to fetch and populate the data.
Constructor
WebServiceDataCacheNode
-
coveredMin
-
coveredMax
Parameters:
-
coveredMin
DataValue -
coveredMax
DataValue
Item Index
Properties
Methods
dataMax
()
DataValue | Null
Return the maximum (column 0) data value for this node. Returns null if the node has no data yet.
Returns:
dataMin
()
DataValue | Null
Return the minimum (column 0) data value for this node. Returns null if the node has no data yet.
Returns:
dataNext
()
WebServiceDataCacheNode | Null
Return the next node in the cache that actually has data, or null if none exists.
Returns:
dataPrev
()
WebServiceDataCacheNode | Null
Return the previous node in the cache that actually has data, or null if none exists.
Returns:
hasData
()
Return true if this node has data; false if not.
Returns:
Boolean
parseData
-
columns
-
dataText
Populate this node's data array by parsing the values
contained in the 'dataText' string, which should be a
string of comma-separated values of the same sort expected
by ArrayData and CSVData. The first argument, columns
,
should be a plain javascript array of DataVariable instances,
of the sort returned by Data.getColumns()
.
This method examines other nodes in the cache in order insure that values included in this node's data array are (a) strictly greater than the maximum value present in the cache prior to this node, and (b) strictly less than the minimum value present in the cache after this node. This guarantees that there is no overlap between the data in this node and other nodes in the cache.
Parameters:
-
columns
DataVariable Attr_List -
dataText
String
Properties
coveredMax
DataValue
The max of the covered value range
coveredMin
DataValue
The min of the covered value range
data
Array | Null
The actual data for this node.