Class ExtLogSeg
- java.lang.Object
-
- com.automation_pros.odva.cip.path.PathSegment
-
- com.automation_pros.odva.cip.path.LogicalSeg
-
- com.automation_pros.odva.cip.path.ExtLogSeg
-
- All Implemented Interfaces:
java.lang.Comparable<PathSegment>
- Direct Known Subclasses:
ArrayIndexSeg
,BitIndexSeg
,MemberHandleSeg
,MemberNumSeg
,NestedLogicalSeg
public abstract class ExtLogSeg extends LogicalSeg
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ExtLogSeg.Decoder
Decode bytes expected to contain one encoded path segment.-
Nested classes/interfaces inherited from class com.automation_pros.odva.cip.path.LogicalSeg
LogicalSeg.LogicalParser
-
Nested classes/interfaces inherited from class com.automation_pros.odva.cip.path.PathSegment
PathSegment.HasAlternateHex
-
-
Field Summary
Fields Modifier and Type Field Description protected byte
extendedType
static byte
SUBTYPE
-
Fields inherited from class com.automation_pros.odva.cip.path.LogicalSeg
format, SEGTYPE, subtype, value
-
Fields inherited from class com.automation_pros.odva.cip.path.PathSegment
identifierChars, segtype
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(PathSegment o)
int
getBytes()
Obtain the number of bytes needed to encode this segment instance in packed format.byte
getExtendedType()
java.util.List<java.lang.String>
getTokens()
int
getWords()
Obtain the number of 16-bit words needed to encode this segment instance in padded format.void
put(java.nio.ByteBuffer dest, boolean padded)
Encode the current instance to the given destination.static PathSegmentDecoder
registerHandler(byte type, PathSegmentDecoder handler)
Register a PathSegment decoding class for an extended logical byte stream type code.PathSegment
set(java.nio.ByteBuffer source, boolean padded)
Replace the current instance content with the decoded source bytes.void
setExtendedType(byte extendedType)
-
Methods inherited from class com.automation_pros.odva.cip.path.LogicalSeg
getFormat, getSubtype, getTokens, getValue, hashCode, setFormat, setSubtype, setValue, simpleString
-
Methods inherited from class com.automation_pros.odva.cip.path.PathSegment
decode, decodeAll, equals, getSegtype, hexString, mergeTokens, setSegtype, toString
-
-
-
-
Field Detail
-
SUBTYPE
public static final byte SUBTYPE
- See Also:
- Constant Field Values
-
extendedType
protected byte extendedType
-
-
Method Detail
-
registerHandler
public static PathSegmentDecoder registerHandler(byte type, PathSegmentDecoder handler)
Register a PathSegment decoding class for an extended logical byte stream type code. Classes not included in this package may register byte stream parsers for their type codes. This includes the option to replace the preloaded handler for a packaged type.- Parameters:
type
- Extended Logical byte type code to be handled.handler
- Object that will process this type code.- Returns:
- The decode handler previously registered for this code.
-
compareTo
public int compareTo(PathSegment o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<PathSegment>
- Overrides:
compareTo
in classLogicalSeg
-
getWords
public int getWords()
Description copied from class:PathSegment
Obtain the number of 16-bit words needed to encode this segment instance in padded format. The default implementation assumes the padded format is simply the size of the packed format, rounded up to an even number of bytes.- Overrides:
getWords
in classLogicalSeg
- Returns:
- Number of words, assuming put() will be called with padded true.
-
getBytes
public int getBytes()
Description copied from class:PathSegment
Obtain the number of bytes needed to encode this segment instance in packed format.- Overrides:
getBytes
in classLogicalSeg
- Returns:
- Number of bytes, assuming put() will be called with padded false.
-
getTokens
public java.util.List<java.lang.String> getTokens()
- Specified by:
getTokens
in classPathSegment
-
set
public PathSegment set(java.nio.ByteBuffer source, boolean padded)
Description copied from class:PathSegment
Replace 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.
- Overrides:
set
in classLogicalSeg
- 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:PathSegment
Encode the current instance to the given destination.- Overrides:
put
in classLogicalSeg
- Parameters:
dest
- The buffer receiving the complete encoded instance.padded
- Alternate format selection. Packed format when false.
-
getExtendedType
public byte getExtendedType()
-
setExtendedType
public void setExtendedType(byte extendedType)
-
-