T
- the type of values in the cachepublic class Cache<T> extends DesiredRateExpressionImpl<List<T>>
The expression can be used to collect values from pvmanager datasources or from external sources.
Constructor and Description |
---|
Cache(int maxSize)
Creates a new cache expression.
|
Cache(SourceRateExpression<T> sourceExpression,
int maxSize)
Creates a new cache expression.
|
Modifier and Type | Method and Description |
---|---|
void |
add(T newValue)
Adds a new value to the cache.
|
WriteFunction<T> |
getWriteFunction()
The write function to be used to fill the cache.
|
Cache<T> |
maxSize(int maxSize)
Changes the maximum size of the cache.
|
as, fillReadRecipe, getDesiredRateExpressionImpl, getFunction, getName
and, getDesiredRateExpressions
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
and, getDesiredRateExpressions
public Cache(int maxSize)
maxSize
- the maximum number of elements in the cachepublic Cache(SourceRateExpression<T> sourceExpression, int maxSize)
sourceExpression
- the source rate expression that will fill the cachemaxSize
- the maximum number of elements in the cachepublic WriteFunction<T> getWriteFunction()
public Cache<T> maxSize(int maxSize)
maxSize
- the number of values kept in the cachepublic void add(T newValue)
newValue
- the value to be addedCopyright © 2010–2015. All rights reserved.