edu.isi.stella
Class TimeDuration

java.lang.Object
  extended by edu.isi.stella.Stella_Object
      extended by edu.isi.stella.Quantity
          extended by edu.isi.stella.DateTimeObject
              extended by edu.isi.stella.TimeDuration

public class TimeDuration
extends DateTimeObject

Representation of Relative Days and Time with the date represented as a number of days and the time in milliseconds.


Field Summary
 int days
           
 int millis
           
 
Constructor Summary
TimeDuration()
           
 
Method Summary
static Stella_Object accessTimeDurationSlotValue(TimeDuration self, Symbol slotname, Stella_Object value, boolean setvalueP)
           
 Quantity coerceTo(Stella_Object y)
           
 DecodedTimeDuration decodeTimeDuration()
           
 boolean greaterEqualP(Stella_Object t2)
           
 boolean greaterP(Stella_Object t2)
           
 int hashCode_()
          Return a hash code for self (can be negative).
 boolean lessEqualP(Stella_Object t2)
           
 boolean lessP(Stella_Object t2)
           
static TimeDuration makeTimeDuration(int days, int millis)
           
static TimeDuration newTimeDuration()
           
 boolean objectEqlP(Stella_Object t2)
           
 Surrogate primaryType()
          Returns the primary type of self.
 void printObject(java.io.PrintStream stream)
           
 void printTimeDuration(java.io.PrintStream stream)
           
static TimeDuration stringToTimeDuration(java.lang.String duration)
          Parses and returns an time-duration object corresponding to duration.
static Stella_Object timeDivide(TimeDuration t1, Stella_Object t2)
          Divides the relative date t1 by t2.
 java.lang.String timeDurationToString()
          Returns a string representation of date
 
Methods inherited from class edu.isi.stella.DateTimeObject
timeAdd, timeSubtract
 
Methods inherited from class edu.isi.stella.Stella_Object
_, accessInContext, addPropertyValue, amPm, anchoredTypeSpecifierP, andOrNotTreeP, applyCoercionMethod, atomicExpressionP, bindToSurrogateP, booleanP, bootstrapIsaP, bquotify, cast, characterP, chooseSortPredicate, clConditionalizeTypeDeclarationTree, clTranslateAtomicTree, clTranslateATree, clTranslateBooleanTest, clTranslatePlainBooleanTest, clTranslateVerbatimBodySymbols, clYieldTypedExpressionTree, coerceATree, coerceEvaluatedTree, coerceMvTree, coerceOptionValue, coerceToBoolean, coerceToFloat, coerceToHashSet, coerceToModule, coerceToModuleName, coerceToString, coerceToSymbol, coerceToXmlElement, coerceValueToBoolean, coerceValueToFloat, coerceValueToString, coerceValueToType, coercibleP, collectFeatureList, collectKeyValueList, commonLispSymbolP, computeExpressionType, consify, consifyListsAndIterators, consP, consTreeMatchP, convertToLiteral, copyConsTree, cppArgumentIsStreamP, cppBinaryOperatorP, cppBlockP, cppMaybeOutputStatementWithParentheses, cppOperatorP, cppOutputAtomicExpression, cppOutputLiteral, cppOutputOneActualParameter, cppOutputStatement, cppOutputTypedEntity, cppPrognifyStatement, cppPrognP, cppStatementToList, cppStreamIsStandardOutputP, cpptrans, cppTranslateAtomicTree, cppTranslateATree, cppTranslatedArrayTypeP, csValueP, dateDivider, dateTimeDivider, day, dealWithAmPm, dealWithEra, dealWithNoonMidn, decrementReferenceCount, defaultOptionHandler, defineSystem, defmodule, deletedP, describe, describeObject, describeTersely, destructureMethodNameTree, deUglifyParseTree, either, eqlP, eqlToBooleanP, eqlToCharacterP, eqlToFloatP, eqlToIntegerP, eqlToLongIntegerP, eqlToStringP, equalConsTreesP, equalHashCode, equalP, era, estimatedEvaluationCost, evaluate, evaluateArgumentTree, evaluateAtomicTree, evaluateCommand, expandBquoteTree, filterModuleP, floatP, free, get, getObject, getProperty, hashlist, hashMemoizedArguments, helpBquotify, helpClTranslateATree, helpCoerceATree, helpLptrans, helpPrintOutline, helpTransformBooleanProceduralExpression, helpWalkATree, homeModule, hour, idlOutputAtomicExpression, idlOutputLiteral, idlOutputStatement, idlTranslateAtomicTree, idlTranslateATree, illegalTreeP, implodePathname, incrementallyTranslate, incrementReferenceCount, inlineUnwrapBoolean, inlineWrapBoolean, inModule, integerP, isaP, javaBinaryOperatorP, javaBlockP, javaEndOfLineTokenP, javaHelpOutputPrintStream, javaMaybeOutputStatementWithParentheses, javaOperatorP, javaOutputLiteral, javaOutputStatement, javaPrognP, javaStreamIsStandardOutputP, javaSymbolCaseP, javaTranslateAtomicTree, javaTranslateATree, javaTranslateWithNativeWrapper, jptrans, keywordP, legalTokenizerFromStateP, legalTokenizerStateP, legalTokenizerToStateP, literalEqlP, logLevelLE, longIntegerP, lptrans, makeEvaluatableBquoteTree, makeFileNameFromRelativePath, makeMemoizedValueEntry, makeMemoizedValueEntryn, matchConsTree, methodSlotP, minute, month, nameToString, nilP, noonMidn, numberWrapperToFloat, objectEqualP, objectHashCode, one, oneI, onlyIf, parametricTypeSpecifierP, parseArrayDimensionsSpec, parseOptions, parseTokenizerCharacterSpec, parseTokenizerStateModifiers, permanentCopy, permanentify, permanentifyForm, po, prettyPrintLiteral, primaryClass, printOutline, printStellaCode, printStellaDefinition, printUndefinedSuperClasses, proceduralExpressionP, ptrans, publicSlots, registerRecycledItem, runOptionHandlerP, safeEqualHashCode, safeHashCode, safePrimaryType, safeYieldTypeSpecifier, searchConsTreeP, searchConsTreeWithFilterP, searchForObject, secondp, setProperty, sideEffectFreeExpressionP, simplifyBquoteTree, specialp, standardObjectP, stella_Increment, stellaClassP, stellaCollectionP, stellaNeedToCompileP, stellaNeedToTranslateP, stellaObjectP, stellify, storageSlotP, stringifyInModule, stringP, substituteConsTree, substituteOnce, surrogateP, surrogatify, sweep, symbolCaseP, symbolP, sysTree, targetLanguageType, taxonomyIsaP, timeDivider, timeMultiply, tokenizerIncludeSpecP, tokenizerToStateAlias, tokenizerToStateName, toString, traceIf, traceKeywordP, transientifyForm, transientObjectP, transientSymbolP, translateWalkedTree, treeSize, treeToTrees, trueOptionP, tryToEvaluate, typeP, typify, unmake, unregisterRecycledItem, updateInContext, valuesTreeP, variableExpressionP, verbatimStringP, verbatimTreeP, vetOptions, vrletExpressionP, walkAtomicTree, walkATree, walkCollectionTree, walkDontCallMeTree, walkedExpressionExpression, walkedExpressionType, walkExpressionTree, walkMvExpressionTree, walkMvTree, walkStatement, walkTopLevelExpression, walkWithoutTypeTree, warnAboutUnknownSourceType, weekday, withinContext, withinModule, withinWorld, withStellaTokenizer, withSystemDefinition, withTokenizer, wrapperP, wrapWhereTest, xmlAttributeP, xmlBaseAttributeP, xmlCdataFormP, xmlCdataP, xmlDeclarationFormP, xmlDeclarationP, xmlDoctypeFormP, xmlElementFormP, xmlElementP, xmlGlobalAttributeP, xmlLocalAttributeP, xmlnsAttributeP, xmlProcessingInstructionFormP, xmlProcessingInstructionP, xmlTagCase, year, yieldCondTest, yieldCondTestOrTests, yieldHardcodedCaseSymbolIdOrIds, yieldInCursorClausesForArgumentList, yieldInCursorClausesForGeneralCollection, yieldInCursorClausesForVector, yieldTypeSpecifier, zone, zoneMinute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

days

public int days

millis

public int millis
Constructor Detail

TimeDuration

public TimeDuration()
Method Detail

makeTimeDuration

public static TimeDuration makeTimeDuration(int days,
                                            int millis)

stringToTimeDuration

public static TimeDuration stringToTimeDuration(java.lang.String duration)
Parses and returns an time-duration object corresponding to duration. The syntax for time duration strings is "{plus|minus} N days[; M ms]" where N and M are integer values for days and milliseconds. If no valid parse is found, null is returned.

Parameters:
duration -
Returns:
TimeDuration

newTimeDuration

public static TimeDuration newTimeDuration()

greaterEqualP

public boolean greaterEqualP(Stella_Object t2)
Overrides:
greaterEqualP in class Quantity

lessEqualP

public boolean lessEqualP(Stella_Object t2)
Overrides:
lessEqualP in class Quantity

greaterP

public boolean greaterP(Stella_Object t2)
Overrides:
greaterP in class Quantity

lessP

public boolean lessP(Stella_Object t2)
Overrides:
lessP in class Quantity

objectEqlP

public boolean objectEqlP(Stella_Object t2)
Overrides:
objectEqlP in class Stella_Object

timeDivide

public static Stella_Object timeDivide(TimeDuration t1,
                                       Stella_Object t2)
Divides the relative date t1 by t2. t2 must be either a relative date or a wrapped number. If t2 is a relative date, then the return value will be a wrapped float. If t2 is a wrapped number, then the reutrn value will be a relative date.

Parameters:
t1 -
t2 -
Returns:
Stella_Object

decodeTimeDuration

public DecodedTimeDuration decodeTimeDuration()

printTimeDuration

public void printTimeDuration(java.io.PrintStream stream)

timeDurationToString

public java.lang.String timeDurationToString()
Returns a string representation of date

Returns:
String

hashCode_

public int hashCode_()
Description copied from class: Stella_Object
Return a hash code for self (can be negative). Two objects that are eqlP are guaranteed to generate the same hash code. Two objects that are not eqlP do not necessarily generate different hash codes.

Overrides:
hashCode_ in class Stella_Object
Returns:
int

coerceTo

public Quantity coerceTo(Stella_Object y)
Overrides:
coerceTo in class Quantity

printObject

public void printObject(java.io.PrintStream stream)
Overrides:
printObject in class Stella_Object

accessTimeDurationSlotValue

public static Stella_Object accessTimeDurationSlotValue(TimeDuration self,
                                                        Symbol slotname,
                                                        Stella_Object value,
                                                        boolean setvalueP)

primaryType

public Surrogate primaryType()
Description copied from class: Stella_Object
Returns the primary type of self. Gets defined automatically for every non-abstract subclass of OBJECT.

Overrides:
primaryType in class Stella_Object
Returns:
Surrogate