java.lang.ObjectFamousName
public class FamousName
FamousName is the first name of a famous person. It is a special kind of string of length > 1 that contains only uppercase alphabetic characters.
Constructor Summary | |
---|---|
FamousName()
Construct an empty name. |
|
FamousName(java.lang.String rawname)
Construct a FamousName from a string. |
Method Summary | |
---|---|
int |
compareTo(FamousName val)
Compares this FamousName with the provided FamousName. |
boolean |
equals(java.lang.Object other)
Compare two FamousNames for equality. |
static boolean |
isLegalName(java.lang.String rawname)
Determine if a string is a legal name. |
java.lang.String |
toString()
Return a string representation of this FamousName |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FamousName()
public FamousName(java.lang.String rawname)
rawname
- a String to be assigned to this FamousNameMethod Detail |
---|
public static boolean isLegalName(java.lang.String rawname)
rawname
- a string to be evaluated for validity
public int compareTo(FamousName val)
val
- FamousName to which this FamousName is to be compared.
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
other
- the other name to be compared
public java.lang.String toString()
toString
in class java.lang.Object