Class AliasDefSeg
- java.lang.Object
-
- com.automation_pros.odva.cip.path.PathSegment
-
- com.automation_pros.odva.cip.path.DataDefinitionSeg
-
- com.automation_pros.odva.cip.path.AliasDefSeg
-
- All Implemented Interfaces:
java.lang.Comparable<PathSegment>
public class AliasDefSeg extends DataDefinitionSeg
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAliasDefSeg.DecoderDecode bytes expected to contain one encoded path segment.static classAliasDefSeg.Parser-
Nested classes/interfaces inherited from class com.automation_pros.odva.cip.path.DataDefinitionSeg
DataDefinitionSeg.DataDefinitionFragment
-
Nested classes/interfaces inherited from class com.automation_pros.odva.cip.path.PathSegment
PathSegment.HasAlternateHex
-
-
Field Summary
Fields Modifier and Type Field Description protected CipPathaliasOfDecoratedDefSegresolvesTo-
Fields inherited from class com.automation_pros.odva.cip.path.DataDefinitionSeg
sLogger
-
Fields inherited from class com.automation_pros.odva.cip.path.PathSegment
identifierChars, segtype
-
-
Constructor Summary
Constructors Constructor Description AliasDefSeg()AliasDefSeg(java.util.List<PathSegment> selectors)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intalignment(DataContext ctx)Alignment is normally the natural size of a primitive element.intcompareTo(PathSegment o)protected BaseDataType<?>construct(int[] dimensions, DataContext ctx)Aliases are only constructed when accessed individually, when they behave as a solo target.booleanequals(java.lang.Object o)java.util.List<PathSegment>getAliasOf()intgetBytes()Obtain the number of bytes needed to encode this segment instance in packed format.intgetSizeImpl(DataContext ctx)Return the number of bytes occupied by a single instance of the given data type.java.util.List<java.lang.String>getTokens()inthashCode()intmaxSize(DataContext ctx)Some data types need to offer a range of sizes for the encoded form of their data.intminSize(DataContext ctx)Some data types need to offer a range of sizes for the encoded form of their data.voidput(java.nio.ByteBuffer dest, boolean padded)Encode the current instance to the given destination.PathSegmentset(java.nio.ByteBuffer source, boolean padded)Replace the current instance content with the decoded source bytes.voidsetAliasOf(java.util.List<PathSegment> aliasOf)java.lang.StringsimpleString()Supply s simple descriptive name usable when browsing a hierarchy.-
Methods inherited from class com.automation_pros.odva.cip.path.DataDefinitionSeg
browseInner, construct, follow, followOffsets, fromClass, fromData, getPermItem, getSize, isBoolHost, isBoolImpl, isStringData, nestedMaxSize, nestedMinSize, nestedSize, nestedSizeImpl
-
Methods inherited from class com.automation_pros.odva.cip.path.PathSegment
decode, decodeAll, getSegtype, getWords, hexString, mergeTokens, registerHandler, setSegtype, toString
-
-
-
-
Field Detail
-
aliasOf
protected CipPath aliasOf
-
resolvesTo
public DecoratedDefSeg resolvesTo
-
-
Constructor Detail
-
AliasDefSeg
public AliasDefSeg()
-
AliasDefSeg
public AliasDefSeg(java.util.List<PathSegment> selectors)
-
-
Method Detail
-
getAliasOf
public java.util.List<PathSegment> getAliasOf()
-
setAliasOf
public void setAliasOf(java.util.List<PathSegment> aliasOf)
-
getSizeImpl
public int getSizeImpl(DataContext ctx)
Description copied from class:DataDefinitionSegReturn the number of bytes occupied by a single instance of the given data type. When the data is indirect, size is zero. When the data is variable length, size is -1;- Specified by:
getSizeImplin classDataDefinitionSeg- Returns:
- Number of bytes.
-
minSize
public int minSize(DataContext ctx)
Description copied from class:DataDefinitionSegSome data types need to offer a range of sizes for the encoded form of their data. The common case is fixed.- Overrides:
minSizein classDataDefinitionSeg- Returns:
-
maxSize
public int maxSize(DataContext ctx)
Description copied from class:DataDefinitionSegSome data types need to offer a range of sizes for the encoded form of their data. The common case is fixed.- Overrides:
maxSizein classDataDefinitionSeg- Returns:
-
alignment
public int alignment(DataContext ctx)
Description copied from class:DataDefinitionSegAlignment is normally the natural size of a primitive element. Structured types and variable length types must override this method.- Overrides:
alignmentin classDataDefinitionSeg- Returns:
-
construct
protected BaseDataType<?> construct(int[] dimensions, DataContext ctx)
Aliases are only constructed when accessed individually, when they behave as a solo target.- Specified by:
constructin classDataDefinitionSeg- Parameters:
dimensions-ctx-- Returns:
-
compareTo
public int compareTo(PathSegment o)
- Specified by:
compareToin interfacejava.lang.Comparable<PathSegment>- Overrides:
compareToin classPathSegment
-
simpleString
public java.lang.String simpleString()
Description copied from class:PathSegmentSupply s simple descriptive name usable when browsing a hierarchy. A simple type name for elementary types, a non-detailed description for complex types.- Specified by:
simpleStringin classPathSegment- Returns:
-
set
public PathSegment set(java.nio.ByteBuffer source, boolean padded)
Description copied from class:PathSegmentReplace the current instance content with the decoded source bytes.The caller must ensure that the instance is appropriate for the bytes supplied. This permits instance re-use in optimized applications.
- Specified by:
setin classPathSegment- Parameters:
source- The bytes to be decoded. The position will be left after the last byte of the decoded segment.padded- Alternate format selection. Packed format when false.- Returns:
- The same instance.
-
put
public void put(java.nio.ByteBuffer dest, boolean padded)Description copied from class:PathSegmentEncode the current instance to the given destination.- Specified by:
putin classPathSegment- Parameters:
dest- The buffer receiving the complete encoded instance.padded- Alternate format selection. Packed format when false.
-
getBytes
public int getBytes()
Description copied from class:PathSegmentObtain the number of bytes needed to encode this segment instance in packed format.- Specified by:
getBytesin classPathSegment- Returns:
- Number of bytes, assuming put() will be called with padded false.
-
getTokens
public java.util.List<java.lang.String> getTokens()
- Specified by:
getTokensin classPathSegment
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classPathSegment
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-