001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: /*
018: * Created on May 8, 2005
019: *
020: */
021: package org.apache.poi.hssf.record.formula.eval;
022:
023: /**
024: * @author Amol S. Deshmukh < amolweb at ya hoo dot com >
025: *
026: */
027: public interface AreaEval extends ValueEval {
028:
029: /**
030: * returns the 0-based index of the first row in
031: * this area.
032: */
033: public int getFirstRow();
034:
035: /**
036: * returns the 0-based index of the last row in
037: * this area.
038: */
039: public int getLastRow();
040:
041: /**
042: * returns the 0-based index of the first col in
043: * this area.
044: */
045: public short getFirstColumn();
046:
047: /**
048: * returns the 0-based index of the last col in
049: * this area.
050: */
051: public short getLastColumn();
052:
053: /**
054: * returns true if the Area's start and end row indexes
055: * are same. This result of this method should agree
056: * with getFirstRow() == getLastRow().
057: */
058: public boolean isRow();
059:
060: /**
061: * returns true if the Area's start and end col indexes
062: * are same. This result of this method should agree
063: * with getFirstColumn() == getLastColumn().
064: */
065: public boolean isColumn();
066:
067: /**
068: * The array of values in this area. Although the area
069: * maybe 1D (ie. isRow() or isColumn() returns true) or 2D
070: * the returned array is 1D.
071: */
072: public ValueEval[] getValues();
073:
074: /**
075: * returns the ValueEval from the values array at the specified
076: * row and col index. The specified indexes should be absolute indexes
077: * in the sheet and not relative indexes within the area. Also,
078: * if contains(row, col) evaluates to true, a null value will
079: * bre returned.
080: * @param row
081: * @param col
082: */
083: public ValueEval getValueAt(int row, short col);
084:
085: /**
086: * returns true if the cell at row and col specified
087: * as absolute indexes in the sheet is contained in
088: * this area.
089: * @param row
090: * @param col
091: */
092: public boolean contains(int row, short col);
093:
094: /**
095: * returns true if the specified col is in range
096: * @param col
097: */
098: public boolean containsColumn(short col);
099:
100: /**
101: * returns true if the specified row is in range
102: * @param row
103: */
104: public boolean containsRow(int row);
105: }
|