|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.ca.commons.naming.DXNamingEnumeration
A simple class that implements NamingEnumeration, used to bundle up search results 'n stuff. Used by not-really-jndi ftns to wrap things nicely for higher level ftns that are expecting NamingEnumerations. as usual, the enumeration can be enumerated using the model:
while (myEnumeration.hasMoreElements())
doSomethingWith(myEnumeration.nextElement();
in addition, it supports the NamingEnumeration interface
equivalent, which (in the future) may also throw a NamingException.
try
{
while (myEnumeration.hasMore())
doSomethingWith(myEnumeration.next();
}
catch (NamingException e) { }
As a spot of convenience evil, it implements a sort() ftn as well...
(Since it's not a 'dynamic' enumeration as a normal naming enumeration
would be, but uses a vector base object), and also allows the enumeration
to be dumped out as a vector or a string array :-) .
| Constructor Summary | |
DXNamingEnumeration()
The constructor does nothing except initialise class variables. |
|
DXNamingEnumeration(java.util.Enumeration ne)
A quicky to wrap normal enumerations with as well... |
|
DXNamingEnumeration(javax.naming.NamingEnumeration ne)
The constructor takes another NamingEnumeration and uses it to initialise with. |
|
| Method Summary | |
void |
add(java.lang.Object o)
Adds an object to the enumeration. |
void |
close()
Included for Naming Enumeration compatibility... does nothing, 'cause DXNamingEnumeration isn't really an enumeration, and has already slurped all the data... :-) |
boolean |
contains(java.lang.Object test)
A simple existance test against the core vector list of objects. |
java.util.Vector |
getVector()
|
boolean |
hasMore()
|
boolean |
hasMoreElements()
|
java.lang.Object |
next()
|
java.lang.Object |
nextElement()
|
void |
remove(java.lang.Object o)
Removes an object from the enumeration. |
void |
reset()
Enumerations can't usually be re-used. |
int |
size()
Not really necessary, this returns the number of elements in the enumeration. |
DXNamingEnumeration |
sort()
This method attempts to order the components of the SimpleEnumeration using their intrinsic 'toString()' methods (this may be meaningless for some components). |
java.lang.Object[] |
toArray()
|
java.lang.String |
toString()
|
java.lang.String[] |
toStringArray()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public DXNamingEnumeration()
public DXNamingEnumeration(java.util.Enumeration ne)
public DXNamingEnumeration(javax.naming.NamingEnumeration ne)
| Method Detail |
public void add(java.lang.Object o)
public void remove(java.lang.Object o)
public void reset()
public int size()
public boolean hasMore()
hasMore in interface javax.naming.NamingEnumerationpublic boolean hasMoreElements()
hasMoreElements in interface java.util.Enumeration
public java.lang.Object next()
throws java.util.NoSuchElementException
next in interface javax.naming.NamingEnumerationjava.util.NoSuchElementException
public java.lang.Object nextElement()
throws java.util.NoSuchElementException
nextElement in interface java.util.Enumerationjava.util.NoSuchElementExceptionpublic DXNamingEnumeration sort()
public boolean contains(java.lang.Object test)
public void close()
close in interface javax.naming.NamingEnumerationpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.Object[] toArray()
public java.lang.String[] toStringArray()
public java.util.Vector getVector()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||