Thursday 15 September 2011

Clarification on Groovy Delegation Mixed with Inheritance -


In the Groovy delegation article here (), I am confused with the following code:

After the outline :

  import java.text.SimpleDateFormat class event {@Dellegate date when string title, url} def df = new SimpleDateFormat ("yyyy / MM / dd") def gr8conf = new event (title : "GR 8 Conference", URL: "http://www.gr8conf.org", when: df.parse ("2009/05/18") Def javaOne = New Event (title: "JavaOne", URL: "Http: //java.sun.com/javaone/", when: df.parse ("2009/06/02") assurance of gr8conf.before (javaOne.when)   

Came Indicates that the following can be used:

  extends the date of the class event {@ string, title} URL   

does not make any difference, which is the first for date methods There is a representative, but as it does not increase the date , it can not be sent for a method that takes the date parameter. By adding

extended date , you avoid this limit

No comments:

Post a Comment