Package com.highdeal.iec
Interface DataCollection
- All Superinterfaces:
com.highdeal.hci.XMLMarshallable
public interface DataCollection
extends com.highdeal.hci.XMLMarshallable
This
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.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the objects of the specified properties to this collection.voidclear()Clears the data collection so that it contains no key and UID.voiddecant(DataCollection collectionToFill) This method decants its members in the specified collectionToFill.booleanCompares to the specified data collection, property by property.Searches for an Object with the specified key in this collection.getBoolean(String key) Searches for a Boolean with the specified key in this data collection.longReturns the creation number of the DataCollection.Searches for a Date with the specified key in this collection.getMap()Returns a map that contains the keys and the values.Searches for a Number with the specified key in this data collection.getResource(String key) Searches for aresourcewith the specified key in this collection.Searches for a String with the specified key in this collection.getUID()Returns the UID of the DataCollection.booleankeys()Returns all the keys of the collection.voidMaps the specified key to the specified Object in this collection; The Object can be retrieved by calling theget(java.lang.String)method with a key that is equal to the original key.voidsetBoolean(String key, Boolean data) Maps the specified key to the specified Boolean in this data collection; The Boolean can be retrieved by calling thegetBoolean(java.lang.String)method with a key that is equal to the original key.voidsetCreationNumber(long number) Sets the creation number of the DataCollection.voidMaps the specified key to the specified Date in this collection; The Date can be retrieved by calling thegetDate(java.lang.String)method with a key that is equal to the original key.voidsetNumber(String key, BigDecimal data) Maps the specified key to the specified BigDecimal in this collection; The BigDecimal can be retrieved by calling thegetNumber(java.lang.String)method with a key that is equal to the original key.voidsetResource(String key, Resource data) Maps the specified key to thespecified resourcein this data collection; The resource can be retrieved by calling thegetResource(java.lang.String)method with a key that is equal to the original key.voidsetReusable(boolean flag) Sets the DataCollection reusable.voidMaps the specified key to the specified String in this collection; The String can be retrieved by calling thegetString(java.lang.String)method with a key that is equal to the original key.voidSets the UID of the DataCollection.Methods inherited from interface com.highdeal.hci.XMLMarshallable
addCharacterData, addChild, marshal, setAttributes
-
Method Details
-
setUID
Sets the UID of the DataCollection. -
getUID
String getUID()Returns the UID of the DataCollection. -
getCreationNumber
long getCreationNumber()Returns the creation number of the DataCollection. -
setCreationNumber
void setCreationNumber(long number) Sets the creation number of the DataCollection. -
getBoolean
Searches for a Boolean with the specified key in this data collection.- Returns:
- The Boolean in this collection with the specified key value if it exists,
nullotherwise
-
setBoolean
Maps the specified key to the specified Boolean in this data collection; The Boolean can be retrieved by calling thegetBoolean(java.lang.String)method with a key that is equal to the original key.- Parameters:
key- The keydata- The value
-
getString
Searches for a String with the specified key in this collection.- Returns:
- The String in this collection with the specified key value if it exists,
nullotherwise
-
setString
Maps the specified key to the specified String in this collection; The String can be retrieved by calling thegetString(java.lang.String)method with a key that is equal to the original key.- Parameters:
key- The keydata- The value
-
getDate
Searches for a Date with the specified key in this collection.- Returns:
- The Date in this collection with the specified key value if it exists,
nullotherwise
-
setDate
Maps the specified key to the specified Date in this collection; The Date can be retrieved by calling thegetDate(java.lang.String)method with a key that is equal to the original key.- Parameters:
key- The keydata- The value
-
getNumber
Searches for a Number with the specified key in this data collection.- Returns:
- The Number in this collection with the specified key value if it exists,
nullotherwise
-
setNumber
Maps the specified key to the specified BigDecimal in this collection; The BigDecimal can be retrieved by calling thegetNumber(java.lang.String)method with a key that is equal to the original key.- Parameters:
key- The keydata- The value
-
getResource
Searches for aresourcewith the specified key in this collection.- Returns:
- The
resourcein this collection with the specified key value if it exists,nullotherwise
-
setResource
Maps the specified key to thespecified resourcein this data collection; The resource can be retrieved by calling thegetResource(java.lang.String)method with a key that is equal to the original key.- Parameters:
key- The keydata- The value
-
get
Searches for an Object with the specified key in this collection.- Returns:
- The Object in this collection with the specified key value if it exists,
nullotherwise
-
set
Maps the specified key to the specified Object in this collection; The Object can be retrieved by calling theget(java.lang.String)method with a key that is equal to the original key.- Parameters:
key- The keydata- The value
-
keys
Returns all the keys of the collection. -
setReusable
void setReusable(boolean flag) Sets the DataCollection reusable. -
isReusable
boolean isReusable()Returnstrueif this instance ofDataCollectionis no more shared by threads,falseotherwise. If it is the case, you can reset the collection instance and reuse it without any problems. This is very useful for multithreaded processes. -
decant
This method decants its members in the specified collectionToFill.Note
This instance should not use its members.
- Parameters:
collectionToFill- The target data collection
-
clear
void clear()Clears the data collection so that it contains no key and UID. -
equalsDC
Compares to the specified data collection, property by property. -
getMap
Returns a map that contains the keys and the values. -
addAll
Adds the objects of the specified properties to this collection.- Parameters:
props- The properties from which the objects are extracted
-