Class CipDT
- java.lang.Object
-
- com.automation_pros.odva.cip.data.BaseDataType<java.util.Date>
-
- com.automation_pros.odva.cip.data.CipDT
-
public class CipDT extends BaseDataType<java.util.Date>
A combination of milliseconds since midnight of a particular day, encoded in four bytes, and unsigned number of days since 1972-01-01, encoded in two bytes. No timezone or daylight savings time adjustments. Delivered as if UTC. Can represent milliseconds UTC up to 2151-06-06 23:59:59.999.
-
-
Field Summary
Fields Modifier and Type Field Description static long
offset
-
Fields inherited from class com.automation_pros.odva.cip.data.BaseDataType
dimensions, memberOffsets, sLogger, variantContext, varyingDimension
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
alignment()
Obtain the natural alignment of this data type.int
bytesEach()
Obtain the bytes-per-element of this object's payload encoding.protected int
bytesImpl(int[] indices)
Retrieve the bytes payload size of a single array element (or sole element).BaseDataType<?>
copy()
Produce a deep clone of the object.protected void
copyToImpl(BaseDataType<?> dest, int[] indices)
Support deep copy operations one element at a time.protected void
copyToImpl(BaseDataType<?> dest, int[] toIndices, int[] fromIndices)
Support slice copy operations one element at a time.java.util.Date
get(int[] indices)
Application-side value retrieval.DataDefinitionSeg
getNestingDef()
Return the element (not including array) type definition as a Path Segment, using the abbreviated form if a composite data type.protected void
putPayloadImpl(java.nio.ByteBuffer dest, int[] indices)
All concrete implementations must supply their per-element encoder here.void
set(int[] indices, java.util.Date val)
Application-side value storage.protected void
setPayloadImpl(java.nio.ByteBuffer source, int[] indices)
All concrete implementations must supply their per-element decoder here.BaseDataType<java.util.Date>
wrap(int[] indices)
Application-side wrapper for inner dimensions.-
Methods inherited from class com.automation_pros.odva.cip.data.BaseDataType
browseInner, browseInnerImpl, bytes, checkDimensions, chkAbbrevType, concatIndices, conditionalSuffix, copyTo, CRC16, CRC16, CRC16, crcName, dim2linear, dim2linear, dim2qty, dim2suffix, dimensionToString, doubleValue, extendIntArray, fillIntArray, get, getCompleteDef, getDimensions, getMemberOffsets, 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, setDimensions, setFromTokenImpl, setFromTokenizer, setFromTokenizerImpl, setFromTokenString, setInt, setLong, setMemberOffsets, setPayload, setupTokenizer, setVariantContext, setVariantDimension, setVariantDimension, singleToString, sliceTo, structCRCString, toString
-
-
-
-
Field Detail
-
offset
public static final long offset
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CipDT
public CipDT()
-
CipDT
public CipDT(java.util.Date val)
-
CipDT
public CipDT(int[] dimensions)
-
CipDT
protected CipDT(CipDT data, int[] indices)
-
-
Method Detail
-
getNestingDef
public DataDefinitionSeg getNestingDef()
Description copied from class:BaseDataType
Return the element (not including array) type definition as a Path Segment, using the abbreviated form if a composite data type.- Specified by:
getNestingDef
in classBaseDataType<java.util.Date>
-
get
public java.util.Date get(int[] indices)
Description copied from class:BaseDataType
Application-side value retrieval. Subclasses must implement this function to retrieve elements of the storage array in the application data type.- Specified by:
get
in classBaseDataType<java.util.Date>
- Parameters:
indices
- Array subscripts. Missing subscripts not allowed.- Returns:
-
set
public void set(int[] indices, java.util.Date val)
Description copied from class:BaseDataType
Application-side value storage. Subclasses must implement this function to store one value or complex element into the storage array.- Specified by:
set
in classBaseDataType<java.util.Date>
- Parameters:
indices
- Array subscripts. Missing subscripts not allowed.
-
alignment
public int alignment()
Description copied from class:BaseDataType
Obtain the natural alignment of this data type. Used in structures to compute min/max offset and alignment.Types where bytesEach is a constant should override this to return a suitable constant too, as a performance optimization.
- Overrides:
alignment
in classBaseDataType<java.util.Date>
- Returns:
-
bytesEach
public int bytesEach()
Description copied from class:BaseDataType
Obtain 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:
bytesEach
in classBaseDataType<java.util.Date>
- Returns:
- encoded bytes per element
-
bytesImpl
protected int bytesImpl(int[] indices)
Description copied from class:BaseDataType
Retrieve the bytes payload size of a single array element (or sole element). Objects with fixed element sizes may simply return bytesEach() here.- Specified by:
bytesImpl
in classBaseDataType<java.util.Date>
- Returns:
-
setPayloadImpl
protected void setPayloadImpl(java.nio.ByteBuffer source, int[] indices)
Description copied from class:BaseDataType
All concrete implementations must supply their per-element decoder here.- Specified by:
setPayloadImpl
in classBaseDataType<java.util.Date>
-
putPayloadImpl
protected void putPayloadImpl(java.nio.ByteBuffer dest, int[] indices)
Description copied from class:BaseDataType
All concrete implementations must supply their per-element encoder here.- Specified by:
putPayloadImpl
in classBaseDataType<java.util.Date>
-
wrap
public BaseDataType<java.util.Date> wrap(int[] indices)
Description copied from class:BaseDataType
Application-side wrapper for inner dimensions. Implementations must update memberOffsets if not not using the protected constructor.- Specified by:
wrap
in classBaseDataType<java.util.Date>
- Parameters:
indices
- Array subscripts. Missing subscripts are allowed.
-
copy
public BaseDataType<?> copy()
Description copied from class:BaseDataType
Produce a deep clone of the object.- Specified by:
copy
in classBaseDataType<java.util.Date>
-
copyToImpl
protected void copyToImpl(BaseDataType<?> dest, int[] indices)
Description copied from class:BaseDataType
Support deep copy operations one element at a time.- Specified by:
copyToImpl
in classBaseDataType<java.util.Date>
-
copyToImpl
protected void copyToImpl(BaseDataType<?> dest, int[] toIndices, int[] fromIndices)
Description copied from class:BaseDataType
Support slice copy operations one element at a time.- Specified by:
copyToImpl
in classBaseDataType<java.util.Date>
-
-