Class LongSegment

java.lang.Object
com.pnfsoftware.jeb.util.collect.LongSegment
All Implemented Interfaces:
ISegment<Long>, Comparable<LongSegment>

@Ser public class LongSegment extends Object implements ISegment<Long>, Comparable<LongSegment>
Standard implementation of a segment using an long treated as a signed value. Immutable.
  • Constructor Details

    • LongSegment

      public LongSegment(long address, long size)
      Create a long segment.
      Parameters:
      address - begin address
      size - segment size
  • Method Details

    • compareTo

      public int compareTo(LongSegment second)
      Specified by:
      compareTo in interface Comparable<LongSegment>
    • getBegin

      public Long getBegin()
      Description copied from interface: ISegment
      Get the address where the segment starts.
      Specified by:
      getBegin in interface ISegment<Long>
      Returns:
      the address where the segment begins
    • getEnd

      public Long getEnd()
      Description copied from interface: ISegment
      Get the address where the segment ends (exclusive).
      Specified by:
      getEnd in interface ISegment<Long>
      Returns:
      the address where the segment ends
    • getSize

      public long getSize()
      Returns:
      segment size
    • merge

      public static LongSegment merge(Couple<Long,Long> minmax, List<LongSegment> list)
      Merge segments into a segment spanning the provided bounds.
      Parameters:
      minmax - begin and end bounds
      list - segments being merged
      Returns:
      merged segment
    • toString

      public String toString()
      Overrides:
      toString in class Object