lapis.trees
Class RegionArray

java.lang.Object
  extended bylapis.RegionSet
      extended bylapis.SingleDocRegionSet
          extended bylapis.trees.RegionArray
All Implemented Interfaces:
Mutable, Serializable
Direct Known Subclasses:
FlatteningRegionArray

public class RegionArray
extends SingleDocRegionSet
implements Mutable

Region array. Sorted list of region rectangles.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class lapis.RegionSet
RegionSet.IntersectOp
 
Field Summary
static Debug debug
           
 
Fields inherited from class lapis.SingleDocRegionSet
FUZZY_HIGH, FUZZY_LOW
 
Fields inherited from class lapis.RegionSet
DISJOINT, EMPTY, EQUAL, MAX_INDEX, MIN_INDEX, SUBSET, SUPERSET, UNRELATED
 
Constructor Summary
  RegionArray()
          Make a new, empty RegionArray.
  RegionArray(DocumentVersion ver)
           
  RegionArray(int size)
          Make a new, empty RegionArray.
  RegionArray(int size, DocumentVersion ver)
           
protected RegionArray(RegionArray ra, boolean copy)
          Copy a RegionArray.
 
Method Summary
 RegionSet contains()
           
 RegionSet convert(CoordinateMap coords)
           
 RegionSet convert(CoordinateMap coords, Document doc)
           
 RegionSet convert(CoordinateMap coords, DocumentVersion ver)
           
 void delete(Region s)
          delete a region
 void delete(RegionSet s)
          delete a region set
 RegionSet ending(RegionSet bgd)
           
 RegionSet freeze()
          Make a copy of this region set.
 int fuzzify(int x, int direction)
           
 Document getDocument()
           
 int getEndHigh()
           
 int getEndLow()
           
 SingleDocRegionSet getSingleDocRegionSet(Document doc)
           
 int getSize()
           
 int getStartHigh()
           
 int getStartLow()
           
 DocumentVersion getVersion()
           
 Versions getVersions()
           
 RegionSet in()
           
 void insert(int start, int end, DocumentVersion ver)
          insert a region represented by start, end, and ver
 void insert(Region s)
          insert a region
 void insert(RegionSet s)
          insert a region set
 RegionSet justAfter(RegionSet bgd)
           
 RegionSet justBefore(RegionSet bgd)
           
 RegionEnumeration regions(Region bbox)
           
 RegionEnumeration regions(RegionSet bboxs)
          enumerate regions in each bounding box from each document
 SubsetEnumeration singleDocize()
           
 RegionSet starting(RegionSet bgd)
           
 SubsetEnumeration subsets()
           
 void validate()
           
 
Methods inherited from class lapis.SingleDocRegionSet
getBoundingBox, lessThan
 
Methods inherited from class lapis.RegionSet
after, afterDelimited, afterIn, ancestor, and, balancedWith, before, beforeDelimited, beforeIn, butnot, compareTo, convert, convert, convertToLatest, countIntersection, crispen, descendant, endingContains, endingDelimited, endingIn, endOf, equals, equalTo, flatten, fromTo, getDocuments, getUniversal, hashCode, highlight, include, intersect, intersects, intersects, isAllPoints, isCrisp, isEmpty, isFlat, justAfterDelimited, justBeforeDelimited, melt, mightEnclose, mightIntersect, nextTo, nth, or, overlaps, overlapsEnd, overlapsStart, regions, separatedBy, slowEquals, startingContains, startingDelimited, startingIn, startOf, stripEmptyRegions, toString, toStringWithContent, trim
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

debug

public static Debug debug
Constructor Detail

RegionArray

public RegionArray()
Make a new, empty RegionArray.


RegionArray

public RegionArray(DocumentVersion ver)

RegionArray

public RegionArray(int size)
Make a new, empty RegionArray.

Parameters:
size - Expected number of regions

RegionArray

public RegionArray(int size,
                   DocumentVersion ver)

RegionArray

protected RegionArray(RegionArray ra,
                      boolean copy)
Copy a RegionArray.

Method Detail

getStartLow

public int getStartLow()
Specified by:
getStartLow in class SingleDocRegionSet
Returns:
lower bound for starting offset

