com.esri.arcgis.system
Interface ITimeDuration

All Superinterfaces:
Serializable
All Known Implementing Classes:
TimeDuration

public interface ITimeDuration
extends Serializable

Provides access to members that control the Time Duration.

Description

The ITimeDuration interface is used to deal with time values which are simply a length of time, but not associated with a specific point in time. For example, 3 hours is a TimeDuration since it does not tell you if it represents 1:00-4:00 or 5:00-8:00. If you need to associate the TimeDuration with a specific point on the time line, you should use a TimeExtent.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.


Method Summary
 void addDays(double value)
          Adds the input amount of days to the time duration.
 void addDuration(ITimeDuration timeDuration)
          Adds a time duration.
 void addHours(double value)
          Adds the input amount of hours to the time duration.
 void addMilliseconds(double value)
          Adds the input amount of milliseconds to the time duration.
 void addMinutes(double value)
          Adds the input amount of minutes to the time duration.
 void addNanoseconds(long value)
          Adds the input amount of nanoseconds to the time duration.
 void addSeconds(double value)
          Adds the input amount of seconds to the time duration.
 void addWeeks(double value)
          Adds the input amount of weeks to the time duration.
 int compare(ITimeDuration otherDuration)
          Compares this time duration to the other time duration.
 int getDays()
          The time duration days component.
 int getHours()
          The time duration hours component.
 int getMinutes()
          The time duration minutes component.
 int getNanoseconds()
          The time duration nanoseconds component.
 int getSeconds()
          The time duration seconds component.
 boolean isPositive()
          Indicates whether the time duration value is positive or negative.
 boolean isZero()
          Indicates whether the time duration's value is zero.
 double queryDayFraction()
          The time duration day fraction portion as a day fraction.
 long queryDayFractionNanoseconds()
          The time duration day fraction portion as the number of nanoseconds elapsed since midnight.
 long queryTicks()
          Obtains the time duration as the number of ticks.
 double queryTotalDays()
          Obtains the time duration as total days floating point value.
 double queryTotalHours()
          Obtains the time duration as total hours floating point value.
 double queryTotalMinutes()
          Obtains the time duration as total minutes floating point value.
 double queryTotalSeconds()
          Obtains the time duration as total seconds floating point value.
 _WKSTimeDuration queryWKSTimeDuration()
          Obtains time as a WKSTimeDuration.
 String queryXMLTimeDurationString()
          Obtains the time duration as an XML time duration string.
 void reset()
          Reset the time duration to zero.
 void scale(double scaleFactor)
          Scales the time duration by a scale factor.
 void setDayFraction(double dayFraction)
          The time duration day fraction portion as a day fraction.
 void setDayFractionNanoseconds(long dayFractionNanoseconds)
          The time duration day fraction portion as the number of nanoseconds elapsed since midnight.
 void setDays(int days)
          The time duration days component.
 void setFromTicks(long ticks)
          Writes the time duration from a given number of ticks.
 void setFromWKSTimeDuration(_WKSTimeDuration timeDuration)
          Writes the time from a given WKSTimeDuration value.
 void setFromXMLTimeDurationString(String xmlTimeDurationString)
          Writes the time duration from an XML time duration string.
 void setHours(int hours)
          The time duration hours component.
 void setMinutes(int minutes)
          The time duration minutes component.
 void setNanoseconds(int nanoseconds)
          The time duration nanoseconds component.
 void setPositive(boolean positive)
          Indicates whether the time duration value is positive or negative.
 void setSeconds(int seconds)
          The time duration seconds component.
 void subtractDuration(ITimeDuration timeDuration)
          Subtracts a time duration.
 

Method Detail

getDays

int getDays()
            throws IOException,
                   AutomationException
The time duration days component.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
The days
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setDays

void setDays(int days)
             throws IOException,
                    AutomationException
