Class LogicalSeg
- java.lang.Object
-
- com.automation_pros.odva.cip.path.PathSegment
-
- com.automation_pros.odva.cip.path.LogicalSeg
-
- All Implemented Interfaces:
java.lang.Comparable<PathSegment>
- Direct Known Subclasses:
AttributeSeg
,ClassSeg
,ConxPtSeg
,EKeySeg
,ExtLogSeg
,InstanceSeg
,MemberSeg
,ServiceSeg
public abstract class LogicalSeg extends PathSegment
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LogicalSeg.LogicalParser
An attribute segment must have a ID number that fits in an unsigned word.-
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
format
static byte
SEGTYPE
protected byte
subtype
protected int
value
-
Fields inherited from class com.automation_pros.odva.cip.path.PathSegment
identifierChars, segtype
-
-
Constructor Summary
Constructors Constructor Description LogicalSeg(byte subt)
LogicalSeg(byte subt, byte fmt, int val)
LogicalSeg(byte subt, int val)
-
Method Summary
All 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
getFormat()
byte
getSubtype()
protected java.util.List<java.lang.String>
getTokens(java.lang.String keyword)
int
getValue()
int
getWords()
Obtain the number of 16-bit words needed to encode this segment instance in padded format.int
hashCode()
void
put(java.nio.ByteBuffer dest, boolean padded)
Encode the current instance to the given destination.PathSegment
set(java.nio.ByteBuffer source, boolean padded)
Replace the current instance content with the decoded source bytes.void
setFormat(byte format)
void
setSubtype(byte subtype)
void
setValue(int value)
java.lang.String
simpleString()
Supply s simple descriptive name usable when browsing a hierarchy.-
Methods inherited from class com.automation_pros.odva.cip.path.PathSegment
decode, decodeAll, equals, getSegtype, getTokens, hexString, mergeTokens, registerHandler, setSegtype, toString
-
-
-
-
Field Detail
-
SEGTYPE
public static final byte SEGTYPE
- See Also:
- Constant Field Values
-
subtype
protected byte subtype
-
format
protected byte format
-
value
protected int value
-
-
Method Detail
-
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.
- Specified by:
set
in 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:PathSegment
Encode the current instance to the given destination.- Specified by:
put
in classPathSegment
- Parameters:
dest
- The buffer receiving the complete encoded instance.padded
- Alternate format selection. Packed format when false.
-
getSubtype
public byte getSubtype()
-
setSubtype
public void setSubtype(byte subtype)
-
getFormat
public byte getFormat()
-
setFormat
public void setFormat(byte format)
-
getValue
public int getValue()
-
setValue
public void setValue(int value)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
compareTo
public int compareTo(PathSegment o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<PathSegment>
- Overrides:
compareTo
in classPathSegment
-
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 classPathSegment
- 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.- Specified by:
getBytes
in classPathSegment
- Returns:
- Number of bytes, assuming put() will be called with padded false.
-
simpleString
public java.lang.String simpleString()
Description copied from class:PathSegment
Supply 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:
simpleString
in classPathSegment
- Returns:
-
getTokens
protected java.util.List<java.lang.String> getTokens(java.lang.String keyword)
-
-