|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.lasalle.redmond.IDs.Id
public class Id
Field Summary | |
---|---|
protected int |
secret
|
Constructor Summary | |
---|---|
Id()
Creates a new instance of Id |
|
Id(int len)
Creates a new ranom instance of Id - given a length of Id assumes no check digit |
|
Id(int len,
boolean check)
Creates a new ranom instance of Id - given a length of Id and whether a check digit is desired assumes no check digit |
|
Id(java.lang.String str)
Creates a new instance of Id - given a string |
Method Summary | |
---|---|
char |
addCheckDigit()
change id to add a check digit to the string |
boolean |
checkCheckDigit()
Check to see if an Id has a proper check digit |
int |
compareTo(java.lang.Object obj)
Compares two Ids - needed for sorting - required since implements Comparable interface returns negative if object comparing to is less, zero if object comparing to is equal, positive if object comparing to is greater |
boolean |
equals(Id toCompare)
determine if a passed Id has the same contents as the calling object (Id number, required length, AND check digit) |
boolean |
equals(java.lang.Object toCompare)
determine if a passed Id has the same contents as the calling object (Id number, required length, AND check digit) Overrides version in java.lang.Object |
static char |
generateCheckDigit(java.lang.String basicPart)
Generate a check digit based on a given "rest" of an ID |
static java.lang.String |
genRandomValidId()
generate a random account number Length is not specified - make 4 digits by default |
static java.lang.String |
genRandomValidId(int len)
generate a random account number Length is specified |
boolean |
getCheckDig()
report whether id has a check digit |
java.lang.String |
getId()
report actual id string |
int |
getLength()
report actual current id string length |
int |
getRequiredLen()
report desired id string length |
void |
setCheckDig(boolean check)
change whether id has a check digit |
void |
setId(java.lang.String str)
change actual id string |
boolean |
setRequiredLen(int len)
change desired id string length |
java.lang.String |
toShortString()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int secret
Constructor Detail |
---|
public Id()
public Id(java.lang.String str)
public Id(int len)
public Id(int len, boolean check)
Method Detail |
---|
public static java.lang.String genRandomValidId()
public static java.lang.String genRandomValidId(int len)
public static char generateCheckDigit(java.lang.String basicPart)
public boolean checkCheckDigit()
public java.lang.String getId()
public boolean getCheckDig()
public int getRequiredLen()
public int getLength()
public void setId(java.lang.String str)
public void setCheckDig(boolean check)
public boolean setRequiredLen(int len)
public char addCheckDigit()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toShortString()
public boolean equals(Id toCompare)
public boolean equals(java.lang.Object toCompare)
equals
in class java.lang.Object
public int compareTo(java.lang.Object obj)
compareTo
in interface java.lang.Comparable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |