}
/**
- * lazy load validations by sheet, since reading the CT* types is expensive
+ * Lazy load validations by sheet, since reading the CT* types is expensive
* @param sheet
- * @return
+ * @return The {@link DataValidation}s for the sheet
*/
private List<? extends DataValidation> getValidations(Sheet sheet) {
List<? extends DataValidation> dvs = validations.get(sheet.getSheetName());
}
/**
- * If {@link #getValidationForCell(Cell)} returns an instance, and the
+ * If {@link #getValidationForCell(CellReference)} returns an instance, and the
* {@link ValidationType} is {@link ValidationType#LIST}, return the valid
* values, whether they are from a static list or cell range.
* <p/>
/**
* static so enums can reference it without creating a whole instance
- * @param cell
- * @param val
* @return returns an unmodifiable {@link List} of {@link ValueEval}s, which may be empty
*/
protected static List<ValueEval> getValidationValuesForConstraint(DataValidationContext context) {
}
/**
- * Use the validation returned by {@link #getValidationForCell(Cell)} if you
+ * Use the validation returned by {@link #getValidationForCell(CellReference)} if you
* want the error display details. This is the validation checked by this
* method, which attempts to replicate Excel's data validation rules.
* <p/>
* offset the base validation formula by the relative position of the
* current cell, or the wrong value is checked.
*
- * @param cell
+ * @param cellRef The reference of the cell to evaluate
* @return true if the cell has no validation or the cell value passes the
* defined validation, false if it fails
*/
* We won't re-evaluate cells here. This validation would be after the cell value was updated externally.
* Excel allows invalid values through methods like copy/paste, and only validates them when the user
* interactively edits the cell.
- * @param cell
- * @param dvc
- * @param wbe
- * @return
+ * @return if the cell is a valid numeric cell for the validation or not
*/
protected boolean isValidNumericCell(Cell cell, DataValidationContext context) {
if ( ! isType(cell, CellType.NUMERIC)) return false;
}
/**
- *
- * @param value
- * @param context
- * @return
+ * Is the number a valid option for the validation?
*/
protected boolean isValidNumericValue(Double value, final DataValidationContext context) {
try {
}
/**
- * Validates against the type defined in dvc, as an index of the enum values array.
- * @param cell
- * @param dvc
- * @param wbe
+ * Validates against the type defined in context, as an index of the enum values array.
+ * @param cell Cell to check validity of
+ * @param context The Data Validation to check against
* @return true if validation passes
* @throws ArrayIndexOutOfBoundsException if the constraint type is an invalid index
*/
}
/**
- * @param cell
+ * @param cell the cell to check for
* @param region for adjusting relative formulas
- * @return
+ * @return if the value of the cell is valid or not for the formatting rule
*/
private boolean checkValue(Cell cell, CellRangeAddress region) {
if (cell == null || DataValidationEvaluator.isType(cell, CellType.BLANK)
* numbers stored as text are ignored, but numbers formatted as text are treated as numbers.
*
* @param region
- * @return
+ * @return the meaningful values in the range of cells specified
*/
private Set<ValueAndFormat> getMeaningfulValues(CellRangeAddress region, boolean withText, ValueFunction func) {
Set<ValueAndFormat> values = meaningfulRegionValues.get(region);