java.lang.Object
org.apache.jena.atlas.data.ThresholdPolicyCount<T>
- All Implemented Interfaces:
ThresholdPolicy<T>
A threshold policy based on the number of tuples added.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonggetCount()Returns the current count of the number of items incremented in this policy.longReturns the threshold before the list is written to disk.voidCall this method each time to increment the policy's threshold count.booleanDetermines whether or not the configured threshold has been exceeded for this policy.voidreset()Reset the policy back to the initial state.toString()
-
Constructor Details
-
ThresholdPolicyCount
public ThresholdPolicyCount(long threshold)
-
-
Method Details
-
increment
Description copied from interface:ThresholdPolicyCall this method each time to increment the policy's threshold count.- Specified by:
incrementin interfaceThresholdPolicy<T>- Parameters:
item- The item that was added.
-
isThresholdExceeded
public boolean isThresholdExceeded()Description copied from interface:ThresholdPolicyDetermines whether or not the configured threshold has been exceeded for this policy.- Specified by:
isThresholdExceededin interfaceThresholdPolicy<T>- Returns:
trueif the threshold has been reached;falseotherwise.
-
reset
public void reset()Description copied from interface:ThresholdPolicyReset the policy back to the initial state.- Specified by:
resetin interfaceThresholdPolicy<T>
-
getThreshold
public long getThreshold()Returns the threshold before the list is written to disk.- Returns:
- The threshold point.
-
getCount
public long getCount()Returns the current count of the number of items incremented in this policy.- Returns:
- The item count.
-
toString
-