18.2.11 Value interface
- Organization of this subsection
(1) Description
This interface represents values that are associated with keys and stored in the API methods that can be used in user functions.
(2) Interface name
com.hitachi.software.xeads.func.store.Value
(3) List of methods
The following table lists and describes the methods provided by the Value interface:
Method name |
Description |
---|---|
Acquires a value of the String type. |
|
Evaluates whether a specified object is a Value instance for this value. |
|
Acquires a value of the Object type. |
|
Acquires the size of the serialized value, which is in the internal format when a value is stored in a cache. |
(4) toString()
(a) Description
This method acquires a value of the String type.
This is the same character string as toString() of the Object class for the value of the Object type that is acquired by getObject()of the Value interface.
(b) Format
public String toString()
(c) Return value
This method returns a value of the String type.
(d) Notes
If getObject()of the Value interface fails due to a deserialization error, the method returns the same value as toString() of the Object class of the Value instance.
(5) equals()
(a) Description
This method evaluates whether a specified object is a Value instance for this value.
(b) Format
public boolean equals(Object obj)
(c) Parameters
- obj
-
Specifies the object to be compared.
(d) Return value
- true
-
The specified object is a Value instance for this value.
- false
-
The specified object is not a Value instance for the same value.
(e) Notes
The method determines that the objects are the same if their byte arrays obtained after serialization are the same.
(6) getObject()
(a) Description
This method acquires a value of the Object type.
(b) Format
public Object getObject() throws EADsStoreException
(c) Return value
This method returns a value of the Object type.
(d) Exceptions
-
UserOperationException (illegal user operation)
-
EADsStoreException (unexpected error)
(7) size()
(a) Description
This method acquires the size of the serialized value, which is in the internal format when a value is stored in a cache.
(b) Format
public int size()
(c) Return value
This method returns the size (in bytes) of the serialized value, which is in the internal format when a value is stored in a cache.
(d) Notes
This method returns the size of only the area that is used by the value when the value is stored.
Because other data might also be using this area when the value is stored, you can use the following API methods if you want to determine the size of the overall area in which the value is stored:
-
calcEHeapUsageSize() of the Store interface
-
calcDiskUsageSize() of the Store interface