public class ApproximateCounter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
COUNT_MAX |
static java.lang.String |
COUNT_PROPERTY_PREFIX |
static int |
COUNT_RESOLUTION |
Constructor and Description |
---|
ApproximateCounter() |
Modifier and Type | Method and Description |
---|---|
static void |
adjustCountSync(NodeBuilder builder,
long offset)
Adjust a counter in the given node.
|
static long |
adjustOffset(long oldCount,
long calculatedOffset,
int resolution)
This method ensures that the new approximate count (the old count plus
the calculated offset) does not go below 0.
|
static long |
calculateOffset(long offset,
int resolution)
Calculate the approximate offset from a given offset.
|
static long |
getCountSync(NodeState node)
Get the count estimation.
|
public static final java.lang.String COUNT_PROPERTY_PREFIX
public static final int COUNT_RESOLUTION
public static final int COUNT_MAX
public static long calculateOffset(long offset, int resolution)
offset
- the high-resolution input offsetresolution
- the resolutionpublic static long adjustOffset(long oldCount, long calculatedOffset, int resolution)
oldCount
- the old countcalculatedOffset
- the calculated offset (may not be 0)resolution
- the new (lower) resolutionpublic static void adjustCountSync(NodeBuilder builder, long offset)
builder
- the node builderoffset
- the offsetpublic static long getCountSync(NodeState node)
node
- the node"Copyright © 2010 - 2018 Adobe Systems Incorporated. All Rights Reserved"