Examples of KeyExistsException


Examples of org.helidb.lang.KeyExistsException

  public P insertCheckKeyUnique(K key, V value)
  {
    P pos = m_backend.find(key);
    if (pos != null)
    {
      throw new KeyExistsException("The key " + key + " already exists in the database.");
    }
    return insert(key, value);
  }
View Full Code Here

Examples of org.helidb.lang.KeyExistsException

  {
    assertNotClosed();
    assertNotReadOnly();
    if (m_tree.containsKey(key))
    {
      throw new KeyExistsException("The key " + key + " already exists in the database");
    }
    m_tree.insert(key, value);
    updateContentsVersion();
    return new KeyAndValue<K, V>(key, value);
  }
View Full Code Here

Examples of org.helidb.lang.KeyExistsException

    assertNotClosed();
    assertNotReadOnly();
    Long pos = find(key);
    if (pos != null)
    {
      throw new KeyExistsException("The key " + key + " already exists in the database");
    }
    return insert(key, value);
  }
View Full Code Here

Examples of org.helidb.lang.KeyExistsException

  static <T extends Comparable<T>> void insertRecord(final List<T> records, final T record)
  {
    int pos = Collections.binarySearch(records, record);
    if (pos >= 0)
    {
      throw new KeyExistsException("Bug. This should not happen. Record " + record);
    }

    records.add(-pos - 1, record);
  }
View Full Code Here

Examples of org.helidb.lang.KeyExistsException

      throw new DatabaseException("The B+ Tree index file was empty");
    }

    if (findRecord(key, nsr.m_node.getRecords()) >= 0)
    {
      throw new KeyExistsException("The key " + key + " already exists in the tree");
    }
    insertInternal(nsr, key, value);
  }
View Full Code Here

Examples of org.helidb.lang.KeyExistsException

    assertNotReadOnly();

    Long pos = find(key);
    if (pos != null)
    {
      throw new KeyExistsException("The key " + key + " already exists in the database");
    }
    return insert(key, value);
  }
View Full Code Here

Examples of org.helidb.lang.KeyExistsException

  public K insertCheckKeyUnique(K key, V value)
  {
    assertNotClosed();
    if (m_map.containsKey(key))
    {
      throw new KeyExistsException("The key " + key + " already exists in the database");
    }
    m_map.put(key, value);
    updateContentsVersion();
    return key;
  }
View Full Code Here

Examples of org.helidb.lang.KeyExistsException

    assertNotReadOnly();

    H keyHash = m_keyHasher.hash(key);
    if (m_tree.containsKey(keyHash))
    {
      throw new KeyExistsException("The key " + key + " already exists in the database");
    }
    P pos = getProxied().insert(key, value);
    m_tree.insert(keyHash, pos);
    return pos;
  }
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.