Doing something stupid
Doing something stupid
- Subject: Doing something stupid
- From: Reid Bundonis <email@hidden>
- Date: Tue, 12 Aug 2003 12:36:41 -0400
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.