Class AnsiSymbolSeg
- java.lang.Object
-
- com.automation_pros.odva.cip.path.PathSegment
-
- com.automation_pros.odva.cip.path.AnsiSymbolSeg
-
- All Implemented Interfaces:
SymbolSeg
,java.lang.Comparable<PathSegment>
public class AnsiSymbolSeg extends PathSegment implements SymbolSeg
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AnsiSymbolSeg.Decoder
Decode bytes expected to contain one encoded path segment.static class
AnsiSymbolSeg.Parser
An ANSI symbol segment can have any ISO-8859-1 characters.-
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[]
data
static byte
SEGTYPE
protected byte
subtype
static byte
SUBTYPE
protected java.lang.String
symbol
-
Fields inherited from class com.automation_pros.odva.cip.path.PathSegment
identifierChars, segtype
-
-
Constructor Summary
Constructors Constructor Description AnsiSymbolSeg()
AnsiSymbolSeg(java.lang.String symb)
-
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[]
getData()
java.lang.String
getSymbol()
java.util.List<java.lang.String>
getTokens()
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
setData(short[] data)
void
setSymbol(java.lang.String symb)
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, getWords, hexString, mergeTokens, registerHandler, setSegtype, toString
-
-
-
-
Field Detail
-
SUBTYPE
public static final byte SUBTYPE
- See Also:
- Constant Field Values
-
symbol
protected java.lang.String symbol
-
SEGTYPE
public static final byte SEGTYPE
- See Also:
- Constant Field Values
-
subtype
protected byte subtype
-
data
protected short[] data
-
-
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.
- 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.
-
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 interfaceSymbolSeg
- Specified by:
getBytes
in classPathSegment
- Returns:
- Number of bytes, assuming put() will be called with padded false.
-
setSymbol
public void setSymbol(java.lang.String symb)
-
hashCode
public int hashCode()
-
compareTo
public int compareTo(PathSegment o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<PathSegment>
-
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
public java.util.List<java.lang.String> getTokens()
- Specified by:
getTokens
in classPathSegment
-
getData
public short[] getData()
-
setData
public void setData(short[] data)
-
-