org.deri.iris.builtins.date
Class YearPartBuiltin
java.lang.Object
org.deri.iris.builtins.AbstractBuiltin
org.deri.iris.builtins.FunctionalBuiltin
org.deri.iris.builtins.date.YearPartBuiltin
- All Implemented Interfaces:
- Comparable<IAtom>, IAtom, IBuiltinAtom
public class YearPartBuiltin
- extends FunctionalBuiltin
Represents the RIF built-in functions func:year-from-dateTime,
func:year-from-date and func:years-from-duration.
|
Method Summary |
protected ITerm |
computeResult(ITerm[] terms)
Computes the result when all terms but the term at the last position are
known. |
YearPartBuiltin
public YearPartBuiltin(ITerm... terms)
- Constructor. Two terms must be passed to the constructor, otherwise an
exception will be thrown.
- Parameters:
terms - The terms.
- Throws:
IllegalArgumentException - If one of the terms is null.
IllegalArgumentException - If the number of terms submitted is not
2.
IllegalArgumentException - If terms is null.
computeResult
protected ITerm computeResult(ITerm[] terms)
throws EvaluationException
- Description copied from class:
FunctionalBuiltin
- Computes the result when all terms but the term at the last position are
known.
- Specified by:
computeResult in class FunctionalBuiltin
- Parameters:
terms - The terms, where the terms at the last position is a
variable representing the result.
- Returns:
- The computed term, or
null if the operation is
unsuccessful.
- Throws:
EvaluationException - If an error occurs.