public class HCounter
extends java.lang.Object
Constructor and Description |
---|
HCounter()
Create a default counter
|
HCounter(int init)
Create a counter starting at a specified integer
|
HCounter(int[] init)
Create a counter starting at the specified location
|
Modifier and Type | Method and Description |
---|---|
boolean |
after(java.lang.String input)
IS the current value after (or equal to) this input?
|
boolean |
before(java.lang.String input)
Is the current value before (or equal to) this input?
|
int |
compare(java.lang.String input)
Does the given string come before or after the current
value.
|
void |
down()
Add a new level to the counter hierarchy starting at 1.
|
void |
down(int i)
Add a new level to the counter hierarcy starting at a specified value.
|
void |
increment()
Increment the deepest level of the counter
|
void |
increment(int level)
Increment a specific level of the counter.
|
int |
levels()
How many levels in the hierarchy currently in the counter?
|
static void |
main(java.lang.String[] args)
Run some simple tests.
|
java.lang.String |
toString()
What is the current value of the counter expressed as a string?
|
void |
up()
Discard a level in the hierarchy.
|
public HCounter()
public HCounter(int init)
public HCounter(int[] init)
public int levels()
public java.lang.String toString()
toString
in class java.lang.Object
public void increment()
public void increment(int level)
level
- public void down()
public void down(int i)
public void up()
public boolean before(java.lang.String input)
public boolean after(java.lang.String input)
public int compare(java.lang.String input)
public static void main(java.lang.String[] args)