Package org.woped.metrics.exceptions

Examples of org.woped.metrics.exceptions.NaNException


    for(String key:pathMap.keySet())
      for(String childKey:pathMap.get(key))
        nodes.remove(childKey);
   
    if(nodes.size()!=1)
      throw new NaNException();
   
    String startNode = null;;
    for(String key:nodes)
      startNode=key;
   
View Full Code Here


   *
   * @return        Number of cut vertices
   * @throws NaNException This exception occurs if the net is no workflow net and thus has no cut vertices by definition
   */
  public double cutVertices() throws NaNException{
    if(!isFinite()) throw new NaNException();
   
    nodeHighlight = new HashSet<String>();
   
    double vertices = 0;
    HashSet<String> nodes = new HashSet<String>();
    for(String key:pathMap.keySet())
      nodes.add(key);
   
    for(String key:pathMap.keySet())
      for(String childKey:pathMap.get(key))
        nodes.remove(childKey);
   
    if(nodes.size()<1)
      throw new NaNException();
   
    Set<String> keySet = pathMap.keySet();
   
    String startNode = null;;
    for(String key:nodes)
View Full Code Here

   * @param places  Places after the separator
   * @return      Rounded number as a string
   * @throws NaNException  Gets thrown if the input string is no number at all
   */
  private static String round(double number, int places) throws NaNException{
    if(Double.isNaN(number)) throw new NaNException();
    else if(Double.isInfinite(number)) throw new NaNException(); //return ""+number;
    if(places == 0)
      return (int)Math.round(number)+"";
    String s = ((Math.round(number*Math.pow(10, places))))/Math.pow(10, places)+"";
    if(s.contains(".") && s.indexOf(".")+places+1 < s.length())
      s = s.substring(0, s.indexOf(".")+1+places);
View Full Code Here

TOP

Related Classes of org.woped.metrics.exceptions.NaNException

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.