Package exceptions

Examples of exceptions.IllegalInputException


    this.sourceVertexID = sourceVertexID;

    String[] vertexToCost = edgeString.split(vertexToCostSep);
    if (vertexToCost.length != 2) {
      throw new IllegalInputException(edgeString);
    }

    int vertexID = -1;

    try {
      vertexID = Integer.parseInt(vertexToCost[0]);

    } catch (NumberFormatException e) {
      throw new IllegalInputException(edgeString);
    }

    if (vertexID < 0) {
      throw new IllegalInputException(edgeString);
    }

    this.setDestVertexID(vertexID);
    this.setCost(Integer.parseInt(vertexToCost[1]));
  }
View Full Code Here


    StringBuffer strBuff = new StringBuffer();
    Edge newEdge = null;
    final int VALUE = 0;

    if (numOfVertices == 0 || numOfVertices == 1) {
      throw new IllegalInputException(
          "Graph cannot be generated with zero or one vertex!");
    }
    for (int i = 0; i < numOfVertices; i++) {
      existingNums.clear();
      existingNums.put(i, VALUE);
View Full Code Here

     * Example : A->B:3,C:5,D:25 is split into vertexToEdges[0] = A
     * vertexToEdges[1] = B:3,C:5,D:25
     */
    String[] vertexToEdges = adjacencyListRecord.split(vertexToEdgesSep);
    if (vertexToEdges.length != 2) {
      throw new IllegalInputException(adjacencyListRecord);
    }
    int vertexID = -1;

    try {
      vertexID = Integer.parseInt(vertexToEdges[0]);

    } catch (NumberFormatException e) {
      throw new IllegalInputException(adjacencyListRecord);
    }

    if (vertexID < 0) {
      throw new IllegalInputException(adjacencyListRecord);
    }

    this.setVertexID(vertexID);
    this.setValue(JPregelConstants.INFINITY);

View Full Code Here

TOP

Related Classes of exceptions.IllegalInputException

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.