Package DataProcessing.Exceptions

Examples of DataProcessing.Exceptions.DataReadException


            while ((line = reader.readLine()) != null) {
                lines.add(line);
            }
            return lines;
        } catch (IOException e) {
            throw new DataReadException("Data read error: " + e);
        }
    }
View Full Code Here


    public Long readLong(Reader reader) throws DataReadException {
        Scanner scanner = new Scanner(reader);
        if (scanner.hasNextLong()) {
            return new Long(scanner.nextLong());
        } else {
            throw new DataReadException("Reading long value error");
        }
    }
View Full Code Here

    public Double readDouble(BufferedReader reader) throws DataReadException {
        Scanner scanner = new Scanner(reader);
        if (scanner.hasNextDouble()) {
            return new Double(scanner.nextDouble());
        } else {
            throw new DataReadException("Reading double value error");
        }
    }
View Full Code Here

    public String readString(BufferedReader reader) throws DataReadException {
        Scanner scanner = new Scanner(reader);
        if (scanner.hasNextLine()) {
            return scanner.nextLine();
        } else {
            throw new DataReadException("Reading string value error");
        }
    }
View Full Code Here

     */
    public Character readCharacter(BufferedReader reader) throws DataReadException {
        try {
            return new Character((char) reader.read());
        } catch (IOException e) {
            throw new DataReadException("Reading character value error");
        }
    }
View Full Code Here

            ArrayList<Long> array = new ArrayList<Long>();
            for (int i = 0; i < size; ++i) {
                if (scanner.hasNextLong()) {
                    array.add(new Long(scanner.nextLong()));
                } else {
                    throw new DataReadException("Reading array of long value error");
                }
            }
            return array;
        } else {
            throw new DataReadException("Reading array of long value error");
        }
    }
View Full Code Here

            ArrayList<Double> array = new ArrayList<Double>();
            for (int i = 0; i < size; ++i) {
                if (scanner.hasNextDouble()) {
                    array.add(new Double(scanner.nextDouble()));
                } else {
                    throw new DataReadException("Reading array of double value error");
                }
            }
            return array;
        } else {
            throw new DataReadException("Reading array of double value error");
        }
    }
View Full Code Here

            ArrayList<String> array = new ArrayList<String>();
            for (int i = 0; i < size; ++i) {
                if (scanner.hasNextLine()) {
                    array.add(scanner.nextLine());
                } else {
                    throw new DataReadException("Reading array of string value error");
                }
            }
            return array;
        } else {
            throw new DataReadException("Reading array of string value error");
        }
    }
View Full Code Here

TOP

Related Classes of DataProcessing.Exceptions.DataReadException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.