aspose file tools*
The moose likes Java in General and the fly likes Language Question: ? extends node Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Language Question: ? extends node" Watch "Language Question: ? extends node" New topic
Author

Language Question: ? extends node

Eric Fancis
Greenhorn

Joined: Jun 14, 2011
Posts: 29
What is the following code called?



I do not know what to Google for information on the topic.
I do not know what the code is doing (Mainly the <? extends node>, but I also do not know what Comaparable<IProcessor> is doing either).

So, if I could get some direction on what to Google for, I will come back with more specific questions.

Thanks!


http://www.h4t3r.com
Carles Gasques
Ranch Hand

Joined: Apr 19, 2013
Posts: 199
    
    1
Hi,

Tough question :-)
Well is an interface (with generics) that explicit a contract and decouples the object that fullfills the contract from the object that uses the contract.

With Comparable<IProcessor> you force that the class that implements IProcessor have to implement
and IProcessorMatcher<? extends Node> means that the IProcessorMatcher could be typed with any class that extends Node.


Cheers,
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36598
    
  16
Go to the Java Tutorials and use ctrl‑-F-generics. You will find at least two sections, and one of them will tell you about <? extends Foo>
Eric Fancis
Greenhorn

Joined: Jun 14, 2011
Posts: 29
Perfect. Thank you guys!

Thanks,
Eric
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36598
    
  16
You're welcome
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Language Question: ? extends node
 
Similar Threads
getting object location in memory?
LinkedList -- removeAll()
ArrayList Polymorphism Question
evaluate the expression
java has the address of a variable´╝č and what is the meaning of the instance count?