|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.cilib.type.types.Numeric net.sourceforge.cilib.type.types.Long
public class Long
Constructor Summary | |
---|---|
Long()
Create an instance of Long. |
|
Long(long value)
Create an Long with the specified value. |
|
Long(Long copy)
Create a copy of the provided instance. |
|
Long(long lower,
long upper)
Create an instance of Long randomly initialised between lower
and upper . |
Method Summary | |
---|---|
int |
compareTo(Numeric other)
|
boolean |
equals(Object other)
Compare the specified object with this type for equality. |
boolean |
getBit()
Get the value of this Numeric. |
Long |
getClone()
Create a cloned copy of the current object and return it. |
int |
getInt()
Get the value of this Numeric. |
long |
getLong()
|
double |
getReal()
Get the value of this Numeric. |
String |
getRepresentation()
Get the type representation of this Long object as a string. |
int |
hashCode()
Return the value of the object itself. |
void |
randomize(Random random)
Apply a randomization using the provided Random . |
void |
readExternal(ObjectInput ois)
Read off the provided ObjectInput. |
void |
reset()
Reset the instance to a predefined state. |
void |
set(boolean value)
Set the value of the Numeric. |
void |
set(double value)
Set the value of the Numeric. |
void |
set(int value)
Set the value of the Numeric. |
void |
set(String value)
Set the value of the Numeric. |
void |
setBit(boolean value)
Set the bit value with the provided value. |
void |
setBit(String value)
Set the bit value with the provided value. |
void |
setInt(int value)
Set the integer value with the provided value. |
void |
setInt(String value)
Set the integer value with the provided value. |
void |
setLong(long value)
|
void |
setReal(double value)
Set the real value with the provided value. |
void |
setReal(String value)
Set the real value with the provided value. |
String |
toString()
|
void |
writeExternal(ObjectOutput oos)
Write this Long to the provided ObjectOutput. |
Methods inherited from class net.sourceforge.cilib.type.types.Numeric |
---|
getBounds, setBounds, setBounds |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Long()
public Long(long lower, long upper)
lower
and upper
.
lower
- The lower bound.upper
- The upper bound.public Long(long value)
value
- The value of the Long.public Long(Long copy)
copy
- The instance to copy.Method Detail |
---|
public Long getClone()
getClone
in interface Type
getClone
in interface Cloneable
getClone
in class Numeric
Object.clone()
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 Numeric
other
- The object to compare.
true
if equality exists, false
otherwise.Object.equals(Object)
public int hashCode()
Long.hashCode()
operates.
hashCode
in interface Type
hashCode
in class Numeric
Object.equals(Object)
,
Type.equals(Object)
public void set(String value)
set
in class Numeric
value
- The String value to be parsed.public void set(boolean value)
set
in class Numeric
value
- The boolean value representing the value for this Type.public void set(double value)
set
in class Numeric
value
- The double value representing the value for this Type.public void set(int value)
set
in class Numeric
value
- The int value representing the value for this Type.public boolean getBit()
getBit
in class Numeric
public void setBit(boolean value)
setBit
in class Numeric
value
- The value to set.public void setBit(String value)
setBit
in class Numeric
value
- The value to set.public void setLong(long value)
public long getLong()
public int getInt()
getInt
in class Numeric
public void setInt(int value)
setInt
in class Numeric
value
- The value to set.public void setInt(String value)
setInt
in class Numeric
value
- The value to set.public double getReal()
getReal
in class Numeric
public void setReal(double value)
setReal
in class Numeric
value
- The value to set.public void setReal(String value)
setReal
in class Numeric
value
- The value to set.public int compareTo(Numeric other)
compareTo
in interface Comparable<Numeric>
compareTo
in class Numeric
public void randomize(Random random)
Random
.
random
- The Random
to use for the randomization.public void reset()
public String toString()
toString
in class Object
public String getRepresentation()
getRepresentation
in class Numeric
public void writeExternal(ObjectOutput oos) throws IOException
oos
- The ObjectOutput to write on.
IOException
- If an error occurs during the write operation.public void readExternal(ObjectInput ois) throws IOException, ClassNotFoundException
ois
- The ObjectInput to read off.
IOException
- If an I/O error occurs.
ClassNotFoundException
- If the class to instantiate was not found.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |