Java Code Examples for org.apache.commons.math.MathRuntimeException#createEOFException()

The following examples show how to use org.apache.commons.math.MathRuntimeException#createEOFException() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ValueServer.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Gets next sequential value from the <code>valuesFileURL</code>.
 * <p>
 * Throws an IOException if the read fails.</p>
 * <p>
 * This method will open the <code>valuesFileURL</code> if there is no
 * replay file open.</p>
 * <p>
 * The <code>valuesFileURL</code> will be closed and reopened to wrap around
 * from EOF to BOF if EOF is encountered. EOFException (which is a kind of
 * IOException) may still be thrown if the <code>valuesFileURL</code> is
 * empty.</p>
 *
 * @return next value from the replay file
 * @throws IOException if there is a problem reading from the file
 * @throws NumberFormatException if an invalid numeric string is
 *   encountered in the file
 */
private double getNextReplay() throws IOException {
    String str = null;
    if (filePointer == null) {
        resetReplayFile();
    }
    if ((str = filePointer.readLine()) == null) {
        // we have probably reached end of file, wrap around from EOF to BOF
        closeReplayFile();
        resetReplayFile();
        if ((str = filePointer.readLine()) == null) {
            throw MathRuntimeException.createEOFException("URL {0} contains no data",
                                                          valuesFileURL);
        }
    }
    return Double.valueOf(str).doubleValue();
}
 
Example 2
Source File: ValueServer.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Gets next sequential value from the <code>valuesFileURL</code>.
 * <p>
 * Throws an IOException if the read fails.</p>
 * <p>
 * This method will open the <code>valuesFileURL</code> if there is no
 * replay file open.</p>
 * <p>
 * The <code>valuesFileURL</code> will be closed and reopened to wrap around
 * from EOF to BOF if EOF is encountered. EOFException (which is a kind of
 * IOException) may still be thrown if the <code>valuesFileURL</code> is
 * empty.</p>
 *
 * @return next value from the replay file
 * @throws IOException if there is a problem reading from the file
 * @throws NumberFormatException if an invalid numeric string is
 *   encountered in the file
 */
private double getNextReplay() throws IOException {
    String str = null;
    if (filePointer == null) {
        resetReplayFile();
    }
    if ((str = filePointer.readLine()) == null) {
        // we have probably reached end of file, wrap around from EOF to BOF
        closeReplayFile();
        resetReplayFile();
        if ((str = filePointer.readLine()) == null) {
            throw MathRuntimeException.createEOFException(LocalizedFormats.URL_CONTAINS_NO_DATA,
                                                          valuesFileURL);
        }
    }
    return Double.valueOf(str).doubleValue();
}
 
Example 3
Source File: ValueServer.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Gets next sequential value from the <code>valuesFileURL</code>.
 * <p>
 * Throws an IOException if the read fails.</p>
 * <p>
 * This method will open the <code>valuesFileURL</code> if there is no
 * replay file open.</p>
 * <p>
 * The <code>valuesFileURL</code> will be closed and reopened to wrap around
 * from EOF to BOF if EOF is encountered. EOFException (which is a kind of
 * IOException) may still be thrown if the <code>valuesFileURL</code> is
 * empty.</p>
 *
 * @return next value from the replay file
 * @throws IOException if there is a problem reading from the file
 * @throws NumberFormatException if an invalid numeric string is
 *   encountered in the file
 */
private double getNextReplay() throws IOException {
    String str = null;
    if (filePointer == null) {
        resetReplayFile();
    }
    if ((str = filePointer.readLine()) == null) {
        // we have probably reached end of file, wrap around from EOF to BOF
        closeReplayFile();
        resetReplayFile();
        if ((str = filePointer.readLine()) == null) {
            throw MathRuntimeException.createEOFException(LocalizedFormats.URL_CONTAINS_NO_DATA,
                                                          valuesFileURL);
        }
    }
    return Double.valueOf(str).doubleValue();
}
 
Example 4
Source File: ValueServer.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Gets next sequential value from the <code>valuesFileURL</code>.
 * <p>
 * Throws an IOException if the read fails.</p>
 * <p>
 * This method will open the <code>valuesFileURL</code> if there is no
 * replay file open.</p>
 * <p>
 * The <code>valuesFileURL</code> will be closed and reopened to wrap around
 * from EOF to BOF if EOF is encountered. EOFException (which is a kind of
 * IOException) may still be thrown if the <code>valuesFileURL</code> is
 * empty.</p>
 *
 * @return next value from the replay file
 * @throws IOException if there is a problem reading from the file
 * @throws NumberFormatException if an invalid numeric string is
 *   encountered in the file
 */
private double getNextReplay() throws IOException {
    String str = null;
    if (filePointer == null) {
        resetReplayFile();
    }
    if ((str = filePointer.readLine()) == null) {
        // we have probably reached end of file, wrap around from EOF to BOF
        closeReplayFile();
        resetReplayFile();
        if ((str = filePointer.readLine()) == null) {
            throw MathRuntimeException.createEOFException(LocalizedFormats.URL_CONTAINS_NO_DATA,
                                                          valuesFileURL);
        }
    }
    return Double.valueOf(str).doubleValue();
}
 
Example 5
Source File: ValueServer.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Gets next sequential value from the <code>valuesFileURL</code>.
 * <p>
 * Throws an IOException if the read fails.</p>
 * <p>
 * This method will open the <code>valuesFileURL</code> if there is no
 * replay file open.</p>
 * <p>
 * The <code>valuesFileURL</code> will be closed and reopened to wrap around
 * from EOF to BOF if EOF is encountered. EOFException (which is a kind of
 * IOException) may still be thrown if the <code>valuesFileURL</code> is
 * empty.</p>
 *
 * @return next value from the replay file
 * @throws IOException if there is a problem reading from the file
 * @throws NumberFormatException if an invalid numeric string is
 *   encountered in the file
 */
private double getNextReplay() throws IOException {
    String str = null;
    if (filePointer == null) {
        resetReplayFile();
    }
    if ((str = filePointer.readLine()) == null) {
        // we have probably reached end of file, wrap around from EOF to BOF
        closeReplayFile();
        resetReplayFile();
        if ((str = filePointer.readLine()) == null) {
            throw MathRuntimeException.createEOFException("URL {0} contains no data",
                                                          valuesFileURL);
        }
    }
    return Double.valueOf(str).doubleValue();
}
 
Example 6
Source File: ValueServer.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Gets next sequential value from the <code>valuesFileURL</code>.
 * <p>
 * Throws an IOException if the read fails.</p>
 * <p>
 * This method will open the <code>valuesFileURL</code> if there is no
 * replay file open.</p>
 * <p>
 * The <code>valuesFileURL</code> will be closed and reopened to wrap around
 * from EOF to BOF if EOF is encountered. EOFException (which is a kind of
 * IOException) may still be thrown if the <code>valuesFileURL</code> is
 * empty.</p>
 *
 * @return next value from the replay file
 * @throws IOException if there is a problem reading from the file
 * @throws NumberFormatException if an invalid numeric string is
 *   encountered in the file
 */
private double getNextReplay() throws IOException {
    String str = null;
    if (filePointer == null) {
        resetReplayFile();
    }
    if ((str = filePointer.readLine()) == null) {
        // we have probably reached end of file, wrap around from EOF to BOF
        closeReplayFile();
        resetReplayFile();
        if ((str = filePointer.readLine()) == null) {
            throw MathRuntimeException.createEOFException("URL {0} contains no data",
                                                          valuesFileURL);
        }
    }
    return Double.valueOf(str).doubleValue();
}
 
Example 7
Source File: ValueServer.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Gets next sequential value from the <code>valuesFileURL</code>.
 * <p>
 * Throws an IOException if the read fails.</p>
 * <p>
 * This method will open the <code>valuesFileURL</code> if there is no
 * replay file open.</p>
 * <p>
 * The <code>valuesFileURL</code> will be closed and reopened to wrap around
 * from EOF to BOF if EOF is encountered. EOFException (which is a kind of
 * IOException) may still be thrown if the <code>valuesFileURL</code> is
 * empty.</p>
 *
 * @return next value from the replay file
 * @throws IOException if there is a problem reading from the file
 * @throws NumberFormatException if an invalid numeric string is
 *   encountered in the file
 */
private double getNextReplay() throws IOException {
    String str = null;
    if (filePointer == null) {
        resetReplayFile();
    }
    if ((str = filePointer.readLine()) == null) {
        // we have probably reached end of file, wrap around from EOF to BOF
        closeReplayFile();
        resetReplayFile();
        if ((str = filePointer.readLine()) == null) {
            throw MathRuntimeException.createEOFException("URL {0} contains no data",
                                                          valuesFileURL);
        }
    }
    return Double.valueOf(str).doubleValue();
}
 
Example 8
Source File: ValueServer.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Gets next sequential value from the <code>valuesFileURL</code>.
 * <p>
 * Throws an IOException if the read fails.</p>
 * <p>
 * This method will open the <code>valuesFileURL</code> if there is no
 * replay file open.</p>
 * <p>
 * The <code>valuesFileURL</code> will be closed and reopened to wrap around
 * from EOF to BOF if EOF is encountered. EOFException (which is a kind of
 * IOException) may still be thrown if the <code>valuesFileURL</code> is
 * empty.</p>
 *
 * @return next value from the replay file
 * @throws IOException if there is a problem reading from the file
 * @throws NumberFormatException if an invalid numeric string is
 *   encountered in the file
 */
private double getNextReplay() throws IOException {
    String str = null;
    if (filePointer == null) {
        resetReplayFile();
    }
    if ((str = filePointer.readLine()) == null) {
        // we have probably reached end of file, wrap around from EOF to BOF
        closeReplayFile();
        resetReplayFile();
        if ((str = filePointer.readLine()) == null) {
            throw MathRuntimeException.createEOFException("URL {0} contains no data",
                                                          valuesFileURL);
        }
    }
    return Double.valueOf(str).doubleValue();
}
 
Example 9
Source File: ValueServer.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Gets next sequential value from the <code>valuesFileURL</code>.
 * <p>
 * Throws an IOException if the read fails.</p>
 * <p>
 * This method will open the <code>valuesFileURL</code> if there is no
 * replay file open.</p>
 * <p>
 * The <code>valuesFileURL</code> will be closed and reopened to wrap around
 * from EOF to BOF if EOF is encountered. EOFException (which is a kind of
 * IOException) may still be thrown if the <code>valuesFileURL</code> is
 * empty.</p>
 *
 * @return next value from the replay file
 * @throws IOException if there is a problem reading from the file
 * @throws NumberFormatException if an invalid numeric string is
 *   encountered in the file
 */
private double getNextReplay() throws IOException {
    String str = null;
    if (filePointer == null) {
        resetReplayFile();
    }
    if ((str = filePointer.readLine()) == null) {
        // we have probably reached end of file, wrap around from EOF to BOF
        closeReplayFile();
        resetReplayFile();
        if ((str = filePointer.readLine()) == null) {
            throw MathRuntimeException.createEOFException("URL {0} contains no data",
                                                          valuesFileURL);
        }
    }
    return Double.valueOf(str).doubleValue();
}
 
Example 10
Source File: ValueServer.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Gets next sequential value from the <code>valuesFileURL</code>.
 * <p>
 * Throws an IOException if the read fails.</p>
 * <p>
 * This method will open the <code>valuesFileURL</code> if there is no
 * replay file open.</p>
 * <p>
 * The <code>valuesFileURL</code> will be closed and reopened to wrap around
 * from EOF to BOF if EOF is encountered. EOFException (which is a kind of
 * IOException) may still be thrown if the <code>valuesFileURL</code> is
 * empty.</p>
 *
 * @return next value from the replay file
 * @throws IOException if there is a problem reading from the file
 * @throws NumberFormatException if an invalid numeric string is
 *   encountered in the file
 */
private double getNextReplay() throws IOException {
    String str = null;
    if (filePointer == null) {
        resetReplayFile();
    }
    if ((str = filePointer.readLine()) == null) {
        // we have probably reached end of file, wrap around from EOF to BOF
        closeReplayFile();
        resetReplayFile();
        if ((str = filePointer.readLine()) == null) {
            throw MathRuntimeException.createEOFException("URL {0} contains no data",
                                                          valuesFileURL);
        }
    }
    return Double.valueOf(str).doubleValue();
}
 
Example 11
Source File: ValueServer.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Gets next sequential value from the <code>valuesFileURL</code>.
 * <p>
 * Throws an IOException if the read fails.</p>
 * <p>
 * This method will open the <code>valuesFileURL</code> if there is no
 * replay file open.</p>
 * <p>
 * The <code>valuesFileURL</code> will be closed and reopened to wrap around
 * from EOF to BOF if EOF is encountered. EOFException (which is a kind of
 * IOException) may still be thrown if the <code>valuesFileURL</code> is
 * empty.</p>
 *
 * @return next value from the replay file
 * @throws IOException if there is a problem reading from the file
 * @throws NumberFormatException if an invalid numeric string is
 *   encountered in the file
 */
private double getNextReplay() throws IOException {
    String str = null;
    if (filePointer == null) {
        resetReplayFile();
    }
    if ((str = filePointer.readLine()) == null) {
        // we have probably reached end of file, wrap around from EOF to BOF
        closeReplayFile();
        resetReplayFile();
        if ((str = filePointer.readLine()) == null) {
            throw MathRuntimeException.createEOFException(LocalizedFormats.URL_CONTAINS_NO_DATA,
                                                          valuesFileURL);
        }
    }
    return Double.valueOf(str).doubleValue();
}
 
Example 12
Source File: ValueServer.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Gets next sequential value from the <code>valuesFileURL</code>.
 * <p>
 * Throws an IOException if the read fails.</p>
 * <p>
 * This method will open the <code>valuesFileURL</code> if there is no
 * replay file open.</p>
 * <p>
 * The <code>valuesFileURL</code> will be closed and reopened to wrap around
 * from EOF to BOF if EOF is encountered. EOFException (which is a kind of
 * IOException) may still be thrown if the <code>valuesFileURL</code> is
 * empty.</p>
 *
 * @return next value from the replay file
 * @throws IOException if there is a problem reading from the file
 * @throws NumberFormatException if an invalid numeric string is
 *   encountered in the file
 */
private double getNextReplay() throws IOException {
    String str = null;
    if (filePointer == null) {
        resetReplayFile();
    }
    if ((str = filePointer.readLine()) == null) {
        // we have probably reached end of file, wrap around from EOF to BOF
        closeReplayFile();
        resetReplayFile();
        if ((str = filePointer.readLine()) == null) {
            throw MathRuntimeException.createEOFException("URL {0} contains no data",
                                                          valuesFileURL);
        }
    }
    return Double.valueOf(str).doubleValue();
}
 
Example 13
Source File: ValueServer.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Gets next sequential value from the <code>valuesFileURL</code>.
 * <p>
 * Throws an IOException if the read fails.</p>
 * <p>
 * This method will open the <code>valuesFileURL</code> if there is no
 * replay file open.</p>
 * <p>
 * The <code>valuesFileURL</code> will be closed and reopened to wrap around
 * from EOF to BOF if EOF is encountered. EOFException (which is a kind of
 * IOException) may still be thrown if the <code>valuesFileURL</code> is
 * empty.</p>
 *
 * @return next value from the replay file
 * @throws IOException if there is a problem reading from the file
 * @throws NumberFormatException if an invalid numeric string is
 *   encountered in the file
 */
private double getNextReplay() throws IOException {
    String str = null;
    if (filePointer == null) {
        resetReplayFile();
    }
    if ((str = filePointer.readLine()) == null) {
        // we have probably reached end of file, wrap around from EOF to BOF
        closeReplayFile();
        resetReplayFile();
        if ((str = filePointer.readLine()) == null) {
            throw MathRuntimeException.createEOFException("URL {0} contains no data",
                                                          valuesFileURL);
        }
    }
    return Double.valueOf(str).doubleValue();
}
 
Example 14
Source File: ValueServer.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Gets next sequential value from the <code>valuesFileURL</code>.
 * <p>
 * Throws an IOException if the read fails.</p>
 * <p>
 * This method will open the <code>valuesFileURL</code> if there is no
 * replay file open.</p>
 * <p>
 * The <code>valuesFileURL</code> will be closed and reopened to wrap around
 * from EOF to BOF if EOF is encountered. EOFException (which is a kind of
 * IOException) may still be thrown if the <code>valuesFileURL</code> is
 * empty.</p>
 *
 * @return next value from the replay file
 * @throws IOException if there is a problem reading from the file
 * @throws NumberFormatException if an invalid numeric string is
 *   encountered in the file
 */
private double getNextReplay() throws IOException {
    String str = null;
    if (filePointer == null) {
        resetReplayFile();
    }
    if ((str = filePointer.readLine()) == null) {
        // we have probably reached end of file, wrap around from EOF to BOF
        closeReplayFile();
        resetReplayFile();
        if ((str = filePointer.readLine()) == null) {
            throw MathRuntimeException.createEOFException("URL {0} contains no data",
                                                          valuesFileURL);
        }
    }
    return Double.valueOf(str).doubleValue();
}
 
Example 15
Source File: ValueServer.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Gets next sequential value from the <code>valuesFileURL</code>.
 * <p>
 * Throws an IOException if the read fails.</p>
 * <p>
 * This method will open the <code>valuesFileURL</code> if there is no
 * replay file open.</p>
 * <p>
 * The <code>valuesFileURL</code> will be closed and reopened to wrap around
 * from EOF to BOF if EOF is encountered. EOFException (which is a kind of
 * IOException) may still be thrown if the <code>valuesFileURL</code> is
 * empty.</p>
 *
 * @return next value from the replay file
 * @throws IOException if there is a problem reading from the file
 * @throws NumberFormatException if an invalid numeric string is
 *   encountered in the file
 */
private double getNextReplay() throws IOException {
    String str = null;
    if (filePointer == null) {
        resetReplayFile();
    }
    if ((str = filePointer.readLine()) == null) {
        // we have probably reached end of file, wrap around from EOF to BOF
        closeReplayFile();
        resetReplayFile();
        if ((str = filePointer.readLine()) == null) {
            throw MathRuntimeException.createEOFException("URL {0} contains no data",
                                                          valuesFileURL);
        }
    }
    return Double.valueOf(str).doubleValue();
}
 
Example 16
Source File: ValueServer.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Gets next sequential value from the <code>valuesFileURL</code>.
 * <p>
 * Throws an IOException if the read fails.</p>
 * <p>
 * This method will open the <code>valuesFileURL</code> if there is no
 * replay file open.</p>
 * <p>
 * The <code>valuesFileURL</code> will be closed and reopened to wrap around
 * from EOF to BOF if EOF is encountered. EOFException (which is a kind of
 * IOException) may still be thrown if the <code>valuesFileURL</code> is
 * empty.</p>
 *
 * @return next value from the replay file
 * @throws IOException if there is a problem reading from the file
 * @throws NumberFormatException if an invalid numeric string is
 *   encountered in the file
 */
private double getNextReplay() throws IOException {
    String str = null;
    if (filePointer == null) {
        resetReplayFile();
    }
    if ((str = filePointer.readLine()) == null) {
        // we have probably reached end of file, wrap around from EOF to BOF
        closeReplayFile();
        resetReplayFile();
        if ((str = filePointer.readLine()) == null) {
            throw MathRuntimeException.createEOFException("URL {0} contains no data",
                                                          valuesFileURL);
        }
    }
    return Double.valueOf(str).doubleValue();
}