Class AnonStructSeg

  • All Implemented Interfaces:
    PathSegment.HasAlternateHex, java.lang.Comparable<PathSegment>

    public class AnonStructSeg
    extends StructDefSeg
    implements PathSegment.HasAlternateHex
    Encapsulates an elementary data type annotation within a CIP Path definition. Type annotations are generally not passed on the wire, but delimit the path fragment that will go on the wire (before the data type) from the path fragment that will be applied to the payload on the wire.
    • Field Detail

      • alignmentTokens

        public static final java.util.List<java.lang.String> alignmentTokens
      • alignmentTexts

        public static final java.util.List<java.lang.String> alignmentTexts
      • alignmentCodes

        public static final java.util.List<java.lang.Integer> alignmentCodes
      • CRC

        protected java.lang.Integer CRC
      • typeName

        protected java.lang.String typeName
      • alignment

        protected int alignment
      • memberBytes

        protected int memberBytes
      • anyNamed

        protected boolean anyNamed
      • cachedCRC

        protected java.lang.Integer cachedCRC
    • Constructor Detail

      • AnonStructSeg

        public AnonStructSeg​(int alignment)
      • AnonStructSeg

        public AnonStructSeg​(int alignment,
                             java.util.List<? extends PathSegment> inner)
    • Method Detail

      • tokenForAlignment

        public static java.lang.String tokenForAlignment​(int alignment)
      • textForAlignment

        public static java.lang.String textForAlignment​(int alignment)
      • getMemberName

        public static java.lang.String getMemberName​(DataDefinitionSeg member)
      • addAll

        public void addAll​(java.util.List<? extends PathSegment> inner)
      • getAlignment

        public int getAlignment()
      • setAlignment

        public void setAlignment​(int alignment)
      • getCRC

        public java.lang.Integer getCRC()
        An anonymous structure definition will always have a CRC. The formal one from
        Specified by:
        getCRC in class StructDefSeg
        Returns:
      • setTypeName

        public void setTypeName​(java.lang.String typeName)
        Specified by:
        setTypeName in class StructDefSeg
      • construct

        protected BaseDataType<?> construct​(int[] dimensions,
                                            DataContext ctx)
        Description copied from class: DataDefinitionSeg
        Construct an instance of the type represented by this definition, using the given dimensions. This is an implementation detail that permits a DecoratedDefSeg to create arrays.

        Use the provided context to look up any ambiguous data types.

        Specified by:
        construct in class DataDefinitionSeg
        Returns:
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class PathSegment
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • updateSegType

        protected void updateSegType()
      • 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 class PathSegment
        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 class PathSegment
        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.
        Specified by:
        getBytes in class PathSegment
        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 class PathSegment
      • main

        public static void main​(java.lang.String[] args)