Class DateTimeBuffer
- java.lang.Object
-
- com.rapidminer.belt.buffer.DateTimeBuffer
-
public abstract class DateTimeBuffer extends java.lang.ObjectAbstract super-class of buffers for date-time instances- Author:
- Gisa Meier
- See Also:
Buffers
-
-
Field Summary
Fields Modifier and Type Field Description protected static longMAX_SECONDprotected static longMIN_SECOND
-
Constructor Summary
Constructors Constructor Description DateTimeBuffer()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.time.Instantget(int index)Retrieves the value at the given index.abstract voidset(int index, long epochSeconds)Sets the data at the given index to the given value.abstract voidset(int index, long epochSeconds, int nanoseconds)Sets the data at the given index to aInstantvalue by providing the epoch seconds and nanoseconds separately.abstract voidset(int index, java.time.Instant instant)Sets the data at the given index to the given value.abstract intsize()abstract com.rapidminer.belt.column.DateTimeColumntoColumn()Creates a new date-time column from the buffer.java.lang.StringtoString()
-
-
-
Method Detail
-
get
public abstract java.time.Instant get(int index)
Retrieves the value at the given index.Set operations are not atomic. Multiple threads working on the same index require additional synchronization, however, concurrent operations on disjoint intervals do not.
- Parameters:
index- the index to look up- Returns:
- the value at the index
-
set
public abstract void set(int index, java.time.Instant instant)Sets the data at the given index to the given value.This method is not atomic. Multiple threads working on the same index require additional synchronization, however, concurrent operations on disjoint intervals do not.
- Parameters:
index- the index where the value should be setinstant- the instant it should be set to, can benull
-
set
public abstract void set(int index, long epochSeconds)Sets the data at the given index to the given value. To set missing values please useset(index, null).This method is not atomic. Multiple threads working on the same index require additional synchronization, however, concurrent operations on disjoint intervals do not.
If the buffer does not support sub-second precision, any given nanoseconds will be ignored. In particular, no rounding to the next full second is applied.
- Parameters:
index- the index where the value should be setepochSeconds- the number of seconds from 1970-01-01T00:00:00Z, can be negative but must be in rangeInstant.MIN_SECONDtoInstant.MAX_SECOND- Throws:
java.lang.IllegalArgumentException- if epochSeconds is smaller thanInstant.MIN_SECONDor bigger thanInstant.MAX_SECOND
-
set
public abstract void set(int index, long epochSeconds, int nanoseconds)Sets the data at the given index to aInstantvalue by providing the epoch seconds and nanoseconds separately.This method is not atomic. Multiple threads working on the same index require additional synchronization, however, concurrent operations on disjoint intervals do not.
If the buffer does not support sub-second precision, any given nanoseconds will be ignored. In particular, no rounding to the next full second is applied.
- Parameters:
index- the index where the value should be setepochSeconds- the number of seconds from 1970-01-01T00:00:00Z, can be negative but must be in the rangeInstant.MIN_SECONDtoInstant.MAX_SECONDnanoseconds- the number of nanoseconds, must be in the range 0 to 999,999,999.- Throws:
java.lang.IllegalArgumentException- if epochSeconds is smaller thanInstant.MIN_SECONDandInstant.MAX_SECONDor nanoseconds is negative or bigger than 999,999,999
-
size
public abstract int size()
- Returns:
- the size of the buffer
-
toColumn
public abstract com.rapidminer.belt.column.DateTimeColumn toColumn()
Creates a new date-time column from the buffer.- Returns:
- a new
DateTimeColumn
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-