getStartHigh

public int getStartHigh()
Specified by:
getStartHigh in class SingleDocRegionSet
Returns:
upper bound for starting offset

getEndLow

public int getEndLow()
Specified by:
getEndLow in class SingleDocRegionSet
Returns:
lower bound for ending offset

getEndHigh

public int getEndHigh()
Specified by:
getEndHigh in class SingleDocRegionSet
Returns:
upper bound for ending offset

getSize

public int getSize()
Specified by:
getSize in class RegionSet

insert

public void insert(Region s)
            throws RepresentationChangeException
Description copied from interface: Mutable
insert a region

Specified by:
insert in interface Mutable
Parameters:
s - region to be inserted
Throws:
RepresentationChangeException

insert

public void insert(RegionSet s)
            throws RepresentationChangeException
Description copied from interface: Mutable
insert a region set

Specified by:
insert in interface Mutable
Parameters:
s - region set to be inserted
Throws:
RepresentationChangeException

insert

public void insert(int start,
                   int end,
                   DocumentVersion ver)
            throws RepresentationChangeException
Description copied from interface: Mutable
insert a region represented by start, end, and ver

Specified by:
insert in interface Mutable
Parameters:
start - region's start index
end - region's end index
ver - region's version
Throws:
RepresentationChangeException

delete

public void delete(Region s)
            throws RepresentationChangeException
Description copied from interface: Mutable
delete a region

Specified by:
delete in interface Mutable
Parameters:
s - region to be deleted
Throws:
RepresentationChangeException

delete

public void delete(RegionSet s)
            throws RepresentationChangeException
Description copied from interface: Mutable
delete a region set

Specified by:
delete in interface Mutable
Parameters:
s - region set to be deleted
Throws:
RepresentationChangeException

validate

public void validate()

convert

public RegionSet convert(CoordinateMap coords,
                         DocumentVersion ver)
Overrides:
convert in class SingleDocRegionSet

convert

public RegionSet convert(CoordinateMap coords)
Overrides:
convert in class SingleDocRegionSet

convert

public RegionSet convert(CoordinateMap coords,
                         Document doc)
Overrides:
convert in class SingleDocRegionSet

fuzzify

public int fuzzify(int x,
                   int direction)
Overrides:
fuzzify in class SingleDocRegionSet

freeze

public RegionSet freeze()
Description copied from class: RegionSet
Make a copy of this region set.

Specified by:
freeze in class RegionSet
Returns:
an instance of this RegionSet that nobody else can modify (may be the same object reference, if this RegionSet subclass is immutable)

subsets

public SubsetEnumeration subsets()
Overrides:
subsets in class RegionSet

regions

public RegionEnumeration regions(Region bbox)
Specified by:
regions in class RegionSet

regions

public RegionEnumeration regions(RegionSet bboxs)
Description copied from class: RegionSet
enumerate regions in each bounding box from each document

Specified by:
regions in class RegionSet
Parameters:
bboxs - region set consisting of bounding boxes, one from each document
Returns:
region enumeration

justBefore

public RegionSet justBefore(RegionSet bgd)
Overrides:
justBefore in class RegionSet

justAfter

public RegionSet justAfter(RegionSet bgd)
Overrides:
justAfter in class RegionSet

starting

public RegionSet starting(RegionSet bgd)
Overrides:
starting in class RegionSet

ending

public RegionSet ending(RegionSet bgd)
Overrides:
ending in class RegionSet

in

public RegionSet in()
Overrides:
in in class RegionSet

contains

public RegionSet contains()
Overrides:
contains in class RegionSet

singleDocize

public SubsetEnumeration singleDocize()
Specified by:
singleDocize in class RegionSet

getVersion

public DocumentVersion getVersion()
Specified by:
getVersion in class SingleDocRegionSet
Returns:
document version

getDocument

public Document getDocument()
Specified by:
getDocument in class SingleDocRegionSet
Returns:
document

getSingleDocRegionSet

public SingleDocRegionSet getSingleDocRegionSet(Document doc)
Specified by:
getSingleDocRegionSet in class RegionSet

getVersions

public Versions getVersions()
Specified by:
getVersions in class RegionSet