|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.io.SimpleStreamableObject
com.threerings.util.Name
public class Name
Contains the name of an entity. Provides a means by which names can be efficiently loosely compared rather than relying on humans to type things exactly or the challenge of inserting code to normalize names everywhere they are compared.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.threerings.io.Streamable |
|---|
Streamable.Closure |
| Field Summary | |
|---|---|
protected String |
_name
The raw name text. |
protected String |
_normal
The normalized name text. |
static Name |
BLANK
A blank name for use in situations where it is needed. |
| Constructor Summary | |
|---|---|
Name(String name)
Creates a name instance with the supplied name. |
|
| Method Summary | |
|---|---|
int |
compareTo(Name other)
|
boolean |
equals(Object other)
|
String |
getNormal()
Returns the normalized version of this name. |
int |
hashCode()
|
boolean |
isBlank()
Returns true if this name is blank, false if it contains data. |
static boolean |
isBlank(Name name)
Returns true if this name is null or blank, false if it contains useful data. |
boolean |
isValid()
Returns true if this name is valid. |
protected String |
normalize(String name)
Returns a normalized version of the supplied name. |
protected Integer |
overrideCompareTo(Name other)
Gives this name a chance to override the default comparison in a symmetric fashion. |
protected Boolean |
overrideEquals(Name other)
Gives this name a chance to override the default equality comparison in a symmetric fashion. |
String |
toString()
Returns the unprocessed name as a string. |
| Methods inherited from class com.threerings.io.SimpleStreamableObject |
|---|
toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Name BLANK
BLANK.equals(targetName).
protected String _name
protected transient String _normal
| Constructor Detail |
|---|
public Name(String name)
| Method Detail |
|---|
public static boolean isBlank(Name name)
public String getNormal()
public boolean isValid()
public boolean isBlank()
public String toString()
toString in class SimpleStreamableObjectpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object other)
equals in class Objectpublic int compareTo(Name other)
compareTo in interface Comparable<Name>protected String normalize(String name)
protected Boolean overrideEquals(Name other)
protected Integer overrideCompareTo(Name other)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||