public interface DataCollection
extends com.highdeal.hci.XMLMarshallable
Java interface represents a data collection that is processed by a running Import/Export Connector (IEC) application
accordingly to your customized JavaTask;
Data is mapped with keys.
For better performance, the interface provides some methods that
allow the collection to be reused to limit the count of the
instance creation.
An instance of the DataCollection class is a set of pairs (key, value)
in which the value can be a Boolean, string, date or number.
A key is unique, but two keys can have the same value.
Example
The keys k1 and k2 can have the value TRUE that is a Boolean.
Resource| Modifier and Type | Method and Description |
|---|---|
void |
addAll(java.util.Map<java.lang.String,java.lang.Object> props)
Adds the objects of the specified properties to this collection.
|
void |
clear()
Clears the data collection so that it contains no key and UID.
|
void |
decant(DataCollection collectionToFill)
This method decants its members in the specified collectionToFill.
|
boolean |
equalsDC(DataCollection dc)
Compares to the specified data collection, property by property.
|
java.lang.Object |
get(java.lang.String key)
Searches for an Object with the specified key in this collection.
|
java.lang.Boolean |
getBoolean(java.lang.String key)
Searches for a Boolean with the specified key in this data collection.
|
long |
getCreationNumber()
Returns the creation number of the DataCollection.
|
java.util.Date |
getDate(java.lang.String key)
Searches for a Date with the specified key in this collection.
|
java.util.Map<java.lang.String,java.lang.Object> |
getMap()
Returns a map that contains the keys and the values.
|
java.math.BigDecimal |
getNumber(java.lang.String key)
Searches for a Number with the specified key in this data collection.
|
Resource |
getResource(java.lang.String key)
Searches for a
resource with the specified key in this collection. |
java.lang.String |
getString(java.lang.String key)
Searches for a String with the specified key in this collection.
|
java.lang.String |
getUID()
Returns the UID of the DataCollection.
|
boolean |
isReusable()
|
java.util.Set<java.lang.String> |
keys()
Returns all the keys of the collection.
|
void |
set(java.lang.String key,
java.lang.Object data)
Maps the specified key to the specified Object in this collection;
The Object can be retrieved by calling the
get(java.lang.String) method
with a key that is equal to the original key. |
void |
setBoolean(java.lang.String key,
java.lang.Boolean data)
Maps the specified key to the specified Boolean in this data collection;
The Boolean can be retrieved by calling the
getBoolean(java.lang.String) method
with a key that is equal to the original key. |
void |
setCreationNumber(long number)
Sets the creation number of the DataCollection.
|
void |
setDate(java.lang.String key,
java.util.Date data)
Maps the specified key to the specified Date in this collection;
The Date can be retrieved by calling the
getDate(java.lang.String) method
with a key that is equal to the original key. |
void |
setNumber(java.lang.String key,
java.math.BigDecimal data)
Maps the specified key to the specified BigDecimal in this collection;
The BigDecimal can be retrieved by calling the
getNumber(java.lang.String) method
with a key that is equal to the original key. |
void |
setResource(java.lang.String key,
Resource data)
Maps the specified key to the
specified resource in this data collection;
The resource can be retrieved by calling the getResource(java.lang.String) method
with a key that is equal to the original key. |
void |
setReusable(boolean flag)
Sets the DataCollection reusable.
|
void |
setString(java.lang.String key,
java.lang.String data)
Maps the specified key to the specified String in this collection;
The String can be retrieved by calling the
getString(java.lang.String) method
with a key that is equal to the original key. |
void |
setUID(java.lang.String uid)
Sets the UID of the DataCollection.
|
void setUID(java.lang.String uid)
java.lang.String getUID()
long getCreationNumber()
void setCreationNumber(long number)
java.lang.Boolean getBoolean(java.lang.String key)
null otherwisevoid setBoolean(java.lang.String key,
java.lang.Boolean data)
getBoolean(java.lang.String) method
with a key that is equal to the original key.key - The keydata - The valuejava.lang.String getString(java.lang.String key)
null otherwisevoid setString(java.lang.String key,
java.lang.String data)
getString(java.lang.String) method
with a key that is equal to the original key.key - The keydata - The valuejava.util.Date getDate(java.lang.String key)
null otherwisevoid setDate(java.lang.String key,
java.util.Date data)
getDate(java.lang.String) method
with a key that is equal to the original key.key - The keydata - The valuejava.math.BigDecimal getNumber(java.lang.String key)
null otherwisevoid setNumber(java.lang.String key,
java.math.BigDecimal data)
getNumber(java.lang.String) method
with a key that is equal to the original key.key - The keydata - The valueResource getResource(java.lang.String key)
resource with the specified key in this collection.resource in this collection with the specified key value if it exists, null otherwisevoid setResource(java.lang.String key,
Resource data)
specified resource in this data collection;
The resource can be retrieved by calling the getResource(java.lang.String) method
with a key that is equal to the original key.key - The keydata - The valuejava.lang.Object get(java.lang.String key)
null otherwisevoid set(java.lang.String key,
java.lang.Object data)
get(java.lang.String) method
with a key that is equal to the original key.key - The keydata - The valuejava.util.Set<java.lang.String> keys()
void setReusable(boolean flag)
boolean isReusable()
true if this instance of DataCollection is no more shared by threads, false otherwise.
If it is the case, you can reset the collection instance and reuse it without any problems.
This is very useful for multithreaded processes.void decant(DataCollection collectionToFill)
Note
This instance should not use its members.
collectionToFill - The target data collectionvoid clear()
boolean equalsDC(DataCollection dc)
java.util.Map<java.lang.String,java.lang.Object> getMap()
void addAll(java.util.Map<java.lang.String,java.lang.Object> props)
props - The properties from which the objects are extracted