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 LongCountercounterThe wrapped counterprivate static longserialVersionUIDThe serialVersionUID
-
Constructor Summary
Constructors Constructor Description Wrapper(LongCounter counter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Return a cloned copy of this object.longdecrement()Decrement the counter.booleanequals(java.lang.Object obj)Check if the given object is equal to this.longgetCount()Return the current value of the counter.longincrement()Increment the counter.voidreset()Reset the counter to zero.java.lang.StringtoString()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:LongCounterIncrement the counter. (Optional operation)- Overrides:
incrementin classLongCounter- Returns:
- The incremented value of the counter.
-
decrement
public long decrement()
Description copied from class:LongCounterDecrement the counter. (Optional operation)- Overrides:
decrementin classLongCounter- Returns:
- The decremented value of the counter.
-
getCount
public long getCount()
Description copied from class:LongCounterReturn the current value of the counter.- Overrides:
getCountin classLongCounter- Returns:
- The current value of the counter.
-
reset
public void reset()
Description copied from class:LongCounterReset the counter to zero. (Optional operation)- Overrides:
resetin classLongCounter
-
equals
public boolean equals(java.lang.Object obj)
Description copied from class:LongCounterCheck if the given object is equal to this.- Overrides:
equalsin 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:LongCounterReturn a string representation of this.- Overrides:
toStringin classLongCounter- Returns:
- A string representation of this.
-
clone
public java.lang.Object clone()
Description copied from class:LongCounterReturn a cloned copy of this object.- Overrides:
clonein classLongCounter- Returns:
- A cloned copy of this object.
-
-