Package com.exasol.datatype.value
Class AbstractInterval
- java.lang.Object
-
- com.exasol.datatype.value.AbstractInterval
-
- Direct Known Subclasses:
IntervalDayToSecond
,IntervalYearToMonth
public abstract class AbstractInterval extends Object
Abstract base class for interval types.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractInterval(long value)
Create an interval from a long integer value.protected
AbstractInterval(long absoluteValue, boolean positive)
Create an interval from an absolute value and a sign.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
getSign()
Produce the sign of the interval.protected long
getSignedValue()
Get the signed long integer value.protected static long
parseMatchingGroupToLong(Matcher matcher, int groupNumber)
Parse a group that came out of a string match to an interval.
-
-
-
Constructor Detail
-
AbstractInterval
protected AbstractInterval(long value)
Create an interval from a long integer value.- Parameters:
value
- long integer value
-
AbstractInterval
protected AbstractInterval(long absoluteValue, boolean positive)
Create an interval from an absolute value and a sign.- Parameters:
absoluteValue
- absolute interval valuepositive
- sign indicator
-
-
Method Detail
-
parseMatchingGroupToLong
protected static long parseMatchingGroupToLong(Matcher matcher, int groupNumber)
Parse a group that came out of a string match to an interval.- Parameters:
matcher
- matcher applied on the interval stringgroupNumber
- group that matched- Returns:
- long value representing the interval
-
getSign
protected String getSign()
Produce the sign of the interval.- Returns:
- "+" if positive, "-" if negative
-
getSignedValue
protected long getSignedValue()
Get the signed long integer value.- Returns:
- signed value
-
-