Class PortSeg

    • Field Detail

      • slotCache

        public static final java.util.Map<java.lang.Short,​PortSeg> slotCache
      • port

        protected short port
      • address

        protected byte[] address
    • Constructor Detail

      • PortSeg

        public PortSeg()
      • PortSeg

        protected PortSeg​(short port,
                          short slot)
      • PortSeg

        public PortSeg​(short port,
                       byte[] addr)
      • PortSeg

        public PortSeg​(short port,
                       java.net.InetSocketAddress addr)
      • PortSeg

        public PortSeg​(short port,
                       java.net.InetAddress addr)
    • Method Detail

      • getCached

        public static PortSeg getCached​(short port,
                                        short addr)
      • 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.
      • getPort

        public short getPort()
      • setPort

        public void setPort​(short port)
      • getAddress

        public byte[] getAddress()
      • getSlot

        public short getSlot()
      • getSocketAddress

        public java.net.InetSocketAddress getSocketAddress()
      • setAddress

        public void setAddress​(byte[] address)
      • setAddress

        public void setAddress​(java.lang.String address)
      • setAddress

        public void setAddress​(java.net.InetAddress address)
      • setAddress

        public void setAddress​(java.net.InetSocketAddress address)
      • 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.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • 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 class PathSegment
        Returns:
      • getTokens

        public java.util.List<java.lang.String> getTokens()
        Specified by:
        getTokens in class PathSegment