Examples of FormatException


Examples of com.bbn.openmap.io.FormatException

    public synchronized void finishInitialization() throws FormatException {
        internTableName();
        try {
            inputFile = new BinaryBufferedFile(filename);
        } catch (IOException e) {
            throw new FormatException(e.toString());
        }
        try {
            byte preHeaderLen[] = inputFile.readBytes(4, false);

            char delim = inputFile.readChar();
            switch (delim) {
            case 'L':
            case 'l':
                delim = inputFile.readChar();
            //Intentional fall through to set byteorder
            case ';': //default is LSB first
                byteorder = false;
                inputFile.byteOrder(byteorder);
                break;
            case 'M':
            case 'm': //alternatively, it can be MSB first
                byteorder = true;
                inputFile.byteOrder(byteorder);
                delim = inputFile.readChar();
                break;
            default:
                throw new FormatException("Invalid Byte Encoding Format");
            }
            headerLength += MoreMath.BuildInteger(preHeaderLen, byteorder);
            if (delim != ';') {//Sanity check the input
                throw new FormatException("Unexpected character in header");
            }
            tableDescription = inputFile.readToDelimiter(';');
            documentationFileName = inputFile.readToDelimiter(';');
            if ("-".equals(documentationFileName)) {
                documentationFileName = null;
            }

            ArrayList tmpcols = new ArrayList();
            try {
                while (true) {
                    DcwColumnInfo dci = new DcwColumnInfo(inputFile);
                    int collen = dci.fieldLength();
                    if ((collen == -1) || (recordLength == -1)) {
                        recordLength = -1;
                    } else {
                        recordLength += collen;
                    }
                    tmpcols.add(dci);
                }
            } catch (EOFException e) {
            }

            columnInfo = new DcwColumnInfo[tmpcols.size()];
            tmpcols.toArray(columnInfo);

            cursorRow = 1;
        } catch (EOFException e) {
            throw new FormatException("Caught EOFException: " + e.getMessage());
        } catch (NullPointerException npe) {
        }
    }
View Full Code Here

Examples of com.bbn.openmap.io.FormatException

            throws FormatException {
        int retval[] = new int[names.length];
        for (int i = 0; i < retval.length; i++) {
            retval[i] = whatColumn(names[i]);
            if ((retval[i] == -1) && mustExist) {
                throw new FormatException("Column " + names[i]
                        + " doesn't exist");
            }
        }
        return retval;
    }
View Full Code Here

Examples of com.bbn.openmap.io.FormatException

                retval.add(newobj);
            }
            cursorRow++;
            return true;
        } catch (FormatException f) {
            throw new FormatException("DcwRecordFile: parserow on table "
                    + filename + ": " + f.getMessage());
        } catch (EOFException e) {
            if (retval.size() > 0) {
                throw new FormatException("DcwRecordFile: hit EOF when list = "
                        + VPFUtil.listToString(retval));
            }
            try {
                if (inputFile.available() > 0) {
                    throw new FormatException("DcwRecordFile: hit EOF with available = "
                            + inputFile.available()
                            + " when list = "
                            + VPFUtil.listToString(retval));
                }
            } catch (IOException i) {
                throw new FormatException("IOException calling available()");
            }
            return false;
        }
    }
View Full Code Here

Examples of com.bbn.openmap.io.FormatException

                offset = (recordLength * (recordNumber - 1)) + headerLength;
            }

            inputFile.seek(offset);
        } catch (IOException io) {
            throw new FormatException("SeekToRow IOException "
                    + io.getMessage() + " offset: " + offset + " " + tablename
                    + " " + filename);
        }
    }
View Full Code Here

Examples of com.bbn.openmap.io.FormatException

            }
            if (seekRow > 0) {
                seekToRow(seekRow);
            }
        } catch (IOException i) {
            throw new FormatException(i.getClass() + ": " + i.getMessage());
        }
    }
View Full Code Here

Examples of com.bbn.openmap.io.FormatException

        edgeLeftFaceAdapter = edges.getLeftFaceTilingAdapter();
        edgeRightEdgeAdapter = edges.getRightEdgeTilingAdapter();
        edgeLeftEdgeAdapter = edges.getLeftEdgeTilingAdapter();

        if (edges.topologyLevel() != 3) {
            throw new FormatException("AreaTable: need level 3 topology: "
                    + edges.topologyLevel());
        }

        rings = new DcwRecordFile(cov.getDataPath() + tile.getPath()
                + Constants.ringTableName + (cov.appendDot ? "." : ""));

        if ((ringStartColumn = rings.whatColumn(Constants.RNG_STARTEDGE)) == -1) {
            throw new FormatException("ring has no start edge: "
                    + rings.filename);
        }

        if ((faceIDColumn = rings.whatColumn(Constants.RNG_FACEID)) == -1) {
            throw new FormatException("ring has no face_id: " + rings.filename);
        }
    }
View Full Code Here

Examples of com.bbn.openmap.io.FormatException

                    prev_node = end_node;
                } else if (end_node == prev_node) {
                    nextedgeid = left_edge;
                    prev_node = start_node;
                } else {
                    throw new FormatException(" node matching assertion failed ");
                }
            } else if (fac_id == rht_face) {
                nextedgeid = right_edge;
                prev_node = end_node;
                polySize += cfs.tcount;
                allLLPoints.add(cfs);
            } else if (fac_id == lft_face) { //reverse direction
                nextedgeid = left_edge;
                prev_node = start_node;
                polySize += cfs.tcount;
                cfs.tcount *= -1;// flag reverse
                allLLPoints.add(cfs);
            } else {
                throw new FormatException("Node Assertion failed");
            }
        } while (nextedgeid != startedgeid);
        return polySize;
    }
View Full Code Here

Examples of com.bbn.openmap.io.FormatException

            //          com.bbn.openmap.util.Debug.output("VLI.init(): number
            // of entries(" + recordCount +
            //                                            ") HeaderLength(" + HeaderLength + ")");

        } catch (IOException i) {
            throw new FormatException("IOException with "
                    + inputstream.getName() + ": " + i.getMessage());
        }
    }
View Full Code Here

Examples of com.bbn.openmap.io.FormatException

            throws FormatException {
        super(cov, tile, isEntityNode ? Constants.endTableName
                : Constants.cndTableName);
        this.isEntityNode = isEntityNode;
        if ((coordColumn = whatColumn(Constants.ND_COORDINATE)) == -1) {
            throw new FormatException("nodetable couldn't get "
                    + Constants.ND_COORDINATE + " column");
        }
        firstEdgeColumn = whatColumn(Constants.ND_FIRSTEDGE);
        containingFaceColumn = whatColumn(Constants.ND_CONTAININGFACE);
    }
View Full Code Here

Examples of com.bbn.openmap.io.FormatException

     */
    public TextTable(CoverageTable cov, TileDirectory tile)
            throws FormatException {
        super(cov, tile, "txt");
        if ((coordColumn = whatColumn("shape_line")) == -1) {
            throw new FormatException("texttable couldn't get "
                    + "shape_line column");
        }
        if ((textColumn = whatColumn("string")) == -1) {
            throw new FormatException("texttable couldn't get "
                    + "string column");
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.