Package com.sun.solaris.service.pools
Class Value
- java.lang.Object
-
- com.sun.solaris.service.pools.Value
-
public class Value extends java.lang.ObjectTheValueclass 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 voidclose()Explicitly reclaim the memory (if not locked) allocated for this value by the C proxy.protected voidfinalize()Reclaim the memory allocated for this value by the C proxy.booleangetBool()Returns the value as a boolean.doublegetDouble()Returns the value as a double.longgetLong()Returns the value as a long.java.lang.StringgetName()Returns the name of the value.java.lang.StringgetString()Returns the value as a String.intgetType()Returns the type of this object.UnsignedInt64getUnsignedInt64()Returns the value as a UnsignedInt64.longgetValue()Returns the pointer to the native value represented by this object.booleanislocked()Check whether the value is locked or notvoidlock()Lock the valuevoidsetName(java.lang.String name)Name this value.voidsetValue(boolean value)Set this value to take the supplied boolean value.voidsetValue(double value)Set this value to take the supplied double value.voidsetValue(long value)Set this value to take the supplied signed long value.voidsetValue(long value, boolean s)Set this value to take the supplied long value.voidsetValue(java.lang.String value)Set this value to take the supplied string value.java.lang.StringtoString()Returns a string representation of this value.voidunlock()Unlock the value
-
-
-
Constructor Detail
-
Value
public Value(java.lang.String name) throws PoolsExceptionConstructor- 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 PoolsExceptionConstructor- 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 PoolsExceptionConstructor- 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 PoolsExceptionConstructor- 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 PoolsExceptionConstructor- 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 PoolsExceptionConstructor- 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 PoolsExceptionCheck whether the value is locked or not- Returns:
- returns the value of _locked
- Throws:
PoolsException
-
lock
public void lock() throws PoolsExceptionLock the value- Throws:
PoolsException
-
unlock
public void unlock() throws PoolsExceptionUnlock 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.ThrowableReclaim the memory allocated for this value by the C proxy.- Overrides:
finalizein 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 PoolsExceptionSet 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:
toStringin 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 PoolsExceptionReturns 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 PoolsExceptionReturns 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 PoolsExceptionReturns 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 PoolsExceptionReturns the value as a double.- Returns:
- the value as a double.
- Throws:
PoolsException- if the value is not a double.
-
-