com.adobe.acrobat.bytearray
Class ContiguousByteRange

java.lang.Object
  |
  +--com.adobe.acrobat.bytearray.ContiguousByteRange

public class ContiguousByteRange
extends java.lang.Object

Class representing a start and an end of a continguous range of integers. Ordered, non-overlapping collections of these are used to represent ByteRanges.

Version:
1.0 25 Marchi 1997 Copyright (c) 1997 Adobe Systems Inc., All Rights Reserved.

Constructor Summary
ContiguousByteRange(int start, int end)
          Create a new ContiguousByteRange spanning all the integers between start and end inclusive.

 

Method Summary
 ContiguousByteRange decapitate(int byteIndex)
           
 boolean equals(java.lang.Object o)
          Compares two ContiguousByteRanges.
 int getEnd()
          Get the highest integer in this ContiguousByteRange.
 int getLength()
          Get the total number of integers contained in this ContiguousByteRange
 int getStart()
          Get the lowest integer in this ContiguousByteRange.
 ByteRange toByteRange()
          Create a ByteRange containing exactly the integers contained in this ContiguousByteRange
 java.lang.String toString()
          Create a string representation of this ContiguousByteRange

 

Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Constructor Detail

ContiguousByteRange

public ContiguousByteRange(int start,
                           int end)
Create a new ContiguousByteRange spanning all the integers between start and end inclusive.
Parameters:
start - the first integer in this ContiguousByteRange
end - the last integer in this ContiguousByteRange
Method Detail

toByteRange

public ByteRange toByteRange()
Create a ByteRange containing exactly the integers contained in this ContiguousByteRange
Returns:
a new ByteRange from the integers in this ContiguousByteRange

decapitate

public ContiguousByteRange decapitate(int byteIndex)

getStart

public int getStart()
Get the lowest integer in this ContiguousByteRange.
Returns:
the start of this ContiguousByteRange

getEnd

public int getEnd()
Get the highest integer in this ContiguousByteRange.
Returns:
the end of this ContiguousByteRange

getLength

public int getLength()
Get the total number of integers contained in this ContiguousByteRange
Returns:
the size of this ContiguousByteRange

equals

public boolean equals(java.lang.Object o)
Compares two ContiguousByteRanges.
Parameters:
o - the other ContiguousByteRange being compared
Returns:
true iff the two ContiguousByteRanges represent exactly the same set of bytes.
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Create a string representation of this ContiguousByteRange
Returns:
this ContiguousByteRange in a string of the form x-y, where x is the start and y is the end of this ContiguousByteRange
Overrides:
toString in class java.lang.Object