Class FieldLocation
- All Implemented Interfaces:
Comparable<FieldLocation>
Field
locations within the field viewer.
A field location represents a place within a Field. Fields live within a concept we call a layout. A layout represents an 'item', for example an address, along with a grouping of related information. Each layout will contain one or more Field objects. Further, each layout's fields may have varying shapes, such as single or multiple rows within the layout. Thusly, a layout could conceptually represent a single line of text or multiple groupings of text and images, similar to how a newspaper or web page is laid out.
A layout lives in a larger collection of layouts, which are laid out vertically. The index of a layout is its position within that larger list. This class contains the index of the layout within which it lives.
A FieldSelection
may be within a single layout or may cross multiple layouts. To
determine if a selection crosses multiple layouts, you can get the range
of
the selection. You can then use the range's start and end locations to determine if the
selection spans multiple layouts. If the start and end indexes of the range are the same, then
the selection is within a single layout; otherwise, the selection spans multiple layouts.
This location also contains row and column values. These values refer to the row and column of text within a single Field. Lastly, this class contains a field number, which represents the relative field number inside of the over layout, which may contain multiple fields.
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionFieldLocation
(int index) FieldLocation
(int index, int fieldNum) FieldLocation
(int index, int fieldNum, int row, int col) Construct a new FieldLocation with the given index,fieldNum,row, and col.Construct a new FieldLocation by copying from another FieldLocation.FieldLocation
(BigInteger index) FieldLocation
(BigInteger index, int fieldNum) FieldLocation
(BigInteger index, int fieldNum, int row, int col) FieldLocation
(org.jdom.Element child) -
Method Summary
Modifier and TypeMethodDescriptionint
boolean
int
getCol()
Returns the column within the Field for this location.org.jdom.Element
getElement
(String name) int
Returns the number of the field for this location.getIndex()
Returns the index for this location.int
getRow()
Returns the row within the Field for this location.int
hashCode()
void
set
(FieldLocation loc) void
setIndex
(BigInteger index) toString()
-
Field Details
-
MAX
-
fieldNum
public int fieldNum -
row
public int row -
col
public int col
-
-
Constructor Details
-
FieldLocation
public FieldLocation() -
FieldLocation
public FieldLocation(int index) -
FieldLocation
public FieldLocation(int index, int fieldNum) -
FieldLocation
-
FieldLocation
-
FieldLocation
public FieldLocation(int index, int fieldNum, int row, int col) Construct a new FieldLocation with the given index,fieldNum,row, and col.- Parameters:
index
- the index of the layout containing the locationfieldNum
- the index of the field in the layout containing the locationrow
- the text row in the field containing the location.col
- the character position the row containing the location.
-
FieldLocation
-
FieldLocation
public FieldLocation(org.jdom.Element child) -
FieldLocation
Construct a new FieldLocation by copying from another FieldLocation.- Parameters:
loc
- the FieldLocation to be copied.
-
-
Method Details
-
getIndex
Returns the index for this location. The index corresponds to the layout that contains the field represented by this location. See the javadoc header for more details.- Returns:
- the index for this location.
-
getFieldNum
public int getFieldNum()Returns the number of the field for this location. This is the number of the field within a given layout. See the javadoc header for more details.- Returns:
- the number of the field for this location.
-
getRow
public int getRow()Returns the row within the Field for this location.- Returns:
- the row within the Field for this location.
-
getCol
public int getCol()Returns the column within the Field for this location.- Returns:
- the column within the Field for this location.
-
equals
-
compareTo
- Specified by:
compareTo
in interfaceComparable<FieldLocation>
-
hashCode
public int hashCode() -
toString
-
getElement
-
set
-
setIndex
-