Class Counter

java.lang.Object
  extended byCounter

public class Counter
extends java.lang.Object

This class is responsible for counter storage and creation.

Author:
Alexander Scheidl

Field Summary
private  java.lang.String name
          Name of the counter
private  int value
          This variable symbolizes the value of the counter
 
Constructor Summary
Counter()
          Creates a new instance of counter
Counter(java.lang.String name)
          Creates a new counter with a given name
 
Method Summary
 java.lang.String getName()
          method to get the name of the counter
 void increase()
          increase counter by value of 1
 void reset()
          reset value of counter to 0
 int stand()
          method gives you the current value of the counter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

value

private int value
This variable symbolizes the value of the counter

See Also:
Go to Code

name

private java.lang.String name
Name of the counter

See Also:
Go to Code
Constructor Detail

Counter

public Counter()
Creates a new instance of counter

See Also:
Go to Code

Counter

public Counter(java.lang.String name)
Creates a new counter with a given name

Parameters:
name - String with the name of the counter
See Also:
Go to Code
Method Detail

increase

public void increase()
increase counter by value of 1

See Also:
Go to Code

stand

public int stand()
method gives you the current value of the counter

Returns:
int with current value of the counter
See Also:
Go to Code

getName

public java.lang.String getName()
method to get the name of the counter

Returns:
String with the name of the counter
See Also:
Go to Code

reset

public void reset()
reset value of counter to 0

See Also:
Go to Code