inet.ipaddr

Interface AddressSegmentSeries

    • Method Detail

      • getSegmentCount

        int getSegmentCount()
      • getBitsPerSegment

        int getBitsPerSegment()
      • getBytesPerSegment

        int getBytesPerSegment()
      • getSection

        AddressSection getSection(int index)
        Gets the subsection from the series starting from the given index
        Parameters:
        index -
        Returns:
        Throws:
        java.lang.IndexOutOfBoundsException - if index < 0
      • getSection

        AddressSection getSection(int index,
                                  int endIndex)
        Gets the subsection from the series starting from the given index and ending just before the give endIndex
        Parameters:
        index -
        endIndex -
        Returns:
        Throws:
        java.lang.IndexOutOfBoundsException - if index < 0 or endIndex extends beyond the end of the series
      • getSegments

        void getSegments(int start,
                         int end,
                         AddressSegment[] segs,
                         int index)
        get the segments from start to end and insert into the segs array at the the given index
        Parameters:
        start -
        end -
        segs -
        index -
      • iterator

        java.util.Iterator<? extends AddressSegmentSeries> iterator()
        Description copied from interface: AddressComponent
        An address component can represent a single segment, address, or section, or it can represent multiple, typically a subnet or range of segment, address, or section values. Call AddressItem.isMultiple() to determine if this instance represents multiple. This method iterates through the individual elements.
        Specified by:
        iterator in interface AddressComponent
        Returns:
      • segmentsIterator

        java.util.Iterator<? extends AddressSegment[]> segmentsIterator()
      • toCanonicalString

        java.lang.String toCanonicalString()
        Produces the canonical representation of the address
        Returns:
      • toCompressedString

        java.lang.String toCompressedString()
        Produces a short representation of the address while remaining within the confines of standard representation(s) of the address
        Returns:
      • reverseSegments

        AddressSegmentSeries reverseSegments()
        Returns a new segment series with the segments reversed. This does not throw AddressTypeException.
        Returns:
      • reverseBits

        AddressSegmentSeries reverseBits(boolean perByte)
        Returns a new segment series with the bits reversed.
        Specified by:
        reverseBits in interface AddressComponent
        Parameters:
        perByte - if true, only the bits in each byte are reversed, if false, then all bits in the component are reversed
        Returns:
        Throws:
        AddressTypeException - if reversing the bits within a single segment cannot be done because the segment represents a range, and when all values in that range are reversed, the result is not contiguous. In practice this means that to be reversible the range must include all values except possibly the largest and/or smallest.
      • reverseBytes

        AddressSegmentSeries reverseBytes()
        Returns a new segment series with the bytes reversed.
        Specified by:
        reverseBytes in interface AddressComponent
        Returns:
        Throws:
        AddressTypeException - if the segments have more than 1 bytes, and if reversing the bits within a single segment cannot be done because the segment represents a range that is not the entire segment range.
      • reverseBytesPerSegment

        AddressSegmentSeries reverseBytesPerSegment()
        Returns a new segment series with the bytes reversed within each segment.
        Returns:
        Throws:
        AddressTypeException - if the segments have more than 1 bytes, and if reversing the bits within a single segment cannot be done because the segment represents a range that is not the entire segment range.
      • removePrefixLength

        AddressSegmentSeries removePrefixLength()
        Removes the prefix. When the series already had a prefix, the bits previously not within the prefix are zero.
        Parameters:
        nextSegment -
        Returns:
      • adjustPrefixBySegment

        AddressSegmentSeries adjustPrefixBySegment(boolean nextSegment)
        Increases or decreases prefix length to the next segment boundary. When prefix length is increased, the bits moved within the prefix are zero.
        Parameters:
        nextSegment -
        Returns:
      • adjustPrefixLength

        AddressSegmentSeries adjustPrefixLength(int adjustment)
        Increases or decreases prefix length by the given increment. When prefix length is increased, the bits moved within the prefix become zero. When the prefix is extended beyond the segment series boundary, it is removed.
        Parameters:
        nextSegment -
        Returns:
      • setPrefixLength

        AddressSegmentSeries setPrefixLength(int prefixLength)
        Sets the prefix length. When the series already had a prefix, and the prefix length is increased, the bits moved within the prefix are zero. When the prefix is extended beyond the segment series boundary, it is removed.
        Parameters:
        nextSegment -
        Returns:
      • applyPrefixLength

        AddressSegmentSeries applyPrefixLength(int networkPrefixLength)
        Applies the given prefix length to create a new segment series representing all segment series starting with the same prefix. When this series already has a prefix length that is smaller, then this method returns this series.