|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Interface for a combination belonging to a combination lock.
| Method Summary | |
boolean |
equals(Combination otherCombo)
tests whether two combinations are the same |
int |
getInt()
get the combination as an integer |
java.lang.String |
getString()
get the combination as a String |
void |
setInt(int newCombo)
set the combination using an integer |
void |
setString(java.lang.String newCombo)
set the combination using a string |
java.lang.String |
toString()
provide a string representation of this object |
| Method Detail |
public int getInt()
public java.lang.String getString()
public void setInt(int newCombo)
throws OutOfBounds
newCombo - the combination represented by an integer
OutOfBounds - if the integer is not in the range 0 to 999
public void setString(java.lang.String newCombo)
throws OutOfBounds,
java.lang.NumberFormatException
newCombo - the combination represented by a String
java.lang.NumberFormatException - thrown by Integer.parseInt if the String cannot be parsed to an integer (you do not need to throw this in your code)
OutOfBounds - if the String represents a number not in the range 0 to 999public boolean equals(Combination otherCombo)
otherCombo - the Combination object to compare with this one
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||