Class EKeySeg
- java.lang.Object
-
- com.automation_pros.odva.cip.path.PathSegment
-
- com.automation_pros.odva.cip.path.LogicalSeg
-
- com.automation_pros.odva.cip.path.EKeySeg
-
- All Implemented Interfaces:
java.lang.Comparable<PathSegment>
public class EKeySeg extends LogicalSeg
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EKeySeg.Decoder
Decode bytes expected to contain one encoded path segment.static class
EKeySeg.Parser
This parser is expected to registered for the 'ekey' keyword.-
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 short
deviceId
protected boolean
enforce
static byte
FORMAT
protected byte
keyType
protected byte
major
protected byte
minor
protected short
productId
static byte
SUBTYPE
protected short
vendorId
-
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 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.short
getDeviceId()
byte
getKeyType()
byte
getMajor()
byte
getMinor()
short
getProductId()
java.util.List<java.lang.String>
getTokens()
int
getValue()
short
getVendorId()
int
getWords()
Obtain the number of 16-bit words needed to encode this segment instance in padded format.int
hashCode()
boolean
isEnforce()
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.EKeySeg
setDeviceId(short deviceId)
void
setEnforce(boolean enforce)
EKeySeg
setMajor(byte major)
EKeySeg
setMinor(byte minor)
EKeySeg
setProductId(short productId)
void
setValue(int value)
EKeySeg
setVendorId(short vendorId)
-
Methods inherited from class com.automation_pros.odva.cip.path.LogicalSeg
getFormat, getSubtype, getTokens, setFormat, setSubtype, simpleString
-
Methods inherited from class com.automation_pros.odva.cip.path.PathSegment
decode, decodeAll, equals, getSegtype, hexString, mergeTokens, registerHandler, setSegtype, toString
-
-
-
-
Field Detail
-
SUBTYPE
public static final byte SUBTYPE
- See Also:
- Constant Field Values
-
FORMAT
public static final byte FORMAT
- See Also:
- Constant Field Values
-
keyType
protected byte keyType
-
vendorId
protected short vendorId
-
deviceId
protected short deviceId
-
productId
protected short productId
-
major
protected byte major
-
enforce
protected boolean enforce
-
minor
protected byte minor
-
-
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.
- 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.
-
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.
-
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.
-
getValue
public int getValue()
- Overrides:
getValue
in classLogicalSeg
-
setValue
public void setValue(int value)
- Overrides:
setValue
in classLogicalSeg
-
getVendorId
public short getVendorId()
-
setVendorId
public EKeySeg setVendorId(short vendorId)
-
getDeviceId
public short getDeviceId()
-
setDeviceId
public EKeySeg setDeviceId(short deviceId)
-
getProductId
public short getProductId()
-
setProductId
public EKeySeg setProductId(short productId)
-
getMajor
public byte getMajor()
-
setMajor
public EKeySeg setMajor(byte major)
-
isEnforce
public boolean isEnforce()
-
setEnforce
public void setEnforce(boolean enforce)
-
getMinor
public byte getMinor()
-
setMinor
public EKeySeg setMinor(byte minor)
-
getKeyType
public byte getKeyType()
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classLogicalSeg
-
compareTo
public int compareTo(PathSegment o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<PathSegment>
- Overrides:
compareTo
in classLogicalSeg
-
getTokens
public java.util.List<java.lang.String> getTokens()
- Specified by:
getTokens
in classPathSegment
-
-