JTP API Documentation

jtp.time.func
Class FirstTimePoint

java.lang.Object
  |
  +--jtp.disp.AbstractRelationBasedReasoner
        |
        +--jtp.disp.AbstractRelationBasedBCReasoner
              |
              +--jtp.func.EvaluableFunctionReasoner
                    |
                    +--jtp.time.func.TimePointFunctionReasoner
                          |
                          +--jtp.time.func.FirstTimePoint
All Implemented Interfaces:
Reasoner, RelationBasedBCReasoner, RelationBasedReasoner, Serializable

public class FirstTimePoint
extends TimePointFunctionReasoner

Functional reasoner that takes a CalendarTimePoint tp and a unit (e.g., 'week', 'day'), and returns the first time point in the unit that tp contains. For example, if tp represents the date January 2, 1982 4:30, and the unit is day, then the CalendarTimePoint representing the date January 2, 1982 00:00 will be returned.

See Also:
Serialized Form

Field Summary
protected static int[] calendarFields
           
protected static int[] firstValues
           
protected  Symbol[] units
           
 
Fields inherited from class jtp.time.func.TimePointFunctionReasoner
tvocab
 
Fields inherited from class jtp.disp.AbstractRelationBasedBCReasoner
arity, polarity, relation
 
Fields inherited from interface jtp.disp.RelationBasedReasoner
ANY_ARITY, BOTH, NEGATIVE, POSITIVE
 
Constructor Summary
FirstTimePoint(CanonicalMapping mapping, TimeVocabulary vocab)
           
 
Method Summary
protected  void addMetricPointToGraph(CalendarTimePoint ctp, CalendarTimePoint[] beforeAfter)
           
protected  Object calculate(Object[] args)
           
 
Methods inherited from class jtp.time.func.TimePointFunctionReasoner
evaluate
 
Methods inherited from class jtp.func.EvaluableFunctionReasoner
process
 
Methods inherited from class jtp.disp.AbstractRelationBasedBCReasoner
acceptable, getArity, getPolarity, getRelation, literalAcceptable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jtp.disp.RelationBasedReasoner
getArity, getPolarity, getRelation
 

Field Detail

units

protected Symbol[] units

calendarFields

protected static final int[] calendarFields

firstValues

protected static final int[] firstValues
Constructor Detail

FirstTimePoint

public FirstTimePoint(CanonicalMapping mapping,
                      TimeVocabulary vocab)
Method Detail

calculate

protected Object calculate(Object[] args)
                    throws ReasoningException
Specified by:
calculate in class TimePointFunctionReasoner
ReasoningException

addMetricPointToGraph

protected void addMetricPointToGraph(CalendarTimePoint ctp,
                                     CalendarTimePoint[] beforeAfter)
                              throws ReasoningException
ReasoningException

JTP API Documentation