Class CipShortSTRING
- 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.CipShortSTRING
-
public class CipShortSTRING extends BaseString
-
-
Field Summary
Fields Modifier and Type Field Description protected java.nio.charset.Charset
encoding
-
Fields inherited from class com.automation_pros.odva.cip.data.BaseDataType
dimensions, memberOffsets, sLogger, variantContext, varyingDimension
-
-
Constructor Summary
Constructors Modifier Constructor Description CipShortSTRING()
CipShortSTRING(int[] dimensions)
CipShortSTRING(int[] dimensions, java.nio.charset.Charset enc)
CipShortSTRING(BaseDataType<?> data, int... indices)
CipShortSTRING(BaseDataType<?> data, java.nio.charset.Charset enc, int... indices)
protected
CipShortSTRING(CipShortSTRING data, int[] indices)
CipShortSTRING(java.lang.String s)
CipShortSTRING(java.lang.String s, java.nio.charset.Charset enc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
bytesImpl(int[] indices)
Retrieve the bytes payload size of a single array element (or sole element).CipShortSTRING
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.CipShortSTRING
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
alignment, 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
-
CipShortSTRING
public CipShortSTRING()
-
CipShortSTRING
public CipShortSTRING(java.lang.String s)
-
CipShortSTRING
public CipShortSTRING(java.lang.String s, java.nio.charset.Charset enc)
-
CipShortSTRING
public CipShortSTRING(int[] dimensions)
-
CipShortSTRING
public CipShortSTRING(int[] dimensions, java.nio.charset.Charset enc)
-
CipShortSTRING
public CipShortSTRING(BaseDataType<?> data, int... indices)
-
CipShortSTRING
public CipShortSTRING(BaseDataType<?> data, java.nio.charset.Charset enc, int... indices)
-
CipShortSTRING
protected CipShortSTRING(CipShortSTRING 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:
-
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 CipShortSTRING copy()
Description copied from class:BaseDataType
Produce a deep clone of the object.- Specified by:
copy
in classBaseDataType<java.lang.String>
-
wrap
public CipShortSTRING 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.
-
-