public final class MAssocKey
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
|
MAssocKey()
Creates an empty MAssocKey.
|
protected |
MAssocKey(java.lang.Object[] parts) |
|
MAssocKey(java.lang.String s)
This constructor sets the key from the str argument.
|
Modifier and Type | Method and Description |
---|---|
MAssocKey |
append(MAssocKey key)
This method appends a MAssocKey to the end of this MAssocKey and
returns the new MAssocKey.
|
MAssocKey |
append(java.lang.String suffix)
Creates a new MAssocKey with the provided names appended to the end
of the parts of this MAssocKey.
|
boolean |
endsWith(MAssocKey suffix)
If the MAssocKey input parameter is the same as the last parts in
this MAssocKey true is returned.
|
boolean |
equals(java.lang.Object obj)
Returns true is all the parts in this MAssocKey are the same as those in
the MAssocKey input parameter.
|
int |
indexAt(int pos)
Returns the name counter at the specified location in the
MAssocKey.
|
boolean |
isEmpty()
Check if the MAssocKey is empty.
|
java.lang.String |
lastName()
Returns the last name in the MAssocKey.
|
int |
length()
Returns the number of parts in the MAssocKey.
|
java.lang.String |
nameAt(int pos)
Returns the name at the specified location in the MAssocKey.
|
MAssocKey |
prepend(java.lang.String prefix)
Creates a new MAssocKey with the provided names prepended to the
beginning of the parts of this MAssocKey.
|
MAssocKey |
replace(int index,
java.lang.String newName)
Creates a new MAssocKey with the name of the part at the specified
index replaced with the new name.
|
MAssocKey |
replace(java.lang.String oldName,
java.lang.String newName)
Creates a new MAssocKey with all occurances of the oldName replaced
with the newName.
|
boolean |
startsWith(MAssocKey prefix)
If the parts MAssocKey input parameter is the same as the first
parts in this MAssocKey true is returned.
|
boolean |
startsWith(MAssocKey prefix,
int offset)
If the MAssocKey input parameter is the same as the first parts in
this MAssocKey starting from the offset true is returned.
|
MAssocKey |
subKey(int start)
Creates a new MAssocKey that is a subset of this MAssocKey.
|
MAssocKey |
subKey(int start,
int end)
Creates a new MAssocKey that is a subset of this MAssocKey.
|
java.lang.String |
toString()
Returns a string representation of the Object.
|
public MAssocKey()
public MAssocKey(java.lang.String s)
s
- the String to be parsed into a keyprotected MAssocKey(java.lang.Object[] parts)
public boolean startsWith(MAssocKey prefix)
prefix
- the prefixpublic boolean startsWith(MAssocKey prefix, int offset)
prefix
- the prefixoffset
- where to begin looking for the prefixpublic boolean endsWith(MAssocKey suffix)
suffix
- the suffixpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the MAssocKey to compare this one topublic MAssocKey subKey(int start)
start
- the first name of this MAssocKey to use in the new MAssocKeypublic MAssocKey subKey(int start, int end)
start
- the first part of this MAssocKey to use in the new MAssocKeyend
- the last part to be usedjava.lang.IndexOutOfBoundsException
- if the beginIndex
or the endIndex
is out of range.public MAssocKey replace(java.lang.String oldName, java.lang.String newName)
oldName
- target for replacementnewName
- name to replace the oldName withpublic MAssocKey replace(int index, java.lang.String newName)
newName
- name to replace the oldName withindex
- location of the name to replacepublic MAssocKey prepend(java.lang.String prefix)
prefix
- string to add to the beginning of the new keypublic MAssocKey append(java.lang.String suffix)
suffix
- string to add to the end of the new keypublic MAssocKey append(MAssocKey key)
key
- the MAssocKey to add to the end of this MAssocKeypublic int length()
public java.lang.String nameAt(int pos)
pos
- the position in the MAssocKeyjava.lang.IndexOutOfBoundsException
- if the pos
is out
of range.public int indexAt(int pos)
pos
- the position in the MAssocKeyjava.lang.IndexOutOfBoundsException
- if the pos
is out
of range.public final java.lang.String lastName()
public final boolean isEmpty()
public java.lang.String toString()
toString
in class java.lang.Object