Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## nl.tudelft.simulation.dsol.experiment
Class TimeUnit

    java.lang.Object
      nl.tudelft.simulation.dsol.experiment.TimeUnit

All Implemented Interfaces:
  java.io.Serializable, TimeUnitInterface

public class TimeUnit
extends java.lang.Object
implements TimeUnitInterface

The TimeUnitInterface defines the simulator time units.
(c) copyright 2003 Delft University of Technology , the Netherlands.
See for project information www.simulation.tudelft.nl
License of use: General Public License (GPL) , no warranty

Version:
  2.0 21.09.2003
Author:
  Peter Jacobs , Alexander Verbraeck
See Also:
  Serialized Form

Field Summary

Fields inherited from interface nl.tudelft.simulation.dsol.experiment.TimeUnitInterface
`DAY, HOUR, MILLISECOND, MINUTE, SECOND, UNIT, WEEK`

Constructor Summary
`TimeUnit(long value, java.lang.String name)` Method Speed.

Method Summary
`static double` | `convert(double amount, TimeUnitInterface units, SimulatorInterface simulator)` converts amount units to the units of the simulator
`static double` | `convert(double amount, TimeUnitInterface units, TimeUnitInterface targetUnits)` converts amount units to the target units
`long` | `getValue()` Method getValue.This method returns the number of timeunits relative to milliseconds
`java.lang.String` | `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### TimeUnit

    public TimeUnit(long value,
                    java.lang.String name)

  Method Speed.

Parameters:
  `value` - represents the number of miliseconds
  `name` - The name that will show up in reports and animation

Method Detail

### getValue

    public long getValue()

  Description copied from interface: `TimeUnitInterface`
  Method getValue.This method returns the number of timeunits relative to milliseconds

  Specified by:
    `getValue` in interface `TimeUnitInterface`
  Returns:
    long
  See Also:
    `TimeUnitInterface.getValue()`

### toString

    public java.lang.String toString()

  See Also:
    `Object.toString()`

### convert

    public static double convert(double amount,
                                 TimeUnitInterface units,
                                 SimulatorInterface simulator)
                          throws java.rmi.RemoteException

  converts amount units to the units of the simulator

  Parameters:
    `amount` - the amount to convert
    `units` - the units of the amount
    `simulator` - the simulator
  Returns:
    double the amount in simulator units
  Throws:
    `java.rmi.RemoteException` - on network exception

### convert

    public static double convert(double amount,
                                 TimeUnitInterface units,
                                 TimeUnitInterface targetUnits)

  converts amount units to the target units

  Parameters:
    `amount` - the amount to convert
    `units` - the units of the amount
    `targetUnits` - the units to convert to
  Returns:
    double the amount in simulator units

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002-2004 Delft University of Technology, the Netherlands. All Rights Reserved.