Package io.deephaven.plot.util
Class ArgumentValidations
java.lang.Object
io.deephaven.plot.util.ArgumentValidations
Utilities for validating that plotting arguments are acceptable.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidassertColumnsInTable(TableDefinition t, PlotInfo plotInfo, String... cols) Requires all columns incolsbe columns in the table.static voidassertColumnsInTable(Table t, PlotInfo plotInfo, String... cols) Requires all columns incolsbe columns in the table.static voidassertColumnsInTable(SelectableDataSet sds, PlotInfo plotInfo, String... cols) Requires all columns incolsbe columns in the selectable dataset.static voidassertColumnsInTable(TableHandle t, PlotInfo plotInfo, String... cols) Requires all columns incolsbe columns in the table held by the handle.static voidassertGreaterThan0(double d, String name, PlotInfo plotInfo) Requires the input objectoto be non-null.static voidassertInstance(TableDefinition t, String column, Class c, String message, PlotInfo plotInfo) static voidstatic voidassertInstance(SelectableDataSet sds, String column, Class c, String message, PlotInfo plotInfo) static voidassertInstance(Class c1, Class c2, String message, PlotInfo plotInfo) static voidassertIsBoxedNumeric(Table t, String column, PlotInfo plotInfo) Requires the column's data type to be an instance ofNumberas defined inNumericTypeUtils.isBoxedNumeric(Class)static voidassertIsBoxedNumeric(Table t, String column, String message, PlotInfo plotInfo) Requires the column's data type to be an instance ofNumberas defined inNumericTypeUtils.isBoxedNumeric(Class)static voidassertIsNumeric(TableDefinition t, String column, PlotInfo plotInfo) Requires the column's data type to be a numeric instance as defined inNumericTypeUtils.isNumeric(Class)static voidassertIsNumeric(TableDefinition t, String column, String message, PlotInfo plotInfo) Requires the column's data type to be a numeric instance as defined inNumericTypeUtils.isNumeric(Class)static voidassertIsNumeric(Table t, String column, PlotInfo plotInfo) Requires the column's data type to be a numeric instance as defined inNumericTypeUtils.isNumeric(Class)static voidassertIsNumeric(Table t, String column, String message, PlotInfo plotInfo) Requires the column's data type to be a numeric instance as defined inNumericTypeUtils.isNumeric(Class)static voidassertIsNumeric(SelectableDataSet sds, String column, String message, PlotInfo plotInfo) Requires the column's data type to be a numeric instance as defined inNumericTypeUtils.isNumeric(Class)static voidassertIsNumericOrTime(TableDefinition t, String column, PlotInfo plotInfo) Requires the column's data type to be a numeric or time instance as defined inisNumericOrTime(Class, PlotInfo)static voidassertIsNumericOrTime(TableDefinition t, String column, String message, PlotInfo plotInfo) Requires the column's data type to be a numeric or time instance as defined inisNumericOrTime(Class, PlotInfo)static voidassertIsNumericOrTime(Table t, String column, PlotInfo plotInfo) Requires the column's data type to be a numeric or time instance as defined inisNumericOrTime(Class, PlotInfo)static voidassertIsNumericOrTime(Table t, String column, String message, PlotInfo plotInfo) Requires the column's data type to be a numeric or time instance as defined inisNumericOrTime(Class, PlotInfo)static voidassertIsNumericOrTime(SelectableDataSet sds, String column, PlotInfo plotInfo) Requires the column's data type to be a numeric or time instance as defined inisNumericOrTime(Class, PlotInfo)static voidassertIsNumericOrTime(SelectableDataSet sds, String column, String message, PlotInfo plotInfo) Requires the column's data type to be a numeric or time instance as defined inisNumericOrTime(Class, PlotInfo)static voidassertIsNumericOrTimeOrCharOrComparableInstance(TableDefinition t, String column, PlotInfo plotInfo) static voidassertIsNumericOrTimeOrCharOrComparableInstance(TableDefinition t, String column, String message, PlotInfo plotInfo) static voidassertIsNumericOrTimeOrCharOrComparableInstance(Table t, String column, PlotInfo plotInfo) static voidassertIsNumericOrTimeOrCharOrComparableInstance(Table t, String column, String message, PlotInfo plotInfo) static voidassertIsPrimitiveNumeric(Table t, String column, PlotInfo plotInfo) Requires the column's data type to be a numeric primitive as defined inNumericTypeUtils.isPrimitiveNumeric(Class)static voidassertIsPrimitiveNumeric(Table t, String column, String message, PlotInfo plotInfo) Requires the column's data type to be a numeric primitive as defined inNumericTypeUtils.isPrimitiveNumeric(Class)static voidassertIsTime(TableDefinition t, String column, PlotInfo plotInfo) Requires the column's data type to be a time instance as defined inisTime(Class, PlotInfo)static voidassertIsTime(TableDefinition t, String column, String message, PlotInfo plotInfo) Requires the column's data type to be a time instance as defined inisTime(Class, PlotInfo)static voidassertIsTime(Table t, String column, PlotInfo plotInfo) Requires the column's data type to be a time instance as defined inisTime(Class, PlotInfo)static voidassertIsTime(Table t, String column, String message, PlotInfo plotInfo) Requires the column's data type to be a time instance as defined inisTime(Class, PlotInfo)static voidassertNotNull(Object o, String message, PlotInfo plotInfo) Requires the input objectoto be non-null.static <T> voidassertNotNullAndNotEmpty(T[] o, String message, PlotInfo plotInfo) Requires the input objectoto be non-null.static voidassertNull(Object o, String message, PlotInfo plotInfo) static voidassertSameSize(IndexableNumericData[] data, String[] dataNames, PlotInfo plotInfo) RequiresdataanddataNames1.static ClassgetColumnType(TableDefinition t, String column, PlotInfo plotInfo) Gets the data type of thecolumn.static ClassgetColumnType(Table t, String column, PlotInfo plotInfo) Gets the data type of thecolumn.static ClassgetColumnType(SelectableDataSet sds, String column, PlotInfo plotInfo) Gets the data type of thecolumn.static booleanisBoxedNumeric(Table t, String column, PlotInfo plotInfo) Whether the column's data typeNumericTypeUtils.isBoxedNumeric(Class).static booleanisNumeric(TableDefinition t, String column, PlotInfo plotInfo) Whether the column's data typeNumericTypeUtils.isNumeric(Class).static booleanWhether the column's data typeNumericTypeUtils.isNumeric(Class).static booleanisNumeric(SelectableDataSet sds, String column, PlotInfo plotInfo) Whether the column's data typeNumericTypeUtils.isNumeric(Class).static booleanisNumericOrTime(TableDefinition t, String column, PlotInfo plotInfo) Whether the column's data typeisNumericOrTime(Class, PlotInfo).static booleanisNumericOrTime(Table t, String column, PlotInfo plotInfo) Whether the column's data typeisNumericOrTime(Class, PlotInfo).static booleanisNumericOrTime(SelectableDataSet sds, String column, PlotInfo plotInfo) Whether the column's data typeisNumericOrTime(Class, PlotInfo).static booleanWhether the class isNumericTypeUtils.isNumeric(Class)orisTime(Class, PlotInfo)static booleanisNumericOrTime(Class c, PlotInfo plotInfo) Whether the class isNumericTypeUtils.isNumeric(Class)orisTime(Class, PlotInfo)static booleanisPrimitiveNumeric(Table t, String column, PlotInfo plotInfo) Whether the column's data typeNumericTypeUtils.isPrimitiveNumeric(Class).static booleanisTime(TableDefinition t, String column, PlotInfo plotInfo) Whether the column's data type equals Date.class or Instant.classstatic booleanWhether the column's data type equals Date.class or Instant.classstatic booleanisTime(SelectableDataSet sds, String column, PlotInfo plotInfo) Whether the column's data type equals Date.class or Instant.classstatic booleanWhether the class is equal to Date.class or Instant.classstatic booleannanSafeEquals(double x, double x1)
-
Constructor Details
-
ArgumentValidations
public ArgumentValidations()
-
-
Method Details
-
assertGreaterThan0
Requires the input objectoto be non-null.- Parameters:
d- valuename- variable nameplotInfo- source of the exception- Throws:
IllegalArgumentException-ois null
-
assertNotNull
Requires the input objectoto be non-null.- Parameters:
o- objectmessage- error messageplotInfo- source of the exception- Throws:
IllegalArgumentException-ois null
-
assertNotNullAndNotEmpty
Requires the input objectoto be non-null.- Parameters:
o- objectmessage- error messageplotInfo- source of the exception- Throws:
IllegalArgumentException-ois null
-
assertNull
-
assertInstance
- Parameters:
c1- classc2- classmessage- error messageplotInfo- source of the exception- Throws:
NullPointerException-c1andc2must not be nullPlotRuntimeException-c1is not assignable toc2IllegalArgumentException-ois null
-
assertInstance
public static void assertInstance(Table t, String column, Class c, String message, PlotInfo plotInfo) - Parameters:
t- tablecolumn- columnc- classmessage- error messageplotInfo- source of the exception- Throws:
NullPointerException-tandcmust not be nullPlotRuntimeException-columnis not a column oft, orcolumndoes not have data typec
-
assertInstance
public static void assertInstance(TableDefinition t, String column, Class c, String message, PlotInfo plotInfo) - Parameters:
t- tablecolumn- columnc- classmessage- error messageplotInfo- source of the exception- Throws:
NullPointerException-tandcmust not be nullPlotRuntimeException-columnis not a column oft, orcolumndoes not have data typec
-
assertInstance
public static void assertInstance(SelectableDataSet sds, String column, Class c, String message, PlotInfo plotInfo) - Parameters:
sds- swappable data setcolumn- columnc- classmessage- error messageplotInfo- source of the exception- Throws:
NullPointerException-sdsandcmust not be nullPlotRuntimeException-columnis not a column oft, orcolumndoes not have data typec
-
assertIsNumericOrTimeOrCharOrComparableInstance
public static void assertIsNumericOrTimeOrCharOrComparableInstance(Table t, String column, PlotInfo plotInfo) - Parameters:
t- tablecolumn- columnplotInfo- source of the exception- Throws:
NullPointerException-tmust not be nullPlotRuntimeException-columnis not a column oft, orcolumndoes not have the correct data type
-
assertIsNumericOrTimeOrCharOrComparableInstance
public static void assertIsNumericOrTimeOrCharOrComparableInstance(TableDefinition t, String column, PlotInfo plotInfo) - Parameters:
t- tablecolumn- columnplotInfo- source of the exception- Throws:
NullPointerException-tmust not be nullPlotRuntimeException-columnis not a column oft, orcolumndoes not have the correct data type
-
assertIsNumericOrTimeOrCharOrComparableInstance
public static void assertIsNumericOrTimeOrCharOrComparableInstance(Table t, String column, String message, PlotInfo plotInfo) - Parameters:
t- tablecolumn- columnmessage- error messageplotInfo- source of the exception- Throws:
NullPointerException-tmust not be nullPlotRuntimeException-columnis not a column oft, orcolumndoes not have the correct data type
-
assertIsNumericOrTimeOrCharOrComparableInstance
public static void assertIsNumericOrTimeOrCharOrComparableInstance(TableDefinition t, String column, String message, PlotInfo plotInfo) - Parameters:
t- tablecolumn- columnmessage- error messageplotInfo- source of the exception- Throws:
NullPointerException-tmust not be nullPlotRuntimeException-columnis not a column oft, orcolumndoes not have the correct data type
-
assertSameSize
public static void assertSameSize(IndexableNumericData[] data, String[] dataNames, PlotInfo plotInfo) RequiresdataanddataNames1. contain the same number of members. 2. contain no null members All members ofdatamust be the same size.- Parameters:
data- array ofIndexableNumericDatadataNames- names for eachIndexableNumericDataplotInfo- source of the exception- Throws:
PlotIllegalStateException-dataanddataNamesare not the same sizePlotIllegalArgumentException- a member ofdataordataNamesis null 2+ members ofdataare not the same size
-
getColumnType
Gets the data type of thecolumn.- Parameters:
t- tablecolumn- columnplotInfo- source of the exception- Returns:
- data type of
column - Throws:
PlotRuntimeException-columnnot in the table
-
getColumnType
Gets the data type of thecolumn.- Parameters:
t- tablecolumn- columnplotInfo- source of the exception- Returns:
- data type of
column - Throws:
PlotRuntimeException-columnnot in the table
-
getColumnType
Gets the data type of thecolumn.- Parameters:
sds- selectable datasetcolumn- columnplotInfo- source of the exception- Returns:
- data type of
column - Throws:
PlotRuntimeException-columnnot in the table
-
isTime
Whether the class is equal to Date.class or Instant.class- Parameters:
c- classplotInfo- source of the exception- Returns:
- true if
cequals Date.class or Instant.class, false otherwise
-
isNumericOrTime
Whether the class isNumericTypeUtils.isNumeric(Class)orisTime(Class, PlotInfo)- Parameters:
c- class- Returns:
- true if
cis a numeric or time class, false otherwise
-
isNumericOrTime
Whether the class isNumericTypeUtils.isNumeric(Class)orisTime(Class, PlotInfo)- Parameters:
c- classplotInfo- source of the exception- Returns:
- true if
cis a numeric or time class, false otherwise
-
isTime
Whether the column's data type equals Date.class or Instant.class- Parameters:
t- tablecolumn- columnplotInfo- source of the exception- Returns:
- true if the column's data type equals Date.class or Instant.class, false otherwise
-
isTime
Whether the column's data type equals Date.class or Instant.class- Parameters:
t- tablecolumn- columnplotInfo- source of the exception- Returns:
- true if the column's data type equals Date.class or Instant.class, false otherwise
-
isTime
Whether the column's data type equals Date.class or Instant.class- Parameters:
sds- selectable datasetcolumn- columnplotInfo- source of the exception- Returns:
- true if the column's data type equals Date.class or Instant.class, false otherwise
-
isPrimitiveNumeric
Whether the column's data typeNumericTypeUtils.isPrimitiveNumeric(Class).- Parameters:
t- tablecolumn- columnplotInfo- source of the exception- Returns:
- true if the column's data type is a numeric primitive, false otherwise
-
isBoxedNumeric
Whether the column's data typeNumericTypeUtils.isBoxedNumeric(Class).- Parameters:
t- tablecolumn- columnplotInfo- source of the exception- Returns:
- true if the column's data type is a boxed numeric, false otherwise
-
isNumeric
Whether the column's data typeNumericTypeUtils.isNumeric(Class).- Parameters:
t- tablecolumn- columnplotInfo- source of the exception- Returns:
- true if the column's data type is numeric, false otherwise
-
isNumeric
Whether the column's data typeNumericTypeUtils.isNumeric(Class).- Parameters:
t- tablecolumn- columnplotInfo- source of the exception- Returns:
- true if the column's data type is numeric, false otherwise
-
isNumeric
Whether the column's data typeNumericTypeUtils.isNumeric(Class).- Parameters:
sds- selectable datasetcolumn- columnplotInfo- source of the exception- Returns:
- true if the column's data type is numeric, false otherwise
-
isNumericOrTime
Whether the column's data typeisNumericOrTime(Class, PlotInfo).- Parameters:
t- tablecolumn- columnplotInfo- source of the exception- Returns:
- true if the column's data type is a numeric or time instance, false otherwise
-
isNumericOrTime
Whether the column's data typeisNumericOrTime(Class, PlotInfo).- Parameters:
t- tablecolumn- columnplotInfo- source of the exception- Returns:
- true if the column's data type is a numeric or time instance, false otherwise
-
isNumericOrTime
Whether the column's data typeisNumericOrTime(Class, PlotInfo).- Parameters:
sds- selectable datasetcolumn- columnplotInfo- source of the exception- Returns:
- true if the column's data type is a numeric or time instance, false otherwise
-
assertIsTime
Requires the column's data type to be a time instance as defined inisTime(Class, PlotInfo)- Parameters:
t- tablecolumn- columnplotInfo- source of the exception- Throws:
RuntimeException- if the column's data type isn't a time instance
-
assertIsTime
Requires the column's data type to be a time instance as defined inisTime(Class, PlotInfo)- Parameters:
t- tablecolumn- columnplotInfo- source of the exception- Throws:
RuntimeException- if the column's data type isn't a time instance
-
assertIsTime
Requires the column's data type to be a time instance as defined inisTime(Class, PlotInfo)- Parameters:
t- tablecolumn- columnplotInfo- source of the exceptionmessage- error message- Throws:
RuntimeException- if the column's data type isn't a time instance
-
assertIsTime
public static void assertIsTime(TableDefinition t, String column, String message, PlotInfo plotInfo) Requires the column's data type to be a time instance as defined inisTime(Class, PlotInfo)- Parameters:
t- tablecolumn- columnplotInfo- source of the exceptionmessage- error message- Throws:
RuntimeException- if the column's data type isn't a time instance
-
assertIsPrimitiveNumeric
Requires the column's data type to be a numeric primitive as defined inNumericTypeUtils.isPrimitiveNumeric(Class)- Parameters:
t- tablecolumn- columnplotInfo- source of the exception- Throws:
RuntimeException- if the column's data type isn't a numeric primitive
-
assertIsPrimitiveNumeric
public static void assertIsPrimitiveNumeric(Table t, String column, String message, PlotInfo plotInfo) Requires the column's data type to be a numeric primitive as defined inNumericTypeUtils.isPrimitiveNumeric(Class)- Parameters:
t- tablecolumn- columnplotInfo- source of the exceptionmessage- error message- Throws:
RuntimeException- if the column's data type isn't a numeric primitive
-
assertIsBoxedNumeric
Requires the column's data type to be an instance ofNumberas defined inNumericTypeUtils.isBoxedNumeric(Class)- Parameters:
t- tablecolumn- columnplotInfo- source of the exception- Throws:
RuntimeException- if the column's data type isn't an instance ofNumber
-
assertIsBoxedNumeric
Requires the column's data type to be an instance ofNumberas defined inNumericTypeUtils.isBoxedNumeric(Class)- Parameters:
t- tablecolumn- columnmessage- error messageplotInfo- source of the exception- Throws:
RuntimeException- if the column's data type isn't an instance ofNumber
-
assertIsNumeric
Requires the column's data type to be a numeric instance as defined inNumericTypeUtils.isNumeric(Class)- Parameters:
t- tablecolumn- columnplotInfo- source of the exception- Throws:
PlotRuntimeException- if the column's data type isn't a numeric instance
-
assertIsNumeric
Requires the column's data type to be a numeric instance as defined inNumericTypeUtils.isNumeric(Class)- Parameters:
t- tablecolumn- columnplotInfo- source of the exception- Throws:
PlotRuntimeException- if the column's data type isn't a numeric instance
-
assertIsNumeric
Requires the column's data type to be a numeric instance as defined inNumericTypeUtils.isNumeric(Class)- Parameters:
t- tablecolumn- columnmessage- error messageplotInfo- source of the exception- Throws:
PlotRuntimeException- if the column's data type isn't a numeric instance
-
assertIsNumeric
public static void assertIsNumeric(TableDefinition t, String column, String message, PlotInfo plotInfo) Requires the column's data type to be a numeric instance as defined inNumericTypeUtils.isNumeric(Class)- Parameters:
t- tablecolumn- columnmessage- error messageplotInfo- source of the exception- Throws:
PlotRuntimeException- if the column's data type isn't a numeric instance
-
assertIsNumeric
public static void assertIsNumeric(SelectableDataSet sds, String column, String message, PlotInfo plotInfo) Requires the column's data type to be a numeric instance as defined inNumericTypeUtils.isNumeric(Class)- Parameters:
sds- selectable datasetcolumn- columnmessage- error messageplotInfo- source of the exception- Throws:
PlotRuntimeException- if the column's data type isn't a numeric instance
-
assertIsNumericOrTime
Requires the column's data type to be a numeric or time instance as defined inisNumericOrTime(Class, PlotInfo)- Parameters:
t- tablecolumn- columnplotInfo- source of the exception- Throws:
PlotRuntimeException- if the column's data type isn't a numeric or time instance
-
assertIsNumericOrTime
Requires the column's data type to be a numeric or time instance as defined inisNumericOrTime(Class, PlotInfo)- Parameters:
t- tablecolumn- columnplotInfo- source of the exception- Throws:
PlotRuntimeException- if the column's data type isn't a numeric or time instance
-
assertIsNumericOrTime
Requires the column's data type to be a numeric or time instance as defined inisNumericOrTime(Class, PlotInfo)- Parameters:
sds- selectable datasetcolumn- columnplotInfo- source of the exception- Throws:
PlotRuntimeException- if the column's data type isn't a numeric or time instance
-
assertIsNumericOrTime
Requires the column's data type to be a numeric or time instance as defined inisNumericOrTime(Class, PlotInfo)- Parameters:
t- tablecolumn- columnmessage- error messageplotInfo- source of the exception- Throws:
PlotRuntimeException- if the column's data type isn't a numeric or time instance
-
assertIsNumericOrTime
public static void assertIsNumericOrTime(TableDefinition t, String column, String message, PlotInfo plotInfo) Requires the column's data type to be a numeric or time instance as defined inisNumericOrTime(Class, PlotInfo)- Parameters:
t- tablecolumn- columnmessage- error messageplotInfo- source of the exception- Throws:
PlotRuntimeException- if the column's data type isn't a numeric or time instance
-
assertIsNumericOrTime
public static void assertIsNumericOrTime(SelectableDataSet sds, String column, String message, PlotInfo plotInfo) Requires the column's data type to be a numeric or time instance as defined inisNumericOrTime(Class, PlotInfo)- Parameters:
sds- selectable datasetcolumn- columnmessage- error messageplotInfo- source of the exception- Throws:
PlotRuntimeException- if the column's data type isn't a numeric or time instance
-
assertColumnsInTable
Requires all columns incolsbe columns in the table.- Parameters:
t- tableplotInfo- source of the exceptioncols- column names- Throws:
IllegalArgumentException- if the table does not contain all columns
-
assertColumnsInTable
Requires all columns incolsbe columns in the table.- Parameters:
t- tableplotInfo- source of the exceptioncols- column names- Throws:
IllegalArgumentException- if the table does not contain all columns
-
assertColumnsInTable
Requires all columns incolsbe columns in the selectable dataset.- Parameters:
sds- selectable datasetplotInfo- source of the exceptioncols- column names- Throws:
IllegalArgumentException- if the table does not contain all columns
-
assertColumnsInTable
Requires all columns incolsbe columns in the table held by the handle.- Parameters:
t- table handleplotInfo- source of the exceptioncols- column names- Throws:
IllegalArgumentException- if the underlying table does not contain all columns
-
nanSafeEquals
public static boolean nanSafeEquals(double x, double x1)
-