Class CipSTRING
- 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.CipSTRING
-
- Direct Known Subclasses:
OmronSTRING
public class CipSTRING extends BaseString
-
-
Field Summary
Fields Modifier and Type Field Description protected java.nio.charset.Charsetencoding-
Fields inherited from class com.automation_pros.odva.cip.data.BaseDataType
dimensions, memberOffsets, sLogger, variantContext, varyingDimension
-
-
Constructor Summary
Constructors Modifier Constructor Description CipSTRING()CipSTRING(int[] dimensions)CipSTRING(int[] dimensions, java.nio.charset.Charset enc)CipSTRING(BaseDataType<?> data, int... indices)CipSTRING(BaseDataType<?> data, java.nio.charset.Charset enc, int... indices)protectedCipSTRING(CipSTRING data, int[] indices)CipSTRING(java.lang.String s)CipSTRING(java.lang.String s, java.nio.charset.Charset enc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intalignment()Obtain the natural alignment of this data type.protected intbytesImpl(int[] indices)Retrieve the bytes payload size of a single array element (or sole element).CipSTRINGcopy()Produce a deep clone of the object.java.lang.StringcrcName()Obtain the name of this type as used for computing structure CRCs.java.nio.charset.CharsetgetCharset()DataDefinitionSeggetNestingDef()Return the element (not including array) type definition as a Path Segment, using the abbreviated form if a composite data type.intmaxEach()Obtain the largest number of bytes a single item can occupy in encoded form.intminEach()Obtain the smallest number of bytes a single item can occupy in encoded form.protected voidputPayloadImpl(java.nio.ByteBuffer dest, int[] indices)All concrete implementations must supply their per-element encoder here.protected voidsetPayloadImpl(java.nio.ByteBuffer source, int[] indices)All concrete implementations must supply their per-element decoder here.CipSTRINGwrap(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
-
CipSTRING
public CipSTRING()
-
CipSTRING
public CipSTRING(java.lang.String s)
-
CipSTRING
public CipSTRING(java.lang.String s, java.nio.charset.Charset enc)
-
CipSTRING
public CipSTRING(int[] dimensions)
-
CipSTRING
public CipSTRING(int[] dimensions, java.nio.charset.Charset enc)
-
CipSTRING
public CipSTRING(BaseDataType<?> data, int... indices)
-
CipSTRING
public CipSTRING(BaseDataType<?> data, java.nio.charset.Charset enc, int... indices)
-
CipSTRING
protected CipSTRING(CipSTRING data, int[] indices)
-
-
Method Detail
-
minEach
public int minEach()
Description copied from class:BaseDataTypeObtain 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:
minEachin classBaseDataType<java.lang.String>- Returns:
-
maxEach
public int maxEach()
Description copied from class:BaseDataTypeObtain 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:
maxEachin classBaseDataType<java.lang.String>- Returns:
-
alignment
public int alignment()
Description copied from class:BaseDataTypeObtain 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:
alignmentin classBaseDataType<java.lang.String>- Returns:
-
getNestingDef
public DataDefinitionSeg getNestingDef()
Description copied from class:BaseDataTypeReturn the element (not including array) type definition as a Path Segment, using the abbreviated form if a composite data type.- Specified by:
getNestingDefin classBaseDataType<java.lang.String>
-
crcName
public java.lang.String crcName()
Description copied from class:BaseDataTypeObtain the name of this type as used for computing structure CRCs. Can be different from the name(s) used by the CipPath parser.- Overrides:
crcNamein classBaseDataType<java.lang.String>- Returns:
-
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.lang.String>
-
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.lang.String>
-
getCharset
public java.nio.charset.Charset getCharset()
- Specified by:
getCharsetin classBaseString
-
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.lang.String>- Returns:
-
copy
public CipSTRING copy()
Description copied from class:BaseDataTypeProduce a deep clone of the object.- Specified by:
copyin classBaseDataType<java.lang.String>
-
wrap
public CipSTRING wrap(int[] indices)
Description copied from class:BaseDataTypeApplication-side wrapper for inner dimensions. Implementations must update memberOffsets if not not using the protected constructor.- Specified by:
wrapin classBaseDataType<java.lang.String>- Parameters:
indices- Array subscripts. Missing subscripts are allowed.
-
-