Class BaseTimestamp
- java.lang.Object
-
- com.automation_pros.odva.cip.data.BaseDataType<java.sql.Timestamp>
-
- com.automation_pros.odva.cip.data.BaseTimestamp
-
public abstract class BaseTimestamp extends BaseDataType<java.sql.Timestamp>
-
-
Field Summary
Fields Modifier and Type Field Description static java.math.BigIntegerbillionstatic java.math.BigIntegermax64static java.math.BigIntegermillionstatic java.math.BigIntegerthousand-
Fields inherited from class com.automation_pros.odva.cip.data.BaseDataType
dimensions, memberOffsets, sLogger, variantContext, varyingDimension
-
-
Constructor Summary
Constructors Modifier Constructor Description BaseTimestamp()BaseTimestamp(int[] dimensions)protectedBaseTimestamp(BaseTimestamp data, int[] indices)BaseTimestamp(java.sql.Timestamp val)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intbytesEach()Obtain the bytes-per-element of this object's payload encoding.protected intbytesImpl(int[] indices)Retrieve the bytes payload size of a single array element (or sole element).static java.sql.TimestampcoerceDate(java.util.Date d)protected voidcopyToImpl(BaseDataType<?> dest, int[] indices)Support deep copy operations one element at a time.protected voidcopyToImpl(BaseDataType<?> dest, int[] toIndices, int[] fromIndices)Support slice copy operations one element at a time.static java.sql.TimestampfromInstant(java.time.Instant t)static java.sql.TimestampfromMicros(java.math.BigInteger zulu)static java.sql.TimestampfromNanos(java.math.BigInteger zulu)java.sql.Timestampget(int[] indices)Application-side value retrieval.protected voidputPayloadImpl(java.nio.ByteBuffer dest, int[] indices)All concrete implementations must supply their per-element encoder here.voidset(int[] indices, java.sql.Timestamp val)Application-side value storage.voidsetDimensions(int[] newDimensions)Update the lengths of the array dimensions to the given values.protected voidsetFromTokenImpl(java.lang.String token, int[] indices)Override this if single elements can be set from single tokens.protected voidsetPayloadImpl(java.nio.ByteBuffer source, int[] indices)All concrete implementations must supply their per-element decoder here.protected java.lang.StringsingleToString(int[] indices)java.lang.StringstructCRCString()Logix processors don't follow CIP Volume 1 Table C-6.9 in their tag read/write routines for structures.static java.time.InstanttoInstant(java.util.Date date)static java.math.BigIntegertoMicros(java.util.Date date)static java.math.BigIntegertoNanos(java.util.Date date)-
Methods inherited from class com.automation_pros.odva.cip.data.BaseDataType
alignment, browseInner, browseInnerImpl, bytes, checkDimensions, chkAbbrevType, concatIndices, conditionalSuffix, copy, copyTo, CRC16, CRC16, CRC16, crcName, dim2linear, dim2linear, dim2qty, dim2suffix, dimensionToString, doubleValue, extendIntArray, fillIntArray, get, getCompleteDef, getDimensions, getMemberOffsets, getNestingDef, getSymbolType, getTypeCode, getVariantContext, getVaryingDimension, hasOffset, incIdx, intArray, intValue, linear2dim, linear2dim, longValue, makeInstance, maxEach, minEach, nestedBytes, nestedBytesEach, nestedBytesImpl, nestedPutPayload, nestedPutPayloadImpl, nestedSetPayload, nestedSetPayloadImpl, putAbbrevType, putPayload, range2suffix, rawCRC16, set, setFromTokenizer, setFromTokenizerImpl, setFromTokenString, setInt, setLong, setMemberOffsets, setPayload, setupTokenizer, setVariantContext, setVariantDimension, setVariantDimension, sliceTo, toString, wrap
-
-
-
-
Constructor Detail
-
BaseTimestamp
public BaseTimestamp()
-
BaseTimestamp
public BaseTimestamp(java.sql.Timestamp val)
-
BaseTimestamp
public BaseTimestamp(int[] dimensions)
-
BaseTimestamp
protected BaseTimestamp(BaseTimestamp data, int[] indices)
-
-
Method Detail
-
coerceDate
public static java.sql.Timestamp coerceDate(java.util.Date d)
-
fromNanos
public static java.sql.Timestamp fromNanos(java.math.BigInteger zulu)
-
fromInstant
public static java.sql.Timestamp fromInstant(java.time.Instant t)
-
fromMicros
public static java.sql.Timestamp fromMicros(java.math.BigInteger zulu)
-
toNanos
public static java.math.BigInteger toNanos(java.util.Date date)
-
toInstant
public static java.time.Instant toInstant(java.util.Date date)
-
toMicros
public static java.math.BigInteger toMicros(java.util.Date date)
-
setDimensions
public void setDimensions(int[] newDimensions)
Description copied from class:BaseDataTypeUpdate the lengths of the array dimensions to the given values. The number of subscripts must match the current number of subscripts. The operation must be data-preserving.This implementation handles pure Object storage types. Anything else must override.
- Overrides:
setDimensionsin classBaseDataType<java.sql.Timestamp>
-
structCRCString
public java.lang.String structCRCString()
Description copied from class:BaseDataTypeLogix processors don't follow CIP Volume 1 Table C-6.9 in their tag read/write routines for structures. Instead, they run the CRC over comma-separated ASCII type strings that make up the structure. This is referred to in the Logix Data Access Programming Manual as the "Structure Handle".- Overrides:
structCRCStringin classBaseDataType<java.sql.Timestamp>- Returns:
-
get
public java.sql.Timestamp get(int[] indices)
Description copied from class:BaseDataTypeApplication-side value retrieval. Subclasses must implement this function to retrieve elements of the storage array in the application data type.- Specified by:
getin classBaseDataType<java.sql.Timestamp>- Parameters:
indices- Array subscripts. Missing subscripts not allowed.- Returns:
-
set
public void set(int[] indices, java.sql.Timestamp val)Description copied from class:BaseDataTypeApplication-side value storage. Subclasses must implement this function to store one value or complex element into the storage array.- Specified by:
setin classBaseDataType<java.sql.Timestamp>- Parameters:
indices- Array subscripts. Missing subscripts not allowed.
-
bytesEach
public int bytesEach()
Description copied from class:BaseDataTypeObtain the bytes-per-element of this object's payload encoding. Objects with variable length encodings must return zero and implement the bytesImpl(), minEach(), maxEach(), and alignment() methods instead.- Specified by:
bytesEachin classBaseDataType<java.sql.Timestamp>- Returns:
- encoded bytes per element
-
setPayloadImpl
protected void setPayloadImpl(java.nio.ByteBuffer source, int[] indices)Description copied from class:BaseDataTypeAll concrete implementations must supply their per-element decoder here.- Specified by:
setPayloadImplin classBaseDataType<java.sql.Timestamp>
-
setFromTokenImpl
protected void setFromTokenImpl(java.lang.String token, int[] indices)Description copied from class:BaseDataTypeOverride this if single elements can be set from single tokens. The default decodes as Long and uses setLong().- Overrides:
setFromTokenImplin classBaseDataType<java.sql.Timestamp>- Parameters:
token- The single token obtained from the tokenizer for this one element.indices- The complete set of subscripts
-
putPayloadImpl
protected void putPayloadImpl(java.nio.ByteBuffer dest, int[] indices)Description copied from class:BaseDataTypeAll concrete implementations must supply their per-element encoder here.- Specified by:
putPayloadImplin classBaseDataType<java.sql.Timestamp>
-
bytesImpl
protected int bytesImpl(int[] indices)
Description copied from class:BaseDataTypeRetrieve the bytes payload size of a single array element (or sole element). Objects with fixed element sizes may simply return bytesEach() here.- Specified by:
bytesImplin classBaseDataType<java.sql.Timestamp>- Returns:
-
copyToImpl
protected void copyToImpl(BaseDataType<?> dest, int[] indices)
Description copied from class:BaseDataTypeSupport deep copy operations one element at a time.- Specified by:
copyToImplin classBaseDataType<java.sql.Timestamp>
-
copyToImpl
protected void copyToImpl(BaseDataType<?> dest, int[] toIndices, int[] fromIndices)
Description copied from class:BaseDataTypeSupport slice copy operations one element at a time.- Specified by:
copyToImplin classBaseDataType<java.sql.Timestamp>
-
singleToString
protected java.lang.String singleToString(int[] indices)
- Overrides:
singleToStringin classBaseDataType<java.sql.Timestamp>
-
-