Class 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 a Instant 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()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • MIN_SECOND

        protected static final long MIN_SECOND
      • MAX_SECOND

        protected static final long MAX_SECOND
    • Constructor Detail

      • DateTimeBuffer

        public DateTimeBuffer()
    • 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 set
        instant - the instant it should be set to, can be null
      • 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 use set(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 set
        epochSeconds - the number of seconds from 1970-01-01T00:00:00Z, can be negative but must be in range Instant.MIN_SECOND to Instant.MAX_SECOND
        Throws:
        java.lang.IllegalArgumentException - if epochSeconds is smaller than Instant.MIN_SECOND or bigger than Instant.MAX_SECOND
      • set

        public abstract void set​(int index,
                                 long epochSeconds,
                                 int nanoseconds)
        Sets the data at the given index to a Instant 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 set
        epochSeconds - the number of seconds from 1970-01-01T00:00:00Z, can be negative but must be in the range Instant.MIN_SECOND to Instant.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 than Instant.MIN_SECOND and Instant.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 class java.lang.Object