java.util.Enumeration - Array List Question
java.util.Enumeration - Array List Question
- Subject: java.util.Enumeration - Array List Question
- From: "Janice M. Cheung" <email@hidden>
- Date: Fri, 09 Apr 2004 11:15:14 -0400
Greetings!
I'm having problems returning an array List of PersonContacts ..
Is there a way for the InterfaceEnumeration method to return
e.allElements() instead of e.nextElement() ?
My function is only returning one phone number, instead of a list of
all work, cell, and fax numbers..
Here is my function:
public Contact getPersonContact(){
NSArray pc = (NSArray)storedValueForKey("contacts");
java.util.Enumeration e = pc.objectEnumerator();
String myTels = "";
while (e.hasMoreElements()) {
Contact con = (Contact)e.nextElement();
String phone = " ";
String fax = " " ;
String cell = " " ;
if ((con.phoneNumer() != null)) {
if ((con.deviceType().equals("Phone"))) {
phone =
formatPhoneNumber(con.phoneNumber()) + " (w)\n";
}
if ((con.deviceType().equals("Phone"))) {
fax =
formatPhoneNumber(con.phoneNumber()) + " (w)\n";
}
if ((con.deviceType().equals("Phone"))) {
cell =
formatPhoneNumber(con.phoneNumber()) + " (w)\n";
}
myTels = myTels + " " + phone + " " + fax +
" " + phone;
} return con;
}
return null;
}
I'm not sure of what I'm exactly missing .. but I would like for:
Contact con = (Contact)e.nextElement();
to somehow include + con .. to generate the entire list ..
Any help or guidance would be greatly appreciated!
Thanks very much!!
Happy Good Friday!!! :-)
Janice
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.