• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
java.util.Enumeration - Array List Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: java.util.Enumeration - Array List Question
      • From: Radwar <email@hidden>
    • Re: java.util.Enumeration - Array List Question
      • From: James Cicenia <email@hidden>
References: 
 >Javascript Question Again.. (From: James Cicenia <email@hidden>)

  • Prev by Date: Javascript Question Again..
  • Next by Date: Re: Mixing Direct Actions and maintaining session state - SOLVED - is this a bug?
  • Previous by thread: Javascript Question Again..
  • Next by thread: Re: java.util.Enumeration - Array List Question
  • Index(es):
    • Date
    • Thread