Re: Doing something stupid
Re: Doing something stupid
- Subject: Re: Doing something stupid
- From: Ricardo Strausz <email@hidden>
- Date: Tue, 12 Aug 2003 13:54:09 -0500
You most convert the OBJECT integer in a TYPE in order to use the +
operator...
something like
int i = anIntegerObject.intValue();
i=i+30;
Integer anotherIntegerObject = Integer(i);
Suerte!
dino
On martes, agos 12, 2003, at 11:36 America/Mexico_City, Reid Bundonis
wrote:
Ok, I have a class file generated from EOModeler that contains the
usual suspects. One is public Number userID(). I want to create an
offset of the value by adding to the returned value. I've done this in
the past with Strings, such as
public String productThumbnail() {
return "/thumbs/" + (String)storedValueForKey("productCode") +
"Thumb.jpg";
This allows me to drop a dynamic value into a custom string and access
it in an array of results. I am trying to do the same with a number and
I am not getting very far. I am trying to add a number to the userID
number and I get "operator + cannot be applied to
java.lang.Number,int." Shouldn't this work?
public Number userOffset() {
return (Number)storedValueForKey("userID") + 30;
I also tried to
return (Integer) ((Number)storedValueForKey("userID") + 30);
This gives me the same results. Why can't I simply add a number to
another number? Any help to show me why I am so stupid would be great.
_______________________________________________
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.
_______________________________________________
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.