Class BaseString
- java.lang.Object
-
- com.automation_pros.odva.cip.data.BaseDataType<java.lang.String>
-
- com.automation_pros.odva.cip.data.BaseString
-
- Direct Known Subclasses:
CipShortSTRING
,CipSTRING
,CipSTRING2
public abstract class BaseString extends BaseDataType<java.lang.String>
-
-
Field Summary
-
Fields inherited from class com.automation_pros.odva.cip.data.BaseDataType
dimensions, memberOffsets, sLogger, variantContext, varyingDimension
-
-
Constructor Summary
Constructors Modifier Constructor Description BaseString()
BaseString(int[] dimensions)
BaseString(BaseDataType<?> data, int... indices)
protected
BaseString(BaseString data, int[] indices)
BaseString(java.lang.String s)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description int
bytesEach()
Obtain the bytes-per-element of this object's payload encoding.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.protected java.lang.String
dataToRawString(BaseDataType<?> dat)
java.lang.String
get(int[] indices)
Application-side value retrieval.abstract java.nio.charset.Charset
getCharset()
protected void
rawStringToData(BaseDataType<?> dat, java.lang.String val)
void
set(int[] indices, java.lang.String val)
Application-side value storage.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.protected java.lang.String
singleToString(int[] indices)
-
Methods inherited from class com.automation_pros.odva.cip.data.BaseDataType
alignment, browseInner, browseInnerImpl, bytes, bytesImpl, checkDimensions, chkAbbrevType, concatIndices, conditionalSuffix, copy, copyTo, CRC16, CRC16, CRC16, crcName, dim2linear, dim2linear, dim2qty, dim2suffix, dimensionToString, doubleValue, extendIntArray, fillIntArray, get, getCompleteDef, getDimensions, getMemberOffsets, getNestingDef, getSymbolType, getTypeCode, getVariantContext, getVaryingDimension, hasOffset, incIdx, intArray, intValue, linear2dim, linear2dim, longValue, makeInstance, maxEach, minEach, nestedBytes, nestedBytesEach, nestedBytesImpl, nestedPutPayload, nestedPutPayloadImpl, nestedSetPayload, nestedSetPayloadImpl, putAbbrevType, putPayload, putPayloadImpl, range2suffix, rawCRC16, set, setFromTokenizer, setFromTokenizerImpl, setFromTokenString, setInt, setLong, setMemberOffsets, setPayload, setPayloadImpl, setupTokenizer, setVariantContext, setVariantDimension, setVariantDimension, sliceTo, structCRCString, toString, wrap
-
-
-
-
Constructor Detail
-
BaseString
public BaseString()
-
BaseString
public BaseString(java.lang.String s)
-
BaseString
public BaseString(int[] dimensions)
-
BaseString
public BaseString(BaseDataType<?> data, int... indices)
-
BaseString
protected BaseString(BaseString data, int[] indices)
-
-
Method Detail
-
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.lang.String>
-
dataToRawString
protected java.lang.String dataToRawString(BaseDataType<?> dat)
-
get
public 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.lang.String>
- Parameters:
indices
- Array subscripts. Missing subscripts not allowed.- Returns:
-
rawStringToData
protected void rawStringToData(BaseDataType<?> dat, java.lang.String val)
-
set
public void set(int[] indices, 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.lang.String>
- Parameters:
indices
- Array subscripts. Missing subscripts not allowed.
-
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.lang.String>
- Parameters:
token
- The single token obtained from the tokenizer for this one element.indices
- The complete set of subscripts
-
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.lang.String>
- Returns:
- encoded bytes per element
-
getCharset
public abstract java.nio.charset.Charset getCharset()
-
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.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.lang.String>
-
singleToString
protected java.lang.String singleToString(int[] indices)
- Overrides:
singleToString
in classBaseDataType<java.lang.String>
-
-