The time duration days component.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
days - The days (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getHours

int getHours()
             throws IOException,
                    AutomationException
The time duration hours component.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
The hours
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setHours

void setHours(int hours)
              throws IOException,
                     AutomationException
The time duration hours component.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
hours - The hours (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMinutes

int getMinutes()
               throws IOException,
                      AutomationException
The time duration minutes component.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
The minutes
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setMinutes

void setMinutes(int minutes)
                throws IOException,
                       AutomationException
The time duration minutes component.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
minutes - The minutes (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSeconds

int getSeconds()
               throws IOException,
                      AutomationException
The time duration seconds component.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
The seconds
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setSeconds

void setSeconds(int seconds)
                throws IOException,
                       AutomationException
The time duration seconds component.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
seconds - The seconds (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getNanoseconds

int getNanoseconds()
                   throws IOException,
                          AutomationException
The time duration nanoseconds component.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
The nanoseconds
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setNanoseconds

void setNanoseconds(int nanoseconds)
                    throws IOException,
                           AutomationException
The time duration nanoseconds component.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
nanoseconds - The nanoseconds (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isPositive

boolean isPositive()
                   throws IOException,
                          AutomationException
Indicates whether the time duration value is positive or negative.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
The positive
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setPositive

void setPositive(boolean positive)
                 throws IOException,
                        AutomationException
Indicates whether the time duration value is positive or negative.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
positive - The positive (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryWKSTimeDuration

_WKSTimeDuration queryWKSTimeDuration()
                                      throws IOException,
                                             AutomationException
Obtains time as a WKSTimeDuration.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
A Structure: com.esri.arcgis.system._WKSTimeDuration (A com.esri.arcgis.system._WKSTimeDuration COM typedef)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setFromWKSTimeDuration

void setFromWKSTimeDuration(_WKSTimeDuration timeDuration)
                            throws IOException,
                                   AutomationException
Writes the time from a given WKSTimeDuration value.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
timeDuration - A Structure: com.esri.arcgis.system._WKSTimeDuration (A com.esri.arcgis.system._WKSTimeDuration COM typedef) (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryXMLTimeDurationString

String queryXMLTimeDurationString()
                                  throws IOException,
                                         AutomationException
Obtains the time duration as an XML time duration string.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
The xmlTimeDurationString
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setFromXMLTimeDurationString

void setFromXMLTimeDurationString(String xmlTimeDurationString)
                                  throws IOException,
                                         AutomationException
Writes the time duration from an XML time duration string.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
xmlTimeDurationString - The xmlTimeDurationString (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addWeeks

void addWeeks(double value)
              throws IOException,
                     AutomationException
Adds the input amount of weeks to the time duration.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
value - The value (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addDays

void addDays(double value)
             throws IOException,
                    AutomationException
Adds the input amount of days to the time duration.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
value - The value (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addHours

void addHours(double value)
              throws IOException,
                     AutomationException
Adds the input amount of hours to the time duration.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
value - The value (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addMinutes

void addMinutes(double value)
                throws IOException,
                       AutomationException
Adds the input amount of minutes to the time duration.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
value - The value (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addSeconds

void addSeconds(double value)
                throws IOException,
                       AutomationException
Adds the input amount of seconds to the time duration.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
value - The value (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addMilliseconds

void addMilliseconds(double value)
                     throws IOException,
                            AutomationException
Adds the input amount of milliseconds to the time duration.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
value - The value (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addNanoseconds

void addNanoseconds(long value)
                    throws IOException,
                           AutomationException
Adds the input amount of nanoseconds to the time duration.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
value - Signed 64-bit int (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryTotalDays

double queryTotalDays()
                      throws IOException,
                             AutomationException
Obtains the time duration as total days floating point value.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
The totalDays
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryTotalHours

double queryTotalHours()
                       throws IOException,
                              AutomationException
Obtains the time duration as total hours floating point value.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
The totalHours
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryTotalMinutes

double queryTotalMinutes()
                         throws IOException,
                                AutomationException
Obtains the time duration as total minutes floating point value.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
The totalMinutes
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryTotalSeconds

double queryTotalSeconds()
                         throws IOException,
                                AutomationException
Obtains the time duration as total seconds floating point value.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
The totalSeconds
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryDayFraction

double queryDayFraction()
                        throws IOException,
                               AutomationException
The time duration day fraction portion as a day fraction. Corresponds to the Hour, Minute, Second, and Nanoseconds properties.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
The dayFraction
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setDayFraction

void setDayFraction(double dayFraction)
                    throws IOException,
                           AutomationException
The time duration day fraction portion as a day fraction. Corresponds to the Hour, Minute, Second, and Nanoseconds properties.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
dayFraction - The dayFraction (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryDayFractionNanoseconds

long queryDayFractionNanoseconds()
                                 throws IOException,
                                        AutomationException
The time duration day fraction portion as the number of nanoseconds elapsed since midnight. Corresponds to the Hour, Minute, Second, and Nanoseconds properties.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
Signed 64-bit int
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setDayFractionNanoseconds

void setDayFractionNanoseconds(long dayFractionNanoseconds)
                               throws IOException,
                                      AutomationException
The time duration day fraction portion as the number of nanoseconds elapsed since midnight. Corresponds to the Hour, Minute, Second, and Nanoseconds properties.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
dayFractionNanoseconds - Signed 64-bit int (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryTicks

long queryTicks()
                throws IOException,
                       AutomationException
Obtains the time duration as the number of ticks.

Remarks

Using the QueryTicks function allows you to find the Ticks value, which is used in many Windows time controls.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
Signed 64-bit int
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setFromTicks

void setFromTicks(long ticks)
                  throws IOException,
                         AutomationException
Writes the time duration from a given number of ticks.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
ticks - Signed 64-bit int (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

reset

void reset()
           throws IOException,
                  AutomationException
Reset the time duration to zero.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

scale

void scale(double scaleFactor)
           throws IOException,
                  AutomationException
Scales the time duration by a scale factor.

Description

The scale function can be used to increase or decrease the given duration. For example, if you want to divide a time extent into 5 equal segments, you can get the TimeDuration from the TimeExent, then scale the TimeDuration by 1/5 and add the resulting TimeDuration to the TimeExtent's Start Time.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
scaleFactor - The scaleFactor (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addDuration

void addDuration(ITimeDuration timeDuration)
                 throws IOException,
                        AutomationException
Adds a time duration.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
timeDuration - A reference to a com.esri.arcgis.system.ITimeDuration (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

subtractDuration

void subtractDuration(ITimeDuration timeDuration)
                      throws IOException,
                             AutomationException
Subtracts a time duration.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
timeDuration - A reference to a com.esri.arcgis.system.ITimeDuration (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isZero

boolean isZero()
               throws IOException,
                      AutomationException
Indicates whether the time duration's value is zero.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Returns:
The isZero
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

compare

int compare(ITimeDuration otherDuration)
            throws IOException,
                   AutomationException
Compares this time duration to the other time duration. Returns -1 if this time duration's value is less, 1 if greater, and 0 otherwise.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
otherDuration - A reference to a com.esri.arcgis.system.ITimeDuration (in)
Returns:
The result
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.