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 classAnsiSymbolSeg.DecoderDecode bytes expected to contain one encoded path segment.static classAnsiSymbolSeg.ParserAn 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[]datastatic byteSEGTYPEprotected bytesubtypestatic byteSUBTYPEprotected java.lang.Stringsymbol-
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 intcompareTo(PathSegment o)intgetBytes()Obtain the number of bytes needed to encode this segment instance in packed format.short[]getData()java.lang.StringgetSymbol()java.util.List<java.lang.String>getTokens()inthashCode()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.voidsetData(short[] data)voidsetSymbol(java.lang.String symb)java.lang.StringsimpleString()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: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.
- 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.
-
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 interfaceSymbolSeg- Specified by:
getBytesin 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:
compareToin interfacejava.lang.Comparable<PathSegment>
-
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:
-
getTokens
public java.util.List<java.lang.String> getTokens()
- Specified by:
getTokensin classPathSegment
-
getData
public short[] getData()
-
setData
public void setData(short[] data)
-
-