Class ProcessConstraintEvaluator.CachedConstraints
java.lang.Object
neqsim.process.util.optimizer.ProcessConstraintEvaluator.CachedConstraints
- All Implemented Interfaces:
Serializable
- Enclosing class:
ProcessConstraintEvaluator
public static class ProcessConstraintEvaluator.CachedConstraints
extends Object
implements Serializable
Public cached constraints class for external use and testing.
- Version:
- 1.0
- Author:
- NeqSim Development Team
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleprivate static final longprivate longprivate longprivate boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the cached results.doubleGets the cached flow rate.longGets the timestamp.longGets the TTL.voidInvalidates the cache.booleanChecks if cache is expired.booleanisValid()Checks if cache is valid.voidsetFlowRate(double flowRate) Sets the flow rate.voidsetTimestamp(long timestamp) Sets the timestamp.voidsetTtlMillis(long ttlMillis) Sets the TTL.voidsetValid(boolean valid) Sets validity flag.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
valid
private boolean valid -
flowRate
private double flowRate -
timestamp
private long timestamp -
ttlMillis
private long ttlMillis -
cachedResults
-
-
Constructor Details
-
CachedConstraints
public CachedConstraints()Default constructor.
-
-
Method Details
-
isValid
public boolean isValid()Checks if cache is valid.- Returns:
- true if valid
-
setValid
public void setValid(boolean valid) Sets validity flag.- Parameters:
valid- validity status
-
getFlowRate
public double getFlowRate()Gets the cached flow rate.- Returns:
- flow rate
-
setFlowRate
public void setFlowRate(double flowRate) Sets the flow rate.- Parameters:
flowRate- flow rate
-
getTimestamp
public long getTimestamp()Gets the timestamp.- Returns:
- timestamp in milliseconds
-
setTimestamp
public void setTimestamp(long timestamp) Sets the timestamp.- Parameters:
timestamp- timestamp in milliseconds
-
getTtlMillis
public long getTtlMillis()Gets the TTL.- Returns:
- TTL in milliseconds
-
setTtlMillis
public void setTtlMillis(long ttlMillis) Sets the TTL.- Parameters:
ttlMillis- TTL in milliseconds
-
getCachedResults
-
invalidate
public void invalidate()Invalidates the cache. -
isExpired
public boolean isExpired()Checks if cache is expired.- Returns:
- true if expired
-