The Encog Project

org.encog.util.time
Class TimeSpan

java.lang.Object
  extended by org.encog.util.time.TimeSpan

public class TimeSpan
extends java.lang.Object

A timespan between two Dates.

Author:
jheaton

Constructor Summary
TimeSpan(java.util.Date from, java.util.Date to)
          Construct a time span.
 
Method Summary
 java.util.Date getFrom()
           
 long getSpan(TimeUnit unit)
          Get the time span specified by the unit.
 java.util.Date getTo()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeSpan

public TimeSpan(java.util.Date from,
                java.util.Date to)
Construct a time span.

Parameters:
from - The from date/time.
to - The two date/time.
Method Detail

getFrom

public java.util.Date getFrom()
Returns:
the from

getSpan

public long getSpan(TimeUnit unit)
Get the time span specified by the unit.

Parameters:
unit - The unit desired.
Returns:
The timespan in the specified unit.

getTo

public java.util.Date getTo()
Returns:
the to date/time.

The Encog Project