Class CipSTRINGI
- java.lang.Object
-
- com.automation_pros.odva.cip.data.BaseDataType<java.util.Map<java.lang.String,java.lang.String>>
-
- com.automation_pros.odva.cip.data.CipSTRINGI
-
public class CipSTRINGI extends BaseDataType<java.util.Map<java.lang.String,java.lang.String>>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CipSTRINGI.IntlStringStorage
-
Field Summary
Fields Modifier and Type Field Description protected static java.util.Map<java.lang.Integer,java.nio.charset.Charset>
csCodes
int
stringImaxEach
-
Fields inherited from class com.automation_pros.odva.cip.data.BaseDataType
dimensions, memberOffsets, sLogger, variantContext, varyingDimension
-
-
Constructor Summary
Constructors Modifier Constructor Description CipSTRINGI(int[] dimensions)
protected
CipSTRINGI(CipSTRINGI data, int[] indices)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
alignment()
Obtain the natural alignment of this data type.java.util.List<PathSegment>
browseInnerImpl()
Complex types that have nested data understood by the DataResolver must enumerate the path segments that are appropriate for the current instance's content.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).CipSTRINGI
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.lang.String
crcName()
Obtain the name of this type as used for computing structure CRCs.static CipSTRINGI
fromEDS(ComplexField cf)
java.util.Map<java.lang.String,java.lang.String>
get(int[] indices)
Application-side value retrieval.java.lang.String
get(int[] indices, java.lang.String lang)
CipSTRINGI.IntlStringStorage
getISS(int[] indices, java.lang.String lang)
DataDefinitionSeg
getNestingDef()
Return the element (not including array) type definition as a Path Segment, using the abbreviated form if a composite data type.protected java.util.Map<java.lang.String,CipSTRINGI.IntlStringStorage>
getStorage(int[] indices)
static CipSTRINGI.IntlStringStorage
makeStringStorage(java.lang.String content)
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.void
set(int[] indices, java.lang.String lang, java.lang.String content)
void
set(int[] indices, java.util.Map<java.lang.String,java.lang.String> val)
Application-side value storage.void
setISS(int[] indices, java.lang.String lang, CipSTRINGI.IntlStringStorage content)
protected void
setPayloadImpl(java.nio.ByteBuffer source, int[] indices)
All concrete implementations must supply their per-element decoder here.CipSTRINGI
wrap(int[] indices)
Application-side wrapper for inner dimensions.-
Methods inherited from class com.automation_pros.odva.cip.data.BaseDataType
browseInner, 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, setDimensions, setFromTokenImpl, setFromTokenizer, setFromTokenizerImpl, setFromTokenString, setInt, setLong, setMemberOffsets, setPayload, setupTokenizer, setVariantContext, setVariantDimension, setVariantDimension, singleToString, sliceTo, structCRCString, toString
-
-
-
-
Field Detail
-
csCodes
protected static final java.util.Map<java.lang.Integer,java.nio.charset.Charset> csCodes
-
stringImaxEach
public final int stringImaxEach
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CipSTRINGI
public CipSTRINGI(int[] dimensions)
-
CipSTRINGI
protected CipSTRINGI(CipSTRINGI data, int[] indices)
-
-
Method Detail
-
fromEDS
public static CipSTRINGI fromEDS(ComplexField cf)
-
makeStringStorage
public static CipSTRINGI.IntlStringStorage makeStringStorage(java.lang.String content)
-
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.Map<java.lang.String,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.util.Map<java.lang.String,java.lang.String>>
- Returns:
-
getStorage
protected java.util.Map<java.lang.String,CipSTRINGI.IntlStringStorage> getStorage(int[] indices)
-
browseInnerImpl
public java.util.List<PathSegment> browseInnerImpl()
Description copied from class:BaseDataType
Complex types that have nested data understood by the DataResolver must enumerate the path segments that are appropriate for the current instance's content. This is typically static for structure members, but dynamic for international string languages.- Overrides:
browseInnerImpl
in classBaseDataType<java.util.Map<java.lang.String,java.lang.String>>
- Returns:
- A list of currently valid path selector segments.
-
getISS
public CipSTRINGI.IntlStringStorage getISS(int[] indices, java.lang.String lang)
-
get
public java.lang.String get(int[] indices, java.lang.String lang)
-
setISS
public void setISS(int[] indices, java.lang.String lang, CipSTRINGI.IntlStringStorage content)
-
set
public void set(int[] indices, java.lang.String lang, java.lang.String content)
-
get
public java.util.Map<java.lang.String,java.lang.String> 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.Map<java.lang.String,java.lang.String>>
- Parameters:
indices
- Array subscripts. Missing subscripts not allowed.- Returns:
-
set
public void set(int[] indices, java.util.Map<java.lang.String,java.lang.String> 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.Map<java.lang.String,java.lang.String>>
- Parameters:
indices
- Array subscripts. Missing subscripts not allowed.
-
wrap
public CipSTRINGI 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.Map<java.lang.String,java.lang.String>>
- Parameters:
indices
- Array subscripts. Missing subscripts are allowed.
-
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.Map<java.lang.String,java.lang.String>>
- Returns:
- encoded bytes per element
-
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.util.Map<java.lang.String,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.util.Map<java.lang.String,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.util.Map<java.lang.String,java.lang.String>>
- Returns:
-
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.Map<java.lang.String,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.util.Map<java.lang.String,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.util.Map<java.lang.String,java.lang.String>>
-
copy
public CipSTRINGI copy()
Description copied from class:BaseDataType
Produce a deep clone of the object.- Specified by:
copy
in classBaseDataType<java.util.Map<java.lang.String,java.lang.String>>
-
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.Map<java.lang.String,java.lang.String>>
-
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.Map<java.lang.String,java.lang.String>>
-
-