com.meyling.principia.argument
Class Counter
java.lang.Object
|
+--com.meyling.principia.argument.AbstractArgument
|
+--com.meyling.principia.argument.AbstractArgumentAtom
|
+--com.meyling.principia.argument.Counter
- All Implemented Interfaces:
- Argument, CounterMarker
- public class Counter
- extends AbstractArgumentAtom
- implements Argument, CounterMarker
An object of this class represents a non negative integer.
- Version:
- $Revision 0.00.50$
- Author:
- Michael Meyling
|
Field Summary |
private int |
number
the plain number |
|
Constructor Summary |
Counter(int number)
Constructs a Number. |
| Methods inherited from class com.meyling.principia.argument.AbstractArgument |
containsPatternVariables, getHighestNumber, getPatternVariables, getReplacementParents, getSearchParents, hashCode, matches, matches, replace, replace, replace, replaceMatches |
| Methods inherited from interface com.meyling.principia.argument.Argument |
containsPatternVariables, create, getArgument, getArgumentSize, getPatternVariables, getReplacementParents, getSearchParents, hashCode, matches, matches, replace, replace, replace, replaceMatches |
number
private final int number
- the plain number
Counter
public Counter(int number)
throws ArgumentException
- Constructs a
Number.
- Parameters:
number - non negative integer (0 is ok)- Throws:
ArgumentException - if number < 0
getNumber
public final int getNumber()
- Get the number.
- Specified by:
getNumber in interface CounterMarker
- Returns:
- number
equals
public final boolean equals(Object object)
- Description copied from interface:
Argument
- Is this object equal to the given one? This is true iff
object is an instance of Argument and
both arguments have the same
Argument.getArgumentSize() and each Argument.getArgument(int) Argument.equals(java.lang.Object).
- Specified by:
equals in interface Argument- Overrides:
equals in class AbstractArgumentAtom
- Following copied from interface:
com.meyling.principia.argument.Argument
- Parameters:
object - to compare with- Returns:
- is
object equal to this one?
copy
public final Argument copy()
- Description copied from interface:
Argument
- Returns an identical object (maybe "this").
- Specified by:
copy in interface Argument- Overrides:
copy in class AbstractArgumentAtom
- Following copied from interface:
com.meyling.principia.argument.Argument
- Returns:
- copy of this object
toString
public final String toString()
- Description copied from interface:
Argument
- Get the argument in
String form.
- Specified by:
toString in interface Argument- Overrides:
toString in class AbstractArgumentAtom
- Following copied from interface:
com.meyling.principia.argument.Argument
- Returns:
- readable formula