Package ro.sync.ecss.css
Class CSSCounter
- java.lang.Object
-
- ro.sync.ecss.css.CSSCounter
-
- All Implemented Interfaces:
java.lang.Cloneable
@API(type=NOT_EXTENDABLE, src=PRIVATE) public class CSSCounter extends java.lang.Object implements java.lang.Cloneable
A CSS counter identified by it's name.
-
-
Constructor Summary
Constructors Constructor Description CSSCounter(java.lang.String name)
Constructor.CSSCounter(java.lang.String name, int defaultValue)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CSSCounter
clone()
Clones this counter.boolean
equals(java.lang.Object obj)
java.lang.String
getName()
int
getValue()
int
hashCode()
void
increment(int increment)
Increment the counter.void
increment(int increment, boolean ignoreNextIncremenet)
Increment the counter.void
reset()
Reset the counter to the initial value.void
setDefaultValue(int defValue)
java.lang.String
toString()
-
-
-
Method Detail
-
increment
public void increment(int increment, boolean ignoreNextIncremenet)
Increment the counter.- Parameters:
increment
- The increment value.ignoreNextIncremenet
-true
when the current counter is set to an element deleted with track changes, and the next increment should be ignored.
-
increment
public void increment(int increment)
Increment the counter.- Parameters:
increment
- The increment value.
-
reset
public void reset()
Reset the counter to the initial value.
-
getValue
public int getValue()
- Returns:
- The current value of the counter.
-
getName
public java.lang.String getName()
- Returns:
- The counter name.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- See Also:
Object.toString()
-
setDefaultValue
public void setDefaultValue(int defValue)
- Parameters:
defValue
- A default value to be used both as initial and current values.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
- See Also:
Object.equals(java.lang.Object)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
- See Also:
Object.hashCode()
-
clone
public CSSCounter clone() throws java.lang.CloneNotSupportedException
Clones this counter.- Overrides:
clone
in classjava.lang.Object
- Throws:
java.lang.CloneNotSupportedException
- See Also:
Object.clone()
-
-