• 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
Using NSArray functions in WO
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using NSArray functions in WO


  • Subject: Using NSArray functions in WO
  • From: Ray Ackland <email@hidden>
  • Date: Thu, 11 Sep 2003 20:15:16 +1200

In the book "Enterprise Objects" there is an example of using NSArray functions. In the code snippet (located in /Developer/Examples/JavaWebObjects/Frameworks/JavaRealEstate), the webobjectsexamples.realestate.server.Agent class goes:

public Number averageRating() {
if (_averageRating == null) {
_averageRating = (Number)(ratings().valueForKey("@avg.rating.rating"));
}
return _averageRating;
}


I am trying to understand the parameters given. Specifically, the ratings() refers to the array of EO objects, the @avg means average, but what are the two ratings for? I expect one of them is saying to average the values in the rating field, but what about the other?

I have used a similar expression in my code, but only having one part following the @operator, with success. Am I missing something of importance?

Thanks,

Ray.
_______________________________________________
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: Using NSArray functions in WO
      • From: "Adam Chan" <email@hidden>
  • Prev by Date: Best approach to handling times
  • Next by Date: Re: HowTo cleanup Session data after an Application error occurred
  • Previous by thread: Re: Best approach to handling times
  • Next by thread: Re: Using NSArray functions in WO
  • Index(es):
    • Date
    • Thread