The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
October 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

the date? :p

Posted by Chin Loong on October 29, 2001 at 10:07 AM

well if u're stuck, u can look at this as a reference.. i never used the reflection package ago so i have no experience in it. but after reading the stuffs, this is what i came up with.

try compiling it and see. hope this would help u more ;)

for addEvent(new ThermostatNight(tm));


Class rClass=Class.forName("tme2.Restart");
Class[] argTypes=new Class[]{tme2.ThermostatNight};
Method method=rClass.getDeclaredMethod("addEvent",argTypes);
Object args=new Object[]{new ThermostatNight(tm)};
method.invoke(this,args);

anyway, first u would have the parse the command line, extract the addEvent from the line of text, and also extract the parameters. should be quite easy here.. can use StringTokenizer.

then, u just use the reflection package ;)

ok... about the date.. errm.. actually it isn't quite actually a date :p. just asked her out for lunch.. (during her lunch break.. i'm self employed so i can have my lunch anytime :p) it rained heavily :( so we ended up at the KFC nearby ;). gonna meet up with her tomorrow for a movie *whee* ~



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us