|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sapia.archie.Name
public class Name
This interface provides an object reprentation of a "name". A Name is composed
of potentially multiple NameParts.
A Name instance is typically obtained from a string representation, using a
NameParser.
NamePart,
NameParser,
Serialized Form| Constructor Summary | |
|---|---|
|
Name()
|
protected |
Name(java.util.List parts)
|
| Method Summary | |
|---|---|
Name |
add(Name n)
|
Name |
add(NamePart part)
Adds a NamePart to this instance. |
Name |
addAt(int pos,
NamePart part)
|
NamePart |
chopFirst()
Chops the first part from this instance and returns it. |
NamePart |
chopLast()
Chops the last part from this instance and returns it. |
java.lang.Object |
clone()
|
int |
count()
Returns the number of NameParts in this name. |
boolean |
endsWith(Name other)
|
boolean |
equals(java.lang.Object o)
|
NamePart |
first()
Returns the first part in this name. |
NamePart |
get(int i)
Returns the NamePart at the given index. |
int |
getCurrentIndex()
Returns the internal iteration index. |
Name |
getFrom(int from)
Returns all the NameParts that this name holds, starting from the
given index (inclusively). |
Name |
getTo(int to)
Returns all the NameParts that this name holds, up to the
given index (exclusively). |
boolean |
hasNextPart()
Returns true if this instance has another
part to iterate on. |
NamePart |
last()
Returns the last part in this name. |
NamePart |
nextPart()
Iterates on the next NamePart. |
NamePart |
removeAt(int pos)
|
void |
reset()
Resets the internal iteration index. |
void |
setCurrentIndex(int i)
Sets the internal iteration index. |
boolean |
startsWith(Name other)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected Name(java.util.List parts)
public Name()
| Method Detail |
|---|
public int count()
NameParts in this name.
public int getCurrentIndex()
public void setCurrentIndex(int i)
i - an index.public void reset()
public boolean hasNextPart()
true if this instance has another
part to iterate on.
reset(),
getCurrentIndex(),
nextPart()public NamePart nextPart()
NamePart.
hasNextPart()public NamePart get(int i)
NamePart at the given index.
NamePart.public Name add(NamePart part)
NamePart to this instance.
part - a NamePart
public Name addAt(int pos,
NamePart part)
public NamePart removeAt(int pos)
public boolean endsWith(Name other)
public boolean startsWith(Name other)
public Name add(Name n)
n - adds the given Name to this instance (actually
appends the NameParts of the given name to this instance).
public Name getTo(int to)
NameParts that this name holds, up to the
given index (exclusively). Returns the NameParts in a Name
instance.
to - an upperbound index.
Name.public Name getFrom(int from)
NameParts that this name holds, starting from the
given index (inclusively). Returns the NameParts in a Name
instance.
from - a lowerbound index.
Name.public NamePart first()
NamePart.public NamePart last()
NamePart.public NamePart chopLast()
NamePart.public NamePart chopFirst()
NamePart.public java.lang.Object clone()
clone in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||