Package org.opentrafficsim.water
Class SchedulableMethod
- java.lang.Object
-
- org.opentrafficsim.water.SchedulableMethod
-
- All Implemented Interfaces:
java.io.Serializable
public class SchedulableMethod extends java.lang.Object implements java.io.Serializable
Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.Based on software from the IDVV project, which is Copyright (c) 2013 Rijkswaterstaat - Dienst Water, Verkeer en Leefomgeving and licensed without restrictions to Delft University of Technology, including the right to sub-license sources and derived products to third parties.
$LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) $, @version $Revision: 1147 $, by $Author: averbraeck $, initial version Nov 6, 2016- Author:
- Alexander Verbraeck
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Object[]
args
args are the arguments which are used to invoke the method with.protected java.lang.String
method
method is the method which embodies the state change.protected java.lang.Object
target
target reflects the target on which a state change is scheduled.
-
Constructor Summary
Constructors Constructor Description SchedulableMethod(java.lang.Object target, java.lang.String method, java.lang.Object[] args)
The constructor of the schedulable method stores the object and method to invoke with its arguments.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute()
Executes the method.java.lang.Object[]
getArgs()
java.lang.String
getMethod()
java.lang.Object
getTarget()
java.lang.String
toString()
-
-
-
Field Detail
-
target
protected java.lang.Object target
target reflects the target on which a state change is scheduled.
-
method
protected java.lang.String method
method is the method which embodies the state change.
-
args
protected java.lang.Object[] args
args are the arguments which are used to invoke the method with.
-
-
Constructor Detail
-
SchedulableMethod
public SchedulableMethod(java.lang.Object target, java.lang.String method, java.lang.Object[] args)
The constructor of the schedulable method stores the object and method to invoke with its arguments.- Parameters:
target
- Object; reflects the object on which the method must be invoked.method
- String; reflects the method to invokeargs
- Object[]; reflects the argumenst the method to invoke with
-
-
Method Detail
-
execute
public final void execute()
Executes the method. Method <init> means the constructor.
-
getArgs
public final java.lang.Object[] getArgs()
- Returns:
- Returns the args.
-
getMethod
public final java.lang.String getMethod()
- Returns:
- Returns the method.
-
getTarget
public final java.lang.Object getTarget()
- Returns:
- Returns the target.
-
toString
public final java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-