|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.data.ExprInfo
org.basex.query.expr.Expr
org.basex.query.value.Value
org.basex.query.value.item.Item
org.basex.query.value.item.ADateDur
org.basex.query.value.item.ADate
public abstract class ADate
Abstract super class for date items.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.basex.query.expr.Expr |
---|
Expr.Flag |
Field Summary | |
---|---|
protected byte |
day
Day ( 0-30 ). |
protected static byte[] |
DAYS
Day per months. |
protected static java.lang.String |
DD
Pattern for two digits. |
static javax.xml.datatype.DatatypeFactory |
df
Data factory. |
protected byte |
hou
Hour ( 0-59 ). |
protected byte |
min
Minute ( 0-59 ). |
protected byte |
mon
Month ( 0-11 ). |
protected long |
yea
Year. |
protected static java.lang.String |
YEAR
Year pattern. |
protected short |
zon
Timezone in minutes ( -14*60-14*60 ). |
protected static java.lang.String |
ZONE
Date pattern. |
Fields inherited from class org.basex.query.value.item.ADateDur |
---|
BD100, BD1000, BD146097, BD1461, BD153, BD2, BD3600, BD365, BD36524, BD36525, BD366, BD4, BD5, BD60, BDMAXLONG, DAYSECONDS, sec |
Fields inherited from class org.basex.query.value.item.Item |
---|
score, UNDEF |
Fields inherited from class org.basex.query.value.Value |
---|
type |
Method Summary | |
---|---|
protected void |
calc(DTDur dur,
boolean p)
Adds/subtracts the specified dayTime duration. |
long |
day()
Returns the days. |
static java.math.BigDecimal |
days(long yea,
int mon,
int day)
Returns a day count for the specified years, months and days. |
int |
diff(Item it,
Collation coll,
InputInfo ii)
Returns the difference between the current and the specified item. |
static int |
dpm(long yea,
int mon)
Returns days per month, considering leap years. |
boolean |
eq(Item it,
Collation coll,
InputInfo ii)
Checks the items for equality. |
int |
hash(InputInfo ii)
Returns a hash code for this value. |
long |
hou()
Returns the hours (0-23). |
long |
min()
Returns the minutes (0-59). |
long |
mon()
Returns the months. |
protected static void |
prefix(TokenBuilder tb,
long n,
int z)
Prefixes the specified number of zero digits before a number. |
java.math.BigDecimal |
sec()
Returns the seconds (0-59), including the fractional part. |
byte[] |
string(InputInfo ii)
Returns a string representation of the value. |
abstract void |
timeZone(DTDur tz,
boolean spec,
InputInfo ii)
Adjusts the timezone. |
javax.xml.datatype.XMLGregorianCalendar |
toJava()
Returns a Java representation of the value. |
java.lang.String |
toString()
|
protected void |
tz(DTDur tz,
boolean spec,
InputInfo ii)
Adjusts the timezone. |
long |
yea()
Returns the years. |
int |
zon()
Returns the timezone in minutes. |
protected void |
zone(TokenBuilder tb)
Adds the time zone to the specified token builder. |
Methods inherited from class org.basex.query.value.item.ADateDur |
---|
dateErr, toDecimal, toLong |
Methods inherited from class org.basex.query.value.item.Item |
---|
bool, castErr, comparable, dbl, dec, description, ebv, equiv, flt, homogeneous, input, isItem, item, itemAt, iter, iterable, itr, materialize, plan, score, score, size, test, type, typeId, writeTo, xdmInfo |
Methods inherited from class org.basex.query.value.Value |
---|
accept, cache, checkUp, compile, copy, count, data, exprSize, has, inline, isValue, iter, iterator, removable, serialize, value |
Methods inherited from class org.basex.query.expr.Expr |
---|
addText, compEbv, copy, hasFreeVars, indexAccessible, indexEquivalent, inlineAll, isEmpty, isFunction, isVacuous, markTailCalls, optimize, sameAs, uses, visitAll |
Methods inherited from class org.basex.data.ExprInfo |
---|
addPlan, addPlan, info, planAttr, planElem |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String DD
protected static final java.lang.String YEAR
protected static final java.lang.String ZONE
protected static final byte[] DAYS
protected long yea
Long#MAX_VALUE
-1: ADLong.MIN_VALUE
: BC, +1 addedLong.MAX_VALUE
: undefined
protected byte mon
0-11
). -1
: undefined.
protected byte day
0-30
). -1
: undefined.
protected byte hou
0-59
). -1
: undefined.
protected byte min
0-59
). -1
: undefined.
protected short zon
-14*60-14*60
). Short.MAX_VALUE
: undefined.
public static javax.xml.datatype.DatatypeFactory df
Method Detail |
---|
protected final void calc(DTDur dur, boolean p)
dur
- durationp
- plus/minus flagpublic abstract void timeZone(DTDur tz, boolean spec, InputInfo ii) throws QueryException
tz
- timezonespec
- indicates if zone has been specified (can be null
)ii
- input info
QueryException
- query exceptionprotected void tz(DTDur tz, boolean spec, InputInfo ii) throws QueryException
tz
- timezonespec
- indicates if zone has been specified (can be null
)ii
- input info
QueryException
- query exceptionpublic final long yea()
ADateDur
yea
in class ADateDur
public final long mon()
ADateDur
mon
in class ADateDur
public final long day()
ADateDur
day
in class ADateDur
public final long hou()
ADateDur
hou
in class ADateDur
public final long min()
ADateDur
min
in class ADateDur
public final java.math.BigDecimal sec()
ADateDur
sec
in class ADateDur
public final int zon()
public byte[] string(InputInfo ii)
Item
string
in class Item
ii
- input info, use null
if none is available
protected void zone(TokenBuilder tb)
tb
- token builderprotected static void prefix(TokenBuilder tb, long n, int z)
tb
- token buildern
- number to be printedz
- maximum number of zero digitspublic final boolean eq(Item it, Collation coll, InputInfo ii) throws QueryException
Item
eq
in class Item
it
- item to be comparedcoll
- collationii
- input info
QueryException
- query exceptionpublic int hash(InputInfo ii) throws QueryException
Value
hash
in class Item
ii
- input info
QueryException
- if atomization can't be applied (e.g. function item)public int diff(Item it, Collation coll, InputInfo ii) throws QueryException
Item
diff
in class Item
it
- item to be comparedcoll
- query contextii
- input info
QueryException
- query exceptionpublic final javax.xml.datatype.XMLGregorianCalendar toJava()
Value
toJava
in class Value
public static java.math.BigDecimal days(long yea, int mon, int day)
yea
- yearmon
- monthday
- days
public static int dpm(long yea, int mon)
yea
- yearmon
- month
public final java.lang.String toString()
toString
in class ExprInfo
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |