Module inet.ipaddr

Class MACAddressSegment

All Implemented Interfaces:
AddressComponent, AddressSegment, AddressComponentRange, AddressGenericDivision, AddressItem, AddressItemRange, AddressStringDivision, Serializable, Comparable<AddressItem>, Iterable<MACAddressSegment>

public class MACAddressSegment extends AddressDivision implements AddressSegment, Iterable<MACAddressSegment>
Represents a segment of a MAC address. For MAC, segments are 1 byte. Segments are immutable, which also makes them thread-safe.
Author:
sfoley
See Also:
  • Field Details

  • Constructor Details

    • MACAddressSegment

      public MACAddressSegment(int value)
      Constructs a segment of an IPv4 or IPv6 address with the given value.
      Parameters:
      value - the value of the segment
      Throws:
      AddressValueException - if value is negative or too large
    • MACAddressSegment

      public MACAddressSegment(int lower, int upper)
      Constructs a segment of a MAC address that represents a range of values.
      Parameters:
      lower - the lower value of the range of values represented by the segment.
      upper - the upper value of the range of values represented by the segment.
      Throws:
      AddressValueException - if value is negative or too large
  • Method Details