Package ca.eandb.util

Examples of ca.eandb.util.UnexpectedException


  @Override
  public Attribute read(DataInput in, int size) throws IOException {
    try {
      return (Attribute) method.invoke(null, in, size);
    } catch (IllegalArgumentException e) {
      throw new UnexpectedException(e);
    } catch (IllegalAccessException e) {
      throw new UnexpectedException(e);
    } catch (InvocationTargetException e) {
      if (e.getCause() instanceof IOException) {
        throw (IOException) e.getCause();
      } else {
        throw new UnexpectedException(e);
      }
    }
  }
View Full Code Here


    }
    Method method;
    try {
      method = clazz.getMethod("read", DataInput.class, int.class);
    } catch (SecurityException e) {
      throw new UnexpectedException("Cannot access read method");
    } catch (NoSuchMethodException e) {
      throw new UnexpectedException("No read method");
    }
    registerAttributeReader(type.value(), new MethodAttributeReader(method));
  }
View Full Code Here

      switch (mutationType.get().next(random)) {
      case 0: return generateNewPath();
      case 1: return mutateImagePoint(path, 0.22);
      case 2: return mutateAll(path, 0.22);
      default:
        throw new UnexpectedException();
      }
    }
View Full Code Here

        /* store information about the path so we don't have to
         * regenerate it during the resampling phase.
         */
        if (path.getLightPathLength() > Short.MAX_VALUE) {
          throw new UnexpectedException("Light subpath too long.");
        }
        if (path.getEyePathLength() > Short.MAX_VALUE) {
          throw new UnexpectedException("Eye subpath too long.");
        }
        lightPathLength[i] = (short) path.getLightPathLength();
        eyePathLength[i] = (short) path.getEyePathLength();

        join(path.getLightTail(), path.getEyeTail(), weight);
View Full Code Here

    case INT: count = reader.readInt(); break;
    case UCHAR: count = reader.readUnsignedChar(); break;
    case USHORT: count = reader.readUnsignedShort(); break;
    case UINT: count = (int) reader.readUnsignedInt(); break;
    default:
      throw new UnexpectedException(String.format(
          "Illegal count type (%s)", countType));
    }

    if (count < 0) {
      throw new RuntimeException("List count must be non-negative");
View Full Code Here

    case FLOAT:
      return new PlyFloatProperty(reader.readFloat(), this);
    case DOUBLE:
      return new PlyFloatProperty(reader.readDouble(), this);
    default:
      throw new UnexpectedException(String.format(
          "Unknown data type (%s)", dataType));
    }
  }
View Full Code Here

        values.add(reader.readDouble());
      }
      return new PlyFloatListProperty(values, this);
    }
    default:
      throw new UnexpectedException(String.format(
          "Unknown data type (%s)", dataType));
    }
  }
View Full Code Here

          .createFileOutputStream(fileName) : new FileOutputStream(
          fileName);

      picture.write(os);
    } catch (IOException e) {
      throw new UnexpectedException(e);
    }
  }
View Full Code Here

          new int[] { height, width, 3 },
          new int[] { 3 * width, 3, 1 });
      matlab.flush();
      matlab.close();
    } catch (IOException e) {
      throw new UnexpectedException(e);
    }
  }
View Full Code Here

          new int[] { height, width, channels },
          new int[] { channels * width, channels, 1 });
      matlab.flush();
      matlab.close();
    } catch (IOException e) {
      throw new UnexpectedException(e);
    }
  }
View Full Code Here

TOP

Related Classes of ca.eandb.util.UnexpectedException

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.