|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.xshare.base.counter.CounterFactory
Factory for the standard implementations of DynamicCounter
and StaticCounter
with additional helper methods for counters.
createStaticCounter()
and createDynamicCounter()
aren't synchronized. If
you need a synchronized version of the counters, then create
them as usual and pass them to syncStaticCounter(StaticCounter)
or syncDynamicCounter(DynamicCounter)
and you will
get a synchronized version back.
Method Summary | |
static DynamicCounter |
createDynamicCounter()
Returns a standard implementation of a DynamicCounter .
|
static StaticCounter |
createStaticCounter()
Returns a standard implementation of a StaticCounter .
|
static DynamicCounter |
syncDynamicCounter(DynamicCounter pCounter)
Wraps a given DynamicCounter with a synchronized wrapper
instance. |
static StaticCounter |
syncStaticCounter(StaticCounter pCounter)
Wraps a given StaticCounter with a synchronized wrapper
instance. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static StaticCounter createStaticCounter()
StaticCounter
.
This standard implementation implements the Serializable
interface. If you would like to use this feature, the
predicate
and the key
you would like to pass to StaticCounter.addRule(Object, UnaryPredicate)
must be serializable too.
public static DynamicCounter createDynamicCounter()
DynamicCounter
.
This standard implementation implements the Serializable
interface. If you would like to use this feature, the
UnaryFunction
you would like to pass to DynamicCounter.addRule(UnaryFunction)
must be serializable too.
public static DynamicCounter syncDynamicCounter(DynamicCounter pCounter)
DynamicCounter
with a synchronized wrapper
instance.
public static StaticCounter syncStaticCounter(StaticCounter pCounter)
StaticCounter
with a synchronized wrapper
instance.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |