Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to interpret something- not sure what to call it, the urls that describe a class and its methods

 
Matt Kohanek
Village Idiot
Ranch Hand
Posts: 484
Java jQuery Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I often see pages like this one:

http://www.jboss.org/file-access/default/members/jbossrichfaces/freezone/docs/apidoc_framework/org/richfaces/model/TreeNode.html#getChildren()

That have a method summary, method etails, etc etc

But Im not sure how to read some of these things. For instance from Interface TreeNode<T> I am looking at:

getChildren
java.util.Iterator<java.util.Map.Entry><java.lang.Object,TreeNode><T>>> getChildren()
Getter for children entries. Each children entry contains identifier (key) and child node (value). Identifiers are used to generate model keys representing paths to tree node. Model keys are used:
For persisting tree state. That means that identifiers should be serializable when some JSF features are used, e.g. client-side state saving.
For constructing client identifiers. Client identifier for tree nodes consists of Object.toString() representations of identifier separated with NamingContainer.SEPARATOR_CHAR chars. String representation of identifier should be a valid XML ID, e.g. conform to this: XML Name Production production.

Returns:
Iterator of Map.Entry instances containing TreeNode as values and their identifiers as keys.


Particularly that second line. I believe that is showing how the methiod should be constructed right? So if Im right it would look something like:



That seems wrong when I look at it though. Can someone clear this up or is there a resource somewhere that tells you how to read the multitude of pages that look like this?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, methods do not get constructed. That line shows what kind of object that method returns as result. In this case, it returns an Iterator, the elements of which are Map.Entry objects.

If you look at the javadocs of Map.Entry, you'll see that it associates two elements - a key and a value. So in this case, nothing further is known in advance about the key (it is an Object - which is true for all objects in Java), but the value will always be of type TreeNode.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic