public final class NameHelpers
extends java.lang.Object
names
.Constructor and Description |
---|
NameHelpers() |
Modifier and Type | Method and Description |
---|---|
static Name |
append(Name _name1,
Name _name2)
Appends _name1 and _name2.
|
static Name |
append(Name _name1,
java.lang.String _id,
char _separator) |
static Name |
getPrefix(Name _name)
Returns the prefix of
_name . |
static Name |
getSuffix(Name _name)
Returns the suffix of
_name . |
static Name |
newName(java.lang.String _name,
char separator)
Creates a new name by parsing the provided string.
|
static Name |
newName(java.lang.String _id,
Name _subname)
|
static java.lang.String |
toString(Name _name,
char _separator) |
public static Name getSuffix(Name _name)
_name
.
If _name
may be represented as "a/b/c", with '/' as a separator,
then getSuffix returns "c".
_name
- a name;public static Name getPrefix(Name _name)
_name
.
If _name
may be represented as "a/b/c", with '/' as a separator,
then getPrefix returns "a/b".
_name
- a name;public static Name append(Name _name1, Name _name2)
_name1
- a name;_name2
- another name;public static java.lang.String toString(Name _name, char _separator)
public static Name newName(java.lang.String _id, Name _subname)
_id
- a String identifier;_subname
- a name;Name
, using _id
as identifier,
and _subname
as subname.public static Name newName(java.lang.String _name, char separator)
If separator == 0
, _name
is considered as a
simple identifier, and this call returns
.
If the name begins with the separator, the name is an absolute name (this
only makes sense if contexts with a tree structure); otherwise, the name is
relative.newName(_name,null)
_name
- a string representing a name;separator
- a separator to parse it.Name
.