Class EthType


  • public class EthType
    extends java.lang.Object
    Representation of an Ethertype.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  EthType.EtherType
      A list of known ethertypes.
    • Constructor Summary

      Constructors 
      Constructor Description
      EthType​(int etherType)
      Builds the EthType.
      EthType​(short etherType)
      Builds the EthType.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      int hashCode()  
      EthType.EtherType lookup​(short etherType)
      Looks up the ethertype by it's numerical representation and returns it's textual format.
      short toShort()
      Returns the short value for this ethtype.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • EthType

        public EthType​(int etherType)
        Builds the EthType.
        Parameters:
        etherType - an integer representing an ethtype
      • EthType

        public EthType​(short etherType)
        Builds the EthType.
        Parameters:
        etherType - a short representing the ethtype
    • Method Detail

      • toShort

        public short toShort()
        Returns the short value for this ethtype.
        Returns:
        a short value
      • lookup

        public EthType.EtherType lookup​(short etherType)
        Looks up the ethertype by it's numerical representation and returns it's textual format.
        Parameters:
        etherType - the short value of the ethertype
        Returns:
        a textual representation
      • equals

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

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object