Package ro.sync.ecss.css
Class CSSCounter
java.lang.Object
ro.sync.ecss.css.CSSCounter
- All Implemented Interfaces:
Cloneable
A CSS counter identified by it's name.
-
Constructor Summary
ConstructorsConstructorDescriptionCSSCounter(String name) Constructor.CSSCounter(String name, int defaultValue) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionclone()Clones this counter.booleangetName()intgetValue()inthashCode()voidincrement(int increment) Increment the counter.voidincrement(int increment, boolean ignoreNextIncremenet) Increment the counter.voidreset()Reset the counter to the initial value.voidsetDefaultValue(int defValue) toString()
-
Constructor Details
-
CSSCounter
Constructor.- Parameters:
name- The name of the counter.
-
CSSCounter
Constructor.- Parameters:
name- The name of the counter.defaultValue- The default value.
-
-
Method Details
-
increment
public void increment(int increment, boolean ignoreNextIncremenet) Increment the counter.- Parameters:
increment- The increment value.ignoreNextIncremenet-truewhen 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
- Returns:
- The counter name.
-
toString
-
setDefaultValue
public void setDefaultValue(int defValue) - Parameters:
defValue- A default value to be used both as initial and current values.
-
equals
-
hashCode
public int hashCode() -
clone
Clones this counter.- Overrides:
clonein classObject- Throws:
CloneNotSupportedException- See Also:
-