/* MOD_V2.0
* Copyright (c) 2012 OpenDA Association
* All rights reserved.
*
* This file is part of OpenDA.
*
* OpenDA is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
* OpenDA is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with OpenDA. If not, see .
*/
namespace OpenDA.DotNet.Interfaces
{
public interface ITime
{
//
// First all timeStamp methods
//
///
/// Check of the time instance is a time stamp.
///
/// True if the time instance is a time stamp.
bool IsStamp();
///
/// Check of the time instance is a time span.
///
/// True if the time instance is a time span.
bool IsSpan();
///
/// Get the time stamp as Modified Julian Day.
///
double MJD { get; }
///
/// Get the time step interval as Modified Julian Day.
///
double StepMJD { get; }
///
/// Get the time span's begin time stamp as openDA time.
///
ITime BeginTime { get; }
///
/// Get the time span's end time stamp as openDA time.
///
ITime EndTime { get; }
///
/// Check if a time stamp lies within a time span. t1.InSpan(t2) is true if
/// t1 is lower than or equal to t2.endTime, and t1 is greater then t2.startTime.
/// Method can only be invoked if IsSpan()
is true
/// for toCheck and IsStamp()
is true for this
.
///
/// Start time of time span to check.
/// End time of time span to check.
/// True if the time lies in span.
bool InSpan(double otherTimeBeginAsMJD, double otherTimeEndAsMJD);
///
/// Check if this time stamp is After another. t2.After(t1) means that t2 is greater than t1.
///
/// The time stamp to check. Method can only be invoked if
/// IsStamp()
is true for this and IsStamp()
is true for toCheck
.
/// True if the time lies afther the time stamp to check.
bool After(double otherTimeAsMJD);
///
/// Check if this time stamp is before or equal to another. t1.BeforeEquals(t2) means that
/// t1 is lower than or equal to t2.
///
/// The time stamp to check. Method can only be invoked if
/// IsStamp()
is true for this and IsStamp()
is true for toCheck
.
/// True if the time lies before or is equal to the time stamp to check.
bool BeforeEquals(double otherTimeAsMJD);
///
/// Finish a time instance (i.e. free memory, needed for native implementations).
///
void Finish();
///
/// Return a string representation of the ITime object.
///
/// The ITime object's string representation.
string ToString();
}
}