Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.encog.ml.data.buffer
Class EncogEGBFile

    java.lang.Object
      org.encog.ml.data.buffer.EncogEGBFile

    public class EncogEGBFile

extends Object

Used to access an Encog Binary Training file (*.EGB).

Field Summary
`static int` | `DOUBLE_SIZE` The size of a double.
`static int` | `HEADER_SIZE` The size of the file header.

Constructor Summary
`EncogEGBFile(File theFile)` Construct an EGB file.

Method Summary
`void` | `addColumn(int col, boolean isInput)` Add a column.
`void` | `addRow(int row)` Add a row.
`void` | `close()` Close the file.
`void` | `create(int theInputCount, int theIdealCount)` Create a new RGB file.
`void` | `deleteCol(int col)` Delete a column.
`void` | `deleteRow(int row)` Delete a row.
`FileChannel` | `getFc()`
`File` | `getFile()`
`ByteBuffer` | `getHeaderBuffer()`
`int` | `getIdealCount()`
`int` | `getInputCount()`
`int` | `getNumberOfRecords()`
`RandomAccessFile` | `getRaf()`
`ByteBuffer` | `getRecordBuffer()`
`int` | `getRecordCount()`
`int` | `getRecordSize()`
`void` | `open()` OPen an existing EGB file.
`double` | `read()` Read a single double.
`void` | `read(double[] d)` Read an array of doubles.
`void` | `read(int row, double[] d)` Read a double array at the specified record.
`double` | `read(int row, int col)` Read a row and column.
`void` | `setLocation(int row)` Set the current location to the specified row.
`void` | `write(byte b)` Write a byte.
`void` | `write(double d)`
`void` | `write(double[] v)` Write an array.
`void` | `write(int row, double[] v)` Write an array at the specified record.
`void` | `write(int row, int col, double v)` Write the specified row and column.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DOUBLE_SIZE

    public static final int DOUBLE_SIZE

  The size of a double.

  See Also:
    Constant Field Values

### HEADER_SIZE

    public static final int HEADER_SIZE

  The size of the file header.

  See Also:
    Constant Field Values

Constructor Detail

### EncogEGBFile

    public EncogEGBFile(File theFile)

  Construct an EGB file.

  Parameters:
    `theFile` - The file.

Method Detail

### addColumn

    public final void addColumn(int col,
                                boolean isInput)

  Add a column.

  Parameters:
    `col` - THe column to add.
    `isInput` - Is this an input column?

### addRow

    public final void addRow(int row)

  Add a row.

  Parameters:
    `row` - Where to add the row.

### close

    public final void close()

  Close the file.

### create

    public final void create(int theInputCount,
                             int theIdealCount)

  Create a new RGB file.

  Parameters:
    `theInputCount` - The input count.
    `theIdealCount` - The ideal count.

### deleteCol

    public final void deleteCol(int col)

  Delete a column.

  Parameters:
    `col` - The column to delete.

### deleteRow

    public final void deleteRow(int row)

  Delete a row.

  Parameters:
    `row` - The row to delete.

### getFc

    public final FileChannel getFc()

  Returns:
    the fc

### getFile

    public final File getFile()

  Returns:
    the file

### getHeaderBuffer

    public final ByteBuffer getHeaderBuffer()

  Returns:
    the headerBuffer

### getIdealCount

    public final int getIdealCount()

  Returns:
    the idealCount

### getInputCount

    public final int getInputCount()

  Returns:
    the inputCount

### getNumberOfRecords

    public final int getNumberOfRecords()

  Returns:
    the numberOfRecords

### getRaf

    public final RandomAccessFile getRaf()

  Returns:
    the raf

### getRecordBuffer

    public final ByteBuffer getRecordBuffer()

  Returns:
    the recordBuffer

### getRecordCount

    public final int getRecordCount()

  Returns:
    the recordCount

### getRecordSize

    public final int getRecordSize()

  Returns:
    the recordSize

### open

    public final void open()

  OPen an existing EGB file.

### read

    public final double read()

  Read a single double.

  Returns:
    The double read.

### read

    public final void read(double[] d)

  Read an array of doubles.

  Parameters:
    `d` - The array to read into.

### read

    public final void read(int row,
                           double[] d)

  Read a double array at the specified record.

  Parameters:
    `row` - The record to read.
    `d` - The array to read into.

### read

    public final double read(int row,
                             int col)

  Read a row and column.

  Parameters:
    `row` - The row to read.
    `col` - The column to read.
  Returns:
    The value read.

### setLocation

    public final void setLocation(int row)

  Set the current location to the specified row.

  Parameters:
    `row` - The row.

### write

    public final void write(byte b)

  Write a byte.

  Parameters:
    `b` - The byte to write.

### write

    public final void write(double[] v)

  Write an array.

  Parameters:
    `v` - The array to write.

### write

    public final void write(int row,
                            double[] v)

  Write an array at the specified record.

  Parameters:
    `row` - The record to write.
    `v` - The array to write.

### write

    public final void write(int row,
                            int col,
                            double v)

  Write the specified row and column.

  Parameters:
    `row` - The row.
    `col` - The column.
    `v` - The value.

### write

    public void write(double d)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2011. All Rights Reserved.