|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.cilib.type.types.StringType
public class StringType
Constructor Summary | |
---|---|
StringType()
Create an StringType instance, which is empty and uninitialised. |
|
StringType(String string)
Create an instance with the given string as the contents. |
|
StringType(StringType copy)
Copy constructor. |
Method Summary | |
---|---|
boolean |
equals(Object other)
Compare the specified object with this type for equality. |
StringType |
getClone()
Create a cloned copy of the current object and return it. |
String |
getString()
Get the contained string. |
int |
hashCode()
Returns the hash code value for this list. |
void |
readExternal(ObjectInput ois)
Read the contents from a given ObjectInput. |
void |
setString(String newString)
Set the contained String value. |
String |
toString()
|
void |
writeExternal(ObjectOutput oos)
Write the contents of the StringType to an ObjectOutput. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public StringType()
public StringType(String string)
string
- The string value to have.public StringType(StringType copy)
copy
- The instance to copy.Method Detail |
---|
public StringType getClone()
getClone
in interface Type
getClone
in interface Cloneable
Object.clone()
public String getString()
public void setString(String newString)
newString
- The value to be contained by the StringType.public boolean equals(Object other)
true
if and only if the specified object is also an instance
of the same type.
equals
in interface Type
equals
in class Object
other
- The object to compare.
true
if equality exists, false
otherwise.Object.equals(Object)
public int hashCode()
int hashCode = 7; Iterator<E> i = list.iterator(); while (i.hasNext()) { E obj = i.next(); hashCode = 31*hashCode + (obj==null ? 0 : obj.hashCode()); }This ensures that type1.equals(type2) implies that type1.hashCode()==type2.hashCode() for any two types, type1 and type2, as required by the general contract of
Object.hashCode()
.
hashCode
in interface Type
hashCode
in class Object
Object.equals(Object)
,
Type.equals(Object)
public String toString()
toString
in class Object
public void writeExternal(ObjectOutput oos) throws IOException
oos
- the ObjectOutput to write to.
IOException
- If an exception occurs.public void readExternal(ObjectInput ois) throws IOException, ClassNotFoundException
ois
- The ObjectInput to use.
IOException
- If an IO problem occurs.
ClassNotFoundException
- If the desired class is not found.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |