|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.pf.text.StringPair
public class StringPair
A simple pair of strings.
| Field Summary | |
|---|---|
static StringPair[] |
EMPTY_ARRAY
|
static int |
NULL_HASHCODE
Defines the hash code of instances that contain two null strings. |
| Constructor Summary | |
|---|---|
StringPair()
Initialize the new instance with default values. |
|
StringPair(IStringPair pair)
Initialize the new instance from the given string pair. |
|
StringPair(java.lang.String string)
Initialize the new instance with one string. |
|
StringPair(java.lang.String[] strings)
Initialize the new instance with two strings in an array. |
|
StringPair(java.lang.String s1,
java.lang.String s2)
Initialize the new instance with two strings. |
|
| Method Summary | |
|---|---|
java.lang.String[] |
asArray()
Returns both strings of this pair in a String array. |
java.lang.String |
asString(java.lang.String separator)
Returns the two strings as one string separated by the given separator. |
boolean |
equals(java.lang.Object obj)
Returns true if the given object is an IStringPair and its both strings are equal to the corresponding two strings of this object. |
java.lang.String |
getDefaultSeparator()
Returns the default separator (here ":"). |
java.lang.String |
getString1()
Returns the first string of this pair. |
java.lang.String |
getString2()
Returns the second string of this pair. |
int |
hashCode()
Returns a hash built over the two contained strings. |
void |
setString1(java.lang.String newValue)
Sets the first string to the given value. |
void |
setString2(java.lang.String newValue)
Sets the second string to the given value. |
java.lang.String |
toString()
Returns the two strings with the default separator in between. |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final StringPair[] EMPTY_ARRAY
public static final int NULL_HASHCODE
| Constructor Detail |
|---|
public StringPair()
public StringPair(java.lang.String string)
public StringPair(java.lang.String s1,
java.lang.String s2)
public StringPair(IStringPair pair)
public StringPair(java.lang.String[] strings)
java.lang.IllegalArgumentException - If the array does not contain exactly 2 elements.| Method Detail |
|---|
public java.lang.String getString1()
IStringPair
getString1 in interface IStringPairpublic void setString1(java.lang.String newValue)
IMutableStringPair
setString1 in interface IMutableStringPairnewValue - The new value (may be null).public java.lang.String getString2()
IStringPair
getString2 in interface IStringPairpublic void setString2(java.lang.String newValue)
IMutableStringPair
setString2 in interface IMutableStringPairnewValue - The new value (may be null).public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String[] asArray()
asArray in interface IStringPairpublic java.lang.String asString(java.lang.String separator)
asString in interface IStringPairseparator - A separator to be placed between the two strings.public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getDefaultSeparator()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||