Class BaseDate
- java.lang.Object
-
- com.automation_pros.odva.cip.data.BaseDataType<java.util.Date>
-
- com.automation_pros.odva.cip.data.BaseDate
-
- Direct Known Subclasses:
CipOmronDT
,CipWallClock
public abstract class BaseDate extends BaseDataType<java.util.Date>
-
-
Field Summary
-
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
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).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.DataDefinitionSeg
getNestingDef()
Return the element (not including array) type definition as a Path Segment, using the abbreviated form if a composite data type.void
putPayload(java.nio.ByteBuffer dest, int... indices)
All CIP datatypes must provide bytestream payloads.protected void
putPayloadImpl(java.nio.ByteBuffer dest, int[] indices)
All concrete implementations must supply their per-element encoder here.void
setDimensions(int[] newDimensions)
Update the lengths of the array dimensions to the given values.protected void
setFromTokenImpl(java.lang.String token, int[] indices)
Override this if single elements can be set from single tokens.void
setPayload(java.nio.ByteBuffer source, int... indices)
Decode a value from specification wire format to instance storage.protected void
setPayloadImpl(java.nio.ByteBuffer source, int[] indices)
All concrete implementations must supply their per-element decoder here.protected java.lang.String
singleToString(int[] indices)
-
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, 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, range2suffix, rawCRC16, set, set, setFromTokenizer, setFromTokenizerImpl, setFromTokenString, setInt, setLong, setMemberOffsets, setupTokenizer, setVariantContext, setVariantDimension, setVariantDimension, sliceTo, structCRCString, toString, wrap
-
-
-
-
Constructor Detail
-
BaseDate
public BaseDate(CipULINT 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>
-
setDimensions
public void setDimensions(int[] newDimensions)
Description copied from class:BaseDataType
Update 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:
setDimensions
in classBaseDataType<java.util.Date>
-
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>
-
setFromTokenImpl
protected void setFromTokenImpl(java.lang.String token, int[] indices)
Description copied from class:BaseDataType
Override this if single elements can be set from single tokens. The default decodes as Long and uses setLong().- Overrides:
setFromTokenImpl
in classBaseDataType<java.util.Date>
- 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:BaseDataType
All concrete implementations must supply their per-element encoder here.- Specified by:
putPayloadImpl
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>
-
setPayload
public void setPayload(java.nio.ByteBuffer source, int... indices)
Description copied from class:BaseDataType
Decode a value from specification wire format to instance storage.- Overrides:
setPayload
in classBaseDataType<java.util.Date>
-
putPayload
public void putPayload(java.nio.ByteBuffer dest, int... indices)
Description copied from class:BaseDataType
All CIP datatypes must provide bytestream payloads. When an array, and fewer indices are supplied than dimensions, multiple consecutive payloads are to be written from the array into the destination buffer.- Overrides:
putPayload
in classBaseDataType<java.util.Date>
-
singleToString
protected java.lang.String singleToString(int[] indices)
- Overrides:
singleToString
in classBaseDataType<java.util.Date>
-
-