Class com.symantec.itools.vcafe.openapi.Range
All Packages Class Hierarchy This Package Previous Next Index
Class com.symantec.itools.vcafe.openapi.Range
Object
|
+----com.symantec.itools.vcafe.openapi.Range
- public final class Range
- extends Object
A byte offset and length in a SourceFile. It is not the range of the unicode
version of that text. Note that this means that a Range cannot be computed arbitrarily
from the unicode StringBuffer equivalent text. Ranges are meant to be passed from
Visual Cafe to plug-ins, and not vice-versa.
- Version:
- 1.0
- Author:
- Symantec Internet Tools Division
- Since:
- VCafe 3.0
- See Also:
- SourceFile
-
com.symantec.itools.vcafe.openapi.Range(int, int)
- Constructs a
Range that starts at the specified character position (in bytes), and
has the given length (also in bytes).
-
com.symantec.itools.vcafe.openapi.Range(Range)
- Constructs a
Range that has the same start and length as the given Range.
-
contains(int)
- Determines whether the extent of this
Range contains the specified offset.
-
contains(Range)
- Determines whether this
Range fully contains the give Range r.
-
equals(Range)
- Determines whether this
Range has the identical extent as the given Range.
-
getDistance(int)
- Determines the absolute distance of the given offset from this
Range.
-
getEnd()
- Determines the ending character position, in zero-based bytes.
-
getLength()
- Gets the length.
-
getStart()
- Gets the starting character position, in zero-based bytes.
-
isEmpty()
- Determines whether the range is empty (
Range length is zero).
-
toString()
- Gets a
String that represents this object.
-
union(Range)
- Creates a new
Range that contains the full extend of both this and the
given Range.
Range
public Range(int start,
int length)
- Constructs a
Range that starts at the specified character position (in bytes), and
has the given length (also in bytes).
- Parameters:
- start - starting character position in bytes, numbering from zero.
- length - length of the range in bytes.
Range
public Range(Range r)
- Constructs a
Range that has the same start and length as the given Range.
- Parameters:
- r - the given
Range.
contains
public boolean contains(int offset)
- Determines whether the extent of this
Range contains the specified offset.
- Parameters:
- offset - the offset, in zero-based bytes.
- Returns:
-
true if this Range contains the offset, false otherwise.
contains
public boolean contains(Range r)
- Determines whether this
Range fully contains the give Range r.
- Parameters:
- r - the given
Range.
- Returns:
-
true if the given Range is fully contained by this
Range, false otherwise.
equals
public boolean equals(Range r)
- Determines whether this
Range has the identical extent as the given Range.
- Parameters:
- r - the given
Range.
- Returns:
-
true if the extents are the same, false otherwise.
getDistance
public int getDistance(int offset)
- Determines the absolute distance of the given offset from this
Range. If the offset is
contained within the extent of this Range, 0 is returned.
- Parameters:
- offset - the given offset
- Returns:
- the offset's absolute distance away, or 0 if the offset is contained by this
Range.
getEnd
public int getEnd()
- Determines the ending character position, in zero-based bytes.
- Returns:
- the ending character position in bytes, in zero-based based.
getLength
public int getLength()
- Gets the length.
- Returns:
- the length of this
Range in bytes.
getStart
public int getStart()
- Gets the starting character position, in zero-based bytes.
- Returns:
- the start of this
Range in zero-based bytes.
isEmpty
public boolean isEmpty()
- Determines whether the range is empty (
Range length is zero). If this is true, this
Range is an insertion point, otherwise it is an area of text.
- Returns:
-
true if the range is empty.
toString
public java.lang.String toString()
- Gets a
String that represents this object.
- Returns:
- the
String.
- Overrides:
- toString in class Object
union
public com.symantec.itools.vcafe.openapi.Range union(Range r)
- Creates a new
Range that contains the full extend of both this and the
given Range.
- Parameters:
- r - the given
Range (may be null).
- Returns:
- a new
Range whose extent contains both this and the given Range.
All Packages Class Hierarchy This Package Previous Next Index