bug 58671: change MissingCellPolicy from class to enum

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1717157 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Javen O'Neal 2015-11-30 04:24:06 +00:00
parent b2a24f1a71
commit 71b587ef36

View File

@ -221,19 +221,23 @@ public interface Row extends Iterable<Cell> {
* Used to specify the different possible policies
* if for the case of null and blank cells
*/
public static final class MissingCellPolicy {
private static int NEXT_ID = 1;
public static enum MissingCellPolicy {
RETURN_NULL_AND_BLANK(),
RETURN_BLANK_AS_NULL(),
CREATE_NULL_AS_BLANK();
private int NEXT_ID = 1;
public final int id;
private MissingCellPolicy() {
this.id = NEXT_ID++;
}
}
/** Missing cells are returned as null, Blank cells are returned as normal */
public static final MissingCellPolicy RETURN_NULL_AND_BLANK = new MissingCellPolicy();
/** Missing cells are returned as null, as are blank cells */
public static final MissingCellPolicy RETURN_BLANK_AS_NULL = new MissingCellPolicy();
public static final MissingCellPolicy RETURN_NULL_AND_BLANK = MissingCellPolicy.RETURN_NULL_AND_BLANK;
/** Missing cells and blank cells are returned as null */
public static final MissingCellPolicy RETURN_BLANK_AS_NULL = MissingCellPolicy.RETURN_BLANK_AS_NULL;
/** A new, blank cell is created for missing cells. Blank cells are returned as normal */
public static final MissingCellPolicy CREATE_NULL_AS_BLANK = new MissingCellPolicy();
public static final MissingCellPolicy CREATE_NULL_AS_BLANK = MissingCellPolicy.CREATE_NULL_AS_BLANK;
/**
* Returns the rows outline level. Increased as you