public final class DataReaderFiltered extends Object implements DataReader
Constructor and Description |
---|
DataReaderFiltered(DataReader inner,
DataReaderFilter filter)
Initializes a new instance of the
DataReaderFiltered class. |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the reader and any associated resources, such as database connections or files.
|
boolean |
getBoolean(int columnIndex)
Gets a boolean value for the specified column.
|
int |
getColumnCount()
Gets the number of columns (fields) in the data.
|
int |
getColumnIndex(String columnName)
Gets the zero based column index for a column name.
|
String |
getColumnName(int columnIndex)
Gets the name of the column at the specified index.
|
Class<?> |
getColumnType(int columnIndex)
Get the data type for the specified column.
|
double |
getDouble(int columnIndex)
Gets a double value for the specified column.
|
float |
getFloat(int columnIndex)
Gets a float value for the specified column.
|
int |
getInt(int columnIndex)
Gets an integer value for the specified column.
|
long |
getLong(int columnIndex)
Gets a long value for the specified column.
|
Object |
getObject(int columnIndex)
Gets an Object representation for the value at the specified column.
|
String |
getString(int columnIndex)
Gets a string value for the specified column.
|
boolean |
isNull(int columnIndex)
Determines whether the value is null (missing) for the specified column.
|
boolean |
read()
Moves to the next record, if any exist.
|
public DataReaderFiltered(DataReader inner, DataReaderFilter filter)
DataReaderFiltered
class.inner
- The existing data reader to filter.filter
- Determines whether a record should be included in the filtered data reader or not.public boolean read()
read
in interface DataReader
true
if the reader successfully moved to a new record, or false
if no more records are present.public void close()
DataReader
close
in interface DataReader
close
in interface Closeable
close
in interface AutoCloseable
public int getColumnIndex(String columnName)
DataRecord
getColumnIndex
in interface DataRecord
columnName
- The name of the column.public String getColumnName(int columnIndex)
DataRecord
getColumnName
in interface DataRecord
columnIndex
- The zero based index of the column.public Class<?> getColumnType(int columnIndex)
DataRecord
getColumnType
in interface DataRecord
public int getColumnCount()
DataRecord
getColumnCount
in interface DataRecord
public boolean isNull(int columnIndex)
DataRecord
isNull
in interface DataRecord
true
if the value is null (missing), false
otherwise.public Object getObject(int columnIndex)
DataRecord
getObject
in interface DataRecord
public String getString(int columnIndex)
DataRecord
getString
in interface DataRecord
public boolean getBoolean(int columnIndex)
DataRecord
getBoolean
in interface DataRecord
columnIndex
- The zero based column index.public int getInt(int columnIndex)
DataRecord
getInt
in interface DataRecord
columnIndex
- The zero based column index.public long getLong(int columnIndex)
DataRecord
getLong
in interface DataRecord
columnIndex
- The zero based column index.public double getDouble(int columnIndex)
DataRecord
getDouble
in interface DataRecord
columnIndex
- The zero based column index.public float getFloat(int columnIndex)
DataRecord
getFloat
in interface DataRecord
columnIndex
- The zero based column index.Copyright © 2021. All rights reserved.