Package com.sun.solaris.service.pools
Class Value
- java.lang.Object
-
- com.sun.solaris.service.pools.Value
-
public class Value extends java.lang.Object
TheValue
class represents a pools value.
-
-
Constructor Summary
Constructors Constructor Description Value(java.lang.String name)
ConstructorValue(java.lang.String name, boolean value)
ConstructorValue(java.lang.String name, double value)
ConstructorValue(java.lang.String name, long value)
ConstructorValue(java.lang.String name, long value, boolean s)
ConstructorValue(java.lang.String name, java.lang.String value)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Explicitly reclaim the memory (if not locked) allocated for this value by the C proxy.protected void
finalize()
Reclaim the memory allocated for this value by the C proxy.boolean
getBool()
Returns the value as a boolean.double
getDouble()
Returns the value as a double.long
getLong()
Returns the value as a long.java.lang.String
getName()
Returns the name of the value.java.lang.String
getString()
Returns the value as a String.int
getType()
Returns the type of this object.UnsignedInt64
getUnsignedInt64()
Returns the value as a UnsignedInt64.long
getValue()
Returns the pointer to the native value represented by this object.boolean
islocked()
Check whether the value is locked or notvoid
lock()
Lock the valuevoid
setName(java.lang.String name)
Name this value.void
setValue(boolean value)
Set this value to take the supplied boolean value.void
setValue(double value)
Set this value to take the supplied double value.void
setValue(long value)
Set this value to take the supplied signed long value.void
setValue(long value, boolean s)
Set this value to take the supplied long value.void
setValue(java.lang.String value)
Set this value to take the supplied string value.java.lang.String
toString()
Returns a string representation of this value.void
unlock()
Unlock the value
-
-
-
Constructor Detail
-
Value
public Value(java.lang.String name) throws PoolsException
Constructor- Parameters:
name
- The name of the value.- Throws:
PoolsException
- If there is an error whilst allocating the value.
-
Value
public Value(java.lang.String name, long value) throws PoolsException
Constructor- Parameters:
name
- The name of the value.value
- The value of the value.- Throws:
PoolsException
- If there is an error whilst allocating the value.
-
Value
public Value(java.lang.String name, long value, boolean s) throws PoolsException
Constructor- Parameters:
name
- The name of the value.value
- The value of the value.s
- Indicates if the value is signed or not.- Throws:
PoolsException
- If there is an error whilst allocating the value.
-
Value
public Value(java.lang.String name, java.lang.String value) throws PoolsException
Constructor- Parameters:
name
- The name of the value.value
- The value of the value.- Throws:
PoolsException
- If there is an error whilst allocating the value.
-
Value
public Value(java.lang.String name, boolean value) throws PoolsException
Constructor- Parameters:
name
- The name of the value.value
- The value of the value.- Throws:
PoolsException
- If there is an error whilst allocating the value.
-
Value
public Value(java.lang.String name, double value) throws PoolsException
Constructor- Parameters:
name
- The name of the value.value
- The value of the value.- Throws:
PoolsException
- If there is an error whilst allocating the value.
-
-
Method Detail
-
islocked
public boolean islocked() throws PoolsException
Check whether the value is locked or not- Returns:
- returns the value of _locked
- Throws:
PoolsException
-
lock
public void lock() throws PoolsException
Lock the value- Throws:
PoolsException
-
unlock
public void unlock() throws PoolsException
Unlock the value- Throws:
PoolsException
-
close
public void close()
Explicitly reclaim the memory (if not locked) allocated for this value by the C proxy.
-
finalize
protected void finalize() throws java.lang.Throwable
Reclaim the memory allocated for this value by the C proxy.- Overrides:
finalize
in classjava.lang.Object
- Throws:
java.lang.Throwable
- If freeing this configuration fails.
-
setName
public void setName(java.lang.String name)
Name this value.- Parameters:
name
- The name to set for this value.
-
setValue
public void setValue(long value)
Set this value to take the supplied signed long value.- Parameters:
value
- The value to which this value should be set.
-
setValue
public void setValue(long value, boolean s)
Set this value to take the supplied long value.- Parameters:
value
- The value to which this value should be set.s
- Is the value signed or unsigned.
-
setValue
public void setValue(java.lang.String value) throws PoolsException
Set this value to take the supplied string value.- Parameters:
value
- The value to which this value should be set.- Throws:
PoolsException
- If the setting of the value fails.
-
setValue
public void setValue(boolean value)
Set this value to take the supplied boolean value.- Parameters:
value
- The value to which this value should be set.
-
setValue
public void setValue(double value)
Set this value to take the supplied double value.- Parameters:
value
- The value to which this value should be set.
-
getName
public java.lang.String getName()
Returns the name of the value.- Returns:
- the name of the value.
-
getValue
public long getValue()
Returns the pointer to the native value represented by this object.- Returns:
- the pointer to the native value represented by this object.
-
getType
public int getType()
Returns the type of this object.- Returns:
- the type of this object.
-
toString
public java.lang.String toString()
Returns a string representation of this value.- Overrides:
toString
in classjava.lang.Object
- Returns:
- a string representation of this value.
-
getUnsignedInt64
public final UnsignedInt64 getUnsignedInt64() throws PoolsException
Returns the value as a UnsignedInt64.- Returns:
- the value as a UnsignedInt64.
- Throws:
PoolsException
- if the value is not an UnsignedInt64.
-
getLong
public final long getLong() throws PoolsException
Returns the value as a long.- Returns:
- the value as a long.
- Throws:
PoolsException
- if the value is not a long.
-
getString
public final java.lang.String getString() throws PoolsException
Returns the value as a String.- Returns:
- the value as a String.
- Throws:
PoolsException
- if the value is not a String.
-
getBool
public final boolean getBool() throws PoolsException
Returns the value as a boolean.- Returns:
- the value as a boolean.
- Throws:
PoolsException
- if the value is not a boolean.
-
getDouble
public final double getDouble() throws PoolsException
Returns the value as a double.- Returns:
- the value as a double.
- Throws:
PoolsException
- if the value is not a double.
-
-