Hashtable indexed collection formatters

Some database services in the toolkit also use another specific format, HashtableIndexedCollectionFormat, to update the context when the result of a query to the database is a set of records. The HashtableIndexedCollectionFormat provides only the unformatting process, which is similar to that of the IndexedCollectionFormat. The difference is that in the case of the IndexedCollectionFormat, the unformatting process receives a string and builds an indexed collection of data elements, while in the case of the HashtableIndexedCollection, it receives a Vector of Hashtables and unformats it into an indexed collection of keyed collections. The HashtableIndexedCollectionFormat uses the HashtableFormat to unformat each Hashtable of the vector. The following is an example of the HashtableIndexedCollectionFormat in the formats definition file:
<fmtDef id="myHashtableIndexedCollectionFormat">
    <hashtableIColl dataName=resultSet times=*> 
        <hashtable dataName=rowStructure>
            <fObject dataName ="data_name_1"/>
            <fObject dataName = "data_name_2"/>
            ...........
            <fObject dataName = "data_name_n"/>
        </hashtable>
    </hashtableIColl>
</fmtDef>

Inside the definition of a HashtableIndexedCollectionFormat there is the definition of a HashtableFormat, which is the format element to be used to unformat the Hashtable elements of the vector.

The tag attributes dataName and times are used in the same way as in the IndexedCollectionFormat. The followings are the sample code to use HashtableIndexedCollectionFormat through the CHA Formatter Service:

com.ibm.btt.formatter.client.FormatElement afmt = new com.ibm.btt.client.FormatElement();
afmt.setName("myHashtableIndexedCollectionFormat");
afmt.unformatIndexedCollection(aVector,aContext); 
afmt.unformatIndexedCollection(aVector,anIndexedCollection);

If a toolkit application presentation layer entity or client entity needs to access the HashtableIndexedCollectionFormat, use the following code to access the formatter directly:

com.ibm.dse.base.HashtableIndexedCollectionFormat aFmt = (com.ibm.dse.base.HashtableIndexedCollectionFormat)FormatElement.readObject("FormatName");
afmt.unformat(aVector,aContext);
afmt.unformatIndexedCollection(aVector,anIndexedCollection);