What object types are to be declared for Collections.List.createArrayList() and for similar functions for Set, Iterator, Map, etc.?How to create a SortedSet?

What object types are to be declared for Collections.List.createArrayList() and for similar functions for Set, Iterator, Map, etc.?How to create a SortedSet?

book

Article ID: KB0090580

calendar_today

Updated On:

Products Versions
TIBCO BusinessEvents Enterprise Edition -
Not Applicable -

Description

Resolution:
Description:
==========
What object types are to be declared for Collections.List.createArrayList() and for similar functions for Set, Iterator, Map, etc.?
How to create a SortedSet?

Environment:
==========
TIBCO BusinessEvents 5.1.1

Resolution:
=========
Types to be declared for Collections.List.createArrayList() and for similar functions for  Set, Iterator, Map, etc, is Object.

To create a SortedSet, declare an Object and use Collections.Set.createTreeSet() to create a sorted set. Then work on the set Object using Collections.Set.* and Collections.SortedSet.* API functions.
For example:
Object sset = Collections.Set.createTreeSet();
for(int i=0; i&ltpbpart.PricebookBreaks@length;i=i+1){
        Collections.add(sset, pbpart.PricebookBreaks[i].quantity);
    }

Attachement:
===========
Attached a simple project that shows the usage of Collections.List.*(), Collections.iterator.*(), Collections.Map.*(), Collections.Set.*().

Issue/Introduction

What object types are to be declared for Collections.List.createArrayList() and for similar functions for Set, Iterator, Map, etc.?How to create a SortedSet?

Attachments

What object types are to be declared for Collections.List.createArrayList() and for similar functions for Set, Iterator, Map, etc.?How to create a SortedSet? get_app