public class HCounter extends Object
Constructor | 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 | Description |
---|---|---|
boolean |
after(String input) |
IS the current value after (or equal to) this input?
|
boolean |
before(String input) |
Is the current value before (or equal to) this input?
|
int |
compare(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(String[] args) |
Run some simple tests.
|
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 String toString()
public void increment()
public void increment(int level)
level
- public void down()
public void down(int i)
public void up()
public boolean before(String input)
public boolean after(String input)
public int compare(String input)
public static void main(String[] args)