Class DateTimeBuffer
- java.lang.Object
-
- com.rapidminer.belt.buffer.DateTimeBuffer
-
public abstract class DateTimeBuffer extends java.lang.Object
Abstract super-class of buffers for date-time instances- Author:
- Gisa Meier
- See Also:
Buffers
-
-
Field Summary
Fields Modifier and Type Field Description protected static long
MAX_SECOND
protected static long
MIN_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.Instant
get(int index)
Retrieves the value at the given index.abstract void
set(int index, long epochSeconds)
Sets the data at the given index to the given value.abstract void
set(int index, long epochSeconds, int nanoseconds)
Sets the data at the given index to aInstant
value by providing the epoch seconds and nanoseconds separately.abstract void
set(int index, java.time.Instant instant)
Sets the data at the given index to the given value.abstract int
size()
abstract com.rapidminer.belt.column.DateTimeColumn
toColumn()
Creates a new date-time column from the buffer.java.lang.String
toString()
-
-
-
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_SECOND
toInstant.MAX_SECOND
- Throws:
java.lang.IllegalArgumentException
- if epochSeconds is smaller thanInstant.MIN_SECOND
or bigger thanInstant.MAX_SECOND
-
set
public abstract void set(int index, long epochSeconds, int nanoseconds)
Sets the data at the given index to aInstant
value 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_SECOND
toInstant.MAX_SECOND
nanoseconds
- the number of nanoseconds, must be in the range 0 to 999,999,999.- Throws:
java.lang.IllegalArgumentException
- if epochSeconds is smaller thanInstant.MIN_SECOND
andInstant.MAX_SECOND
or 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:
toString
in classjava.lang.Object
-
-