Package org.yamcs.parameter
Class ArrayParameterCache
- java.lang.Object
-
- org.yamcs.parameter.ArrayParameterCache
-
- All Implemented Interfaces:
ParameterCache
public class ArrayParameterCache extends Object implements ParameterCache
This is another implementation of the parameter cache using arrays to store primitive values (instead of storingValue
).It should consume less memory than
ParameterCacheImpl
in case of large number of parameter values.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Remove all the parameters from the cacheList<ParameterValue>
getAllValues(Parameter pdef)
Returns all values from the cache for the parameter or null if there is no value cached The parameter are returned in descending order (newest parameter is returned first)List<ParameterValue>
getAllValues(Parameter pdef, long start, long stop)
Same as above but return all values that have the generation time in the (start, stop] intervalParameterValue
getLastValue(Parameter pdef)
Returns last cached value for parameter or null if there is no value in the cacheParameterValue
getLastValue1(Parameter p)
List<ParameterValue>
getValues(List<Parameter> plist)
Returns cached value for parameter or an empty list if there is no value in the cachevoid
update(Collection<ParameterValue> pvs)
update the parameters in the cache
-
-
-
Method Detail
-
update
public void update(Collection<ParameterValue> pvs)
Description copied from interface:ParameterCache
update the parameters in the cache- Specified by:
update
in interfaceParameterCache
- Parameters:
pvs
- - parameter value list
-
getLastValue
public ParameterValue getLastValue(Parameter pdef)
Description copied from interface:ParameterCache
Returns last cached value for parameter or null if there is no value in the cache- Specified by:
getLastValue
in interfaceParameterCache
- Parameters:
pdef
- - parameter for which the last value is returned- Returns:
-
getLastValue1
public ParameterValue getLastValue1(Parameter p)
-
getValues
public List<ParameterValue> getValues(List<Parameter> plist)
Description copied from interface:ParameterCache
Returns cached value for parameter or an empty list if there is no value in the cache- Specified by:
getValues
in interfaceParameterCache
- Returns:
-
getAllValues
public List<ParameterValue> getAllValues(Parameter pdef)
Description copied from interface:ParameterCache
Returns all values from the cache for the parameter or null if there is no value cached The parameter are returned in descending order (newest parameter is returned first)- Specified by:
getAllValues
in interfaceParameterCache
- Parameters:
pdef
- - parameter for which all values are returned- Returns:
- all values from the cache for the parameter or null if there is no value cached
-
getAllValues
public List<ParameterValue> getAllValues(Parameter pdef, long start, long stop)
Description copied from interface:ParameterCache
Same as above but return all values that have the generation time in the (start, stop] interval- Specified by:
getAllValues
in interfaceParameterCache
- Returns:
-
clear
public void clear()
Description copied from interface:ParameterCache
Remove all the parameters from the cache- Specified by:
clear
in interfaceParameterCache
-
-