Class CipSTRING2
- java.lang.Object
-
- com.automation_pros.odva.cip.data.BaseDataType<java.lang.String>
-
- com.automation_pros.odva.cip.data.BaseString
-
- com.automation_pros.odva.cip.data.CipSTRING2
-
public class CipSTRING2 extends BaseString
-
-
Field Summary
-
Fields inherited from class com.automation_pros.odva.cip.data.BaseDataType
dimensions, memberOffsets, sLogger, variantContext, varyingDimension
-
-
Constructor Summary
Constructors Modifier Constructor Description CipSTRING2()
CipSTRING2(int[] dimensions)
CipSTRING2(BaseDataType<?> data, int... indices)
protected
CipSTRING2(CipSTRING2 data, int[] indices)
CipSTRING2(java.lang.String s)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
alignment()
Obtain the natural alignment of this data type.protected int
bytesImpl(int[] indices)
Retrieve the bytes payload size of a single array element (or sole element).CipSTRING2
copy()
Produce a deep clone of the object.java.lang.String
crcName()
Obtain the name of this type as used for computing structure CRCs.java.nio.charset.Charset
getCharset()
DataDefinitionSeg
getNestingDef()
Return the element (not including array) type definition as a Path Segment, using the abbreviated form if a composite data type.int
maxEach()
Obtain the largest number of bytes a single item can occupy in encoded form.int
minEach()
Obtain the smallest number of bytes a single item can occupy in encoded form.protected void
putPayloadImpl(java.nio.ByteBuffer dest, int[] indices)
All concrete implementations must supply their per-element encoder here.protected void
setPayloadImpl(java.nio.ByteBuffer source, int[] indices)
All concrete implementations must supply their per-element decoder here.CipSTRING2
wrap(int[] indices)
Application-side wrapper for inner dimensions.-
Methods inherited from class com.automation_pros.odva.cip.data.BaseString
bytesEach, copyToImpl, copyToImpl, dataToRawString, get, rawStringToData, set, setDimensions, setFromTokenImpl, singleToString
-
Methods inherited from class com.automation_pros.odva.cip.data.BaseDataType
browseInner, browseInnerImpl, bytes, checkDimensions, chkAbbrevType, concatIndices, conditionalSuffix, copyTo, CRC16, CRC16, CRC16, dim2linear, dim2linear, dim2qty, dim2suffix, dimensionToString, doubleValue, extendIntArray, fillIntArray, get, getCompleteDef, getDimensions, getMemberOffsets, getSymbolType, getTypeCode, getVariantContext, getVaryingDimension, hasOffset, incIdx, intArray, intValue, linear2dim, linear2dim, longValue, makeInstance, nestedBytes, nestedBytesEach, nestedBytesImpl, nestedPutPayload, nestedPutPayloadImpl, nestedSetPayload, nestedSetPayloadImpl, putAbbrevType, putPayload, range2suffix, rawCRC16, set, setFromTokenizer, setFromTokenizerImpl, setFromTokenString, setInt, setLong, setMemberOffsets, setPayload, setupTokenizer, setVariantContext, setVariantDimension, setVariantDimension, sliceTo, structCRCString, toString
-
-
-
-
Constructor Detail
-
CipSTRING2
public CipSTRING2()
-
CipSTRING2
public CipSTRING2(java.lang.String s)
-
CipSTRING2
public CipSTRING2(int[] dimensions)
-
CipSTRING2
public CipSTRING2(BaseDataType<?> data, int... indices)
-
CipSTRING2
protected CipSTRING2(CipSTRING2 data, int[] indices)
-
-
Method Detail
-
minEach
public int minEach()
Description copied from class:BaseDataType
Obtain the smallest number of bytes a single item can occupy in encoded form. Used in structures to compute min/max offset and total structure size range.Types where bytesEach is a constant should override this to return that constant too, as a performance optimization.
- Overrides:
minEach
in classBaseDataType<java.lang.String>
- Returns:
-
maxEach
public int maxEach()
Description copied from class:BaseDataType
Obtain the largest number of bytes a single item can occupy in encoded form. Used in structures to compute min/max offset and total structure size range.Types where bytesEach is a constant should override this to return that constant too, as a performance optimization.
- Overrides:
maxEach
in classBaseDataType<java.lang.String>
- Returns:
-
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.lang.String>
- Returns:
-
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.lang.String>
-
crcName
public java.lang.String crcName()
Description copied from class:BaseDataType
Obtain the name of this type as used for computing structure CRCs. Can be different from the name(s) used by the CipPath parser.- Overrides:
crcName
in classBaseDataType<java.lang.String>
- 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.lang.String>
-
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.lang.String>
-
getCharset
public java.nio.charset.Charset getCharset()
- Specified by:
getCharset
in classBaseString
-
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.lang.String>
- Returns:
-
copy
public CipSTRING2 copy()
Description copied from class:BaseDataType
Produce a deep clone of the object.- Specified by:
copy
in classBaseDataType<java.lang.String>
-
wrap
public CipSTRING2 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.lang.String>
- Parameters:
indices
- Array subscripts. Missing subscripts are allowed.
-
-