Package org.jboss.util
Class LongCounter.Wrapper
- java.lang.Object
-
- org.jboss.util.LongCounter
-
- org.jboss.util.LongCounter.Wrapper
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
- Enclosing class:
- LongCounter
private static class LongCounter.Wrapper extends LongCounter
Base wrapper class for other wrappers.
-
-
Field Summary
Fields Modifier and Type Field Description protected LongCounter
counter
The wrapped counterprivate static long
serialVersionUID
The serialVersionUID
-
Constructor Summary
Constructors Constructor Description Wrapper(LongCounter counter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone()
Return a cloned copy of this object.long
decrement()
Decrement the counter.boolean
equals(java.lang.Object obj)
Check if the given object is equal to this.long
getCount()
Return the current value of the counter.long
increment()
Increment the counter.void
reset()
Reset the counter to zero.java.lang.String
toString()
Return a string representation of this.-
Methods inherited from class org.jboss.util.LongCounter
makeDirectional, makeSynchronized
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
The serialVersionUID- See Also:
- Constant Field Values
-
counter
protected final LongCounter counter
The wrapped counter
-
-
Constructor Detail
-
Wrapper
public Wrapper(LongCounter counter)
-
-
Method Detail
-
increment
public long increment()
Description copied from class:LongCounter
Increment the counter. (Optional operation)- Overrides:
increment
in classLongCounter
- Returns:
- The incremented value of the counter.
-
decrement
public long decrement()
Description copied from class:LongCounter
Decrement the counter. (Optional operation)- Overrides:
decrement
in classLongCounter
- Returns:
- The decremented value of the counter.
-
getCount
public long getCount()
Description copied from class:LongCounter
Return the current value of the counter.- Overrides:
getCount
in classLongCounter
- Returns:
- The current value of the counter.
-
reset
public void reset()
Description copied from class:LongCounter
Reset the counter to zero. (Optional operation)- Overrides:
reset
in classLongCounter
-
equals
public boolean equals(java.lang.Object obj)
Description copied from class:LongCounter
Check if the given object is equal to this.- Overrides:
equals
in classLongCounter
- Parameters:
obj
- Object to test equality with.- Returns:
- True if object is equal to this.
-
toString
public java.lang.String toString()
Description copied from class:LongCounter
Return a string representation of this.- Overrides:
toString
in classLongCounter
- Returns:
- A string representation of this.
-
clone
public java.lang.Object clone()
Description copied from class:LongCounter
Return a cloned copy of this object.- Overrides:
clone
in classLongCounter
- Returns:
- A cloned copy of this object.
-
-