CellProcessor
, StringCellProcessor
public class DMinMax extends CellProcessorAdaptor implements StringCellProcessor
MIN
or MAX
constants
provided in the class.Modifier and Type | Field | Description |
---|---|---|
static int |
MAX_8_BIT_SIGNED |
Maximum value for 8 bits (signed)
|
static int |
MAX_8_BIT_UNSIGNED |
Maximum value for 8 bits (unsigned)
|
static double |
MAX_CHAR |
Maximum value for a Character
|
static double |
MAX_DOUBLE |
Maximum value for a Double
|
static double |
MAX_SHORT |
Maximum value for a Short
|
static int |
MIN_8_BIT_SIGNED |
Minimum value for 8 bits (signed)
|
static int |
MIN_8_BIT_UNSIGNED |
Minimum value for 8 bits (unsigned)
|
static double |
MIN_CHAR |
Minimum value for a Character
|
static double |
MIN_DOUBLE |
Minimum value for a Double
|
static double |
MIN_SHORT |
Minimum value for a Short
|
next
Constructor | Description |
---|---|
DMinMax(double min,
double max) |
Constructs a new DMinMax processor, which converts the input to a Double and ensures the value is
between the supplied min and max values.
|
DMinMax(double min,
double max,
DoubleCellProcessor next) |
Constructs a new DMinMax processor, which converts the input to a Double, ensures the value is between
the supplied min and max values, then calls the next processor in the chain.
|
Modifier and Type | Method | Description |
---|---|---|
Object |
execute(Object value,
CsvContext context) |
This method is invoked by the framework when the processor needs to process data or check constraints.
|
toString, validateInputNotNull
public static final double MAX_DOUBLE
public static final double MIN_DOUBLE
public static final double MAX_SHORT
public static final double MIN_SHORT
public static final double MAX_CHAR
public static final double MIN_CHAR
public static final int MAX_8_BIT_UNSIGNED
public static final int MIN_8_BIT_UNSIGNED
public static final int MAX_8_BIT_SIGNED
public static final int MIN_8_BIT_SIGNED
public DMinMax(double min, double max)
min
- the minimum value (inclusive)max
- the maximum value (inclusive)IllegalArgumentException
- if max < min
public DMinMax(double min, double max, DoubleCellProcessor next)
min
- the minimum value (inclusive)max
- the maximum value (inclusive)next
- the next processor in the chainIllegalArgumentException
- if max < min
NullPointerException
- if next is nullpublic Object execute(Object value, CsvContext context)
execute
in interface CellProcessor
value
- the value to be processedcontext
- the CSV contextSuperCsvCellProcessorException
- if value is null or can't be parsed as a DoubleSuperCsvConstraintViolationException
- if value doesn't lie between min and max (inclusive)Copyright © 2007–2018 Super CSV. All rights reserved.