public final class SerialArithmeticNumber extends Object implements Comparable<Integer>
| Constructor and Description |
|---|
SerialArithmeticNumber()
Default constructor to create a new, empty
SerialArithmeticNumber instance, which is
initialized to 0. |
SerialArithmeticNumber(int startValue)
Constructor to create a new
SerialArithmeticNumber instance,
which is initialized to startValue. |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(int anotherSerialNumber)
Same as the
compareTo method only with the exception of
another parameter type. |
int |
compareTo(Integer anotherSerialNumber) |
int |
getValue()
Returns the current value of this
SerialArithmeticNumber instance. |
void |
increment()
Increments the value of this
SerialArithmeticNumber instance. |
void |
setValue(int newValue)
Updates the value of this
SerialArithmeticNumber instance to
the given one. |
public SerialArithmeticNumber()
SerialArithmeticNumber instance, which is
initialized to 0.public SerialArithmeticNumber(int startValue)
SerialArithmeticNumber instance,
which is initialized to startValue.startValue - The start value.public final int compareTo(int anotherSerialNumber)
compareTo method only with the exception of
another parameter type.anotherSerialNumber - The number to compare with.SerialArithmeticNumber is
less than, equal to, or
greater than the given number.public final int compareTo(Integer anotherSerialNumber)
compareTo in interface Comparable<Integer>public final int getValue()
SerialArithmeticNumber instance.SerialArithmeticNumber instance.public final void increment()
SerialArithmeticNumber instance.public final void setValue(int newValue)
SerialArithmeticNumber instance to
the given one.newValue - The new value.Copyright © 2013 University of Konstanz, Distributed Systems Group. All Rights Reserved.