MboSetEnumeration – A useful class to access an MboSet as an enumeration


I am sure many of us have not used this class.

Its very useful if you have an MboSet. It makes the code very clean and you dont have to do a loop till mboset.count()…..the normal way we access Mbo’s within an MboSet.

Class Description:

public class MboSetEnumeration
extends java.lang.Object

This class steps through a MboSet using the Enumeration interface. It starts at position 0 of the MboSet and steps through until the end.

It has just one constructor:

MboSetEnumeration(MboSetRemote msr)
Constructor takes the MboSet it will step through.

And, has the usual methods like:

boolean     hasMoreElements() Returns true if there is more elements in this enumeration.java.lang.Object     nextElement() Returns the next element in the enumeration.
MboRemote     nextMbo() A convience method for use in Mbo code, does the same thing as nextElement but returns the element as a MboRemote.

Method nextMbo() is most useful of this lot as I am sure getting an MBO instead of an Object will save some time in terms of casting 🙂




Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s