|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.util.transforms.EnumerationTransform
public class EnumerationTransform
An Enumeration which applies a transform to all the elements.
For example, you may have a Enumeration employees
of Employee objects, and you want an Enumeration of employee last
names (employee.getLastName()
).
You can use a EnumerationTransform to transform the Enumeration:
Enumeration employees = db.getEmployees(); Enumeration lastNames = new EnumerationTransform(employees, new TransformInterface() { public Object transform(Object obj) { return ((Employee) obj).getLastName(); } });
Constructor Summary | |
---|---|
EnumerationTransform()
Default no-arg constructor. |
|
EnumerationTransform(java.util.Enumeration enumeration,
com.sas.util.transforms.TransformInterface transform)
Construct an EnumerationTransform which applies a transform to the elements of another Enumeration. |
Method Summary | |
---|---|
boolean |
hasMoreElements()
Test if the enumeration has completed. |
java.lang.Object |
nextElement()
Return the next element in the base enumeration on which this EnumerationTransform was constructed. |
Constructor Detail |
---|
public EnumerationTransform()
public EnumerationTransform(java.util.Enumeration enumeration, com.sas.util.transforms.TransformInterface transform)
enumeration
- the base enumeration which this EnumerationTransform transforms.transform
- the transform to apply to each element of the base enumeration.Method Detail |
---|
public boolean hasMoreElements()
hasMoreElements
in interface java.util.Enumeration
public java.lang.Object nextElement()
nextElement
in interface java.util.Enumeration
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |