Package de.lmu.ifi.dbs.elki.utilities.exceptions

Examples of de.lmu.ifi.dbs.elki.utilities.exceptions.AbortException


    boolean created = file.initialize(header);
    // Compute the actual cache size.
    this.cacheSize = cacheSizeBytes / header.getPageSize();

    if(this.cacheSize <= 0) {
      throw new AbortException("Invalid cache size: " + cacheSizeBytes + " / " + header.getPageSize() + " = " + cacheSize);
    }

    if(logger.isDebugging()) {
      logger.debug("LRU cache size is " + cacheSize + " pages.");
    }
View Full Code Here


  public static <C> C parameterizeOrAbort(Class<?> c, Parameterization config) {
    try {
      return tryInstantiate((Class<C>) c, c, config);
    }
    catch(Exception e) {
      throw new AbortException("Instantiation failed", e);
    }
  }
View Full Code Here

      if((data & 0x80) == 0) {
        return val;
      }
      bits += 7;
      if(bits > 35) {
        throw new AbortException("Variable length quantity is too long for expected integer.");
      }
    }
  }
View Full Code Here

      if((data & 0x80) == 0) {
        return val;
      }
      bits += 7;
      if(bits > 63) {
        throw new AbortException("Variable length quantity is too long for expected integer.");
      }
    }
  }
View Full Code Here

   * @param config Parameterization
   * @return Instance or {@code null}
   */
  public final Object make(Parameterization config) {
    if(state != STATE_FRESH) {
      throw new AbortException("Parameterizers may only be set up once!");
    }
    state = STATE_INIT;

    Object owner = this.getClass().getDeclaringClass();
    if(owner == null) {
      owner = this;
    }
    config = config.descend(owner);
    makeOptions(config);

    if(!config.hasErrors()) {
      state = STATE_COMPLETE;
      Object ret = makeInstance();
      if(ret == null) {
        throw new AbortException("makeInstance() returned null!", new Throwable());
      }
      return ret;
    }
    else {
      state = STATE_ERRORS;
View Full Code Here

      CharBuffer res;
      try {
        res = decoder.decode(subbuffer);
      }
      catch(CharacterCodingException e) {
        throw new AbortException("String not representable as UTF-8.", e);
      }
      // TODO: assert that the decoding did not yet advance the buffer!
      buffer.position(buffer.position() + len);
      return res.toString();
    }
View Full Code Here

      ByteBuffer data;
      try {
        data = encoder.encode(CharBuffer.wrap(obj));
      }
      catch(CharacterCodingException e) {
        throw new AbortException("String not representable as UTF-8.", e);
      }
      buffer.putInt(data.remaining());
      buffer.put(data);
    }
View Full Code Here

    public int getByteSize(String object) {
      try {
        return SIZE_INT + encoder.encode(CharBuffer.wrap(object)).remaining();
      }
      catch(CharacterCodingException e) {
        throw new AbortException("String not representable as UTF-8.", e);
      }
    }
View Full Code Here

      }
      if(!(aValue instanceof String)) {
        logger.warning("Was expecting a String value from the input element, got: " + aValue.getClass());
        return;
      }
      throw new AbortException("FIXME: INCOMPLETE TRANSITION");
      /* NV obj = database.get(id);
      if(obj == null) {
        logger.warning("Tried to edit removed object?");
        return;
      }
View Full Code Here

  private int mapDBID(DBID aKey) {
    // TODO: this is not the most efficient...
    int off = Collections.binarySearch(staticids, aKey);
    if(off < 0) {
      throw new AbortException("Did not find id " + aKey.toString() + " in staticids. " + staticids.contains(aKey));
    }
    return off + 1;
  }
View Full Code Here

TOP

Related Classes of de.lmu.ifi.dbs.elki.utilities.exceptions.AbortException

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.