• 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
Re: java 101 question "integer compare"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: java 101 question "integer compare"


  • Subject: Re: java 101 question "integer compare"
  • From: WebObjects <email@hidden>
  • Date: Thu, 20 Apr 2006 09:07:38 -0700
  • Thread-topic: java 101 question "integer compare"

Mark and Alan,

newDonor is a java.lang.Long  <--- this is not Integer, but Long has a
.compareTo() method as well.

BUT still got same error.  Took the advice that perhaps it's a primitive,
went with this: if(newDonor.intGender().intValue() == 0)

...now life is good.  The EO has this attribute as a 'Number' - although the
dbase is integer.  This probably explains everything.

Thanks for indulging!

on 4/20/06 08:37, Mark Morris at email@hidden wrote:

> Hello Bill,
>
> Is the intGender method returning an Integer, or (more likely) an
> int?  If an int, then of course it isn't as object and therefor has
> no "compareTo" method. ;-)
>
> Regards,
> Mark
>
> On Apr 20, 2006, at 10:25 AM, WebObjects wrote:
>
>> Perhaps it's an off-blend of coffee that is obscuring my vision,
>> but why in
>> the world would I be getting "cannot resolve symbol : method compareTo
>> (java.lang.Integer)" when I know this object is an Integer.
>>
>> Is there a simple one-liner System.out.printlin statement that I
>> can use to
>> test the object type to see why it's not behaving?
>>
>> Yes - I know this isn't java101 (but you're all so giving, and I'm
>> oh so
>> taking)
>>
>> -Bill
>>
>>     public String alter_gender_display_data() {
>>
>>         if(newDonor.intGender().compareTo(new Integer(0)) == 0) {
>>             return "Male";
>>             }else{
>>             return "Female";
>>             }
>>
>>     }


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • [Newbie] WORepetition/Form submit question
      • From: Lindsey Hotchkies <email@hidden>
References: 
 >Re: java 101 question "integer compare" (From: Mark Morris <email@hidden>)

  • Prev by Date: Re: Weird "No Instance Available" and its fix
  • Next by Date: Re: Weird "No Instance Available" and its fix
  • Previous by thread: Re: java 101 question "integer compare"
  • Next by thread: [Newbie] WORepetition/Form submit question
  • Index(es):
    • Date
    • Thread