All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.alachisoft.ncache.client.CacheReader Maven / Gradle / Ivy

There is a newer version: 5.3.0
Show newest version
package com.alachisoft.ncache.client;


import com.alachisoft.ncache.runtime.exceptions.CacheException;
import com.alachisoft.ncache.runtime.exceptions.OperationFailedException;

import java.io.IOException;

public interface CacheReader extends AutoCloseable
{
    /**
     Gets number of columns.
     */
    int getFieldCount();

    /**
     True, if reader is closed else false.
     */
    boolean getIsClosed();

    /**
     Advances ICacheReader to next record

     @return true if there are more rows; else false
     */
    boolean read() throws CacheException;

    /**
     Gets value of specified index as bool

     @param index Index of column
     @return bool value on specified index
     */
    boolean getBoolean(int index) throws OperationFailedException;

    /**
     Gets value of specified index as string

     @param index Index of column
     @return string value on specified column
     */
    String getString(int index) throws OperationFailedException;

    /**
     Gets value of specified index as decimal

     @param index Index of column
     @return decimal value on specified index
     */
    java.math.BigDecimal getBigDecimal(int index) throws OperationFailedException;

    /**
     Gets value of specified index as double

     @param index Index of column
     @return double value on specified index
     */
    double getDouble(int index) throws OperationFailedException;

    /**
     Gets value of specified index as 16 bit integer

     @param index Index of column
     @return Int16 value on specified index
     */
    short getShort(int index) throws OperationFailedException;

    /**
     Gets value of specified index as 32 bit integer

     @param index Index of column
     @return Int32 value on specified index
     */
    int getInt(int index) throws OperationFailedException;

    /**
     Gets value of specified index as 64 bit integer

     @param index Index of column
     @return Int64 value on specified index
     */
    long getLong(int index) throws OperationFailedException;

     
    /**
     * Gets value at specified column index
     * @param  get generic type value at specified column index
     * @param index
     * @param cls
     * @return long value on specified index
     * @throws IOException
     * @throws ClassNotFoundException
     */
     T getValue(int index, Class cls) throws IOException, ClassNotFoundException, OperationFailedException;

    /**
     Gets value of specified column name.

     @return Object value of specified column
      * @param columnName Name of column
     * @param cls
     */
     T getValue(String columnName, Class cls) throws IOException, ClassNotFoundException, OperationFailedException;

    /**
     Populates array of objects with values in current row

     @return No of objects copied in specified array
      * @param objects array of objects to be populated
     * @param cls
     */
    int getValues(Object[] objects, Class cls) throws IOException, ClassNotFoundException, OperationFailedException;

    /**
     Returns name of specified column index

     @param index Index of column
     @return Name of column
     */
    String getName(int index);

    /**
     Returns index of specified column name

     @param columnName Name of column
     @return Index of column
     */
    int getOrdinal(String columnName);

    /**
     Returns DateTime at specified column index

     @param index Index of Column
     @return
     */
    java.util.Date getDate(int index) throws OperationFailedException;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy