Codota Logo
DataUtils.copyWithGap
Code IndexAdd Codota to your IDE (free)

How to use
copyWithGap
method
in
org.h2.mvstore.DataUtils

Best Java code snippets using org.h2.mvstore.DataUtils.copyWithGap (Showing top 8 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
StringBuilder s =
  • Codota Iconnew StringBuilder()
  • Codota Iconnew StringBuilder(32)
  • Codota IconString str;new StringBuilder(str)
  • Smart code suggestions by Codota
}
origin: com.h2database/h2

/**
 * Insert a child page into this node.
 *
 * @param index the index
 * @param key the key
 * @param childPage the child page
 */
public void insertNode(int index, Object key, Page childPage) {
  Object[] newKeys = new Object[keys.length + 1];
  DataUtils.copyWithGap(keys, newKeys, keys.length, index);
  newKeys[index] = key;
  keys = newKeys;
  int childCount = children.length;
  PageReference[] newChildren = new PageReference[childCount + 1];
  DataUtils.copyWithGap(children, newChildren, childCount, index);
  newChildren[index] = new PageReference(
      childPage, childPage.getPos(), childPage.totalCount);
  children = newChildren;
  totalCount += childPage.totalCount;
  if(isPersistent()) {
    addMemory(map.getKeyType().getMemory(key) +
        DataUtils.PAGE_MEMORY_CHILD);
  }
}
origin: com.h2database/h2

/**
 * Insert a key-value pair into this leaf.
 *
 * @param index the index
 * @param key the key
 * @param value the value
 */
public void insertLeaf(int index, Object key, Object value) {
  int len = keys.length + 1;
  Object[] newKeys = new Object[len];
  DataUtils.copyWithGap(keys, newKeys, len - 1, index);
  keys = newKeys;
  Object[] newValues = new Object[len];
  DataUtils.copyWithGap(values, newValues, len - 1, index);
  values = newValues;
  keys[index] = key;
  values[index] = value;
  totalCount++;
  if(isPersistent()) {
    addMemory(map.getKeyType().getMemory(key) +
        map.getValueType().getMemory(value));
  }
}
origin: com.eventsourcing/h2

/**
 * Insert a key-value pair into this leaf.
 *
 * @param index the index
 * @param key the key
 * @param value the value
 */
public void insertLeaf(int index, Object key, Object value) {
  int len = keys.length + 1;
  Object[] newKeys = new Object[len];
  DataUtils.copyWithGap(keys, newKeys, len - 1, index);
  keys = newKeys;
  Object[] newValues = new Object[len];
  DataUtils.copyWithGap(values, newValues, len - 1, index);
  values = newValues;
  keys[index] = key;
  values[index] = value;
  totalCount++;
  addMemory(map.getKeyType().getMemory(key) +
      map.getValueType().getMemory(value));
}
origin: org.wowtools/h2

/**
 * Insert a key-value pair into this leaf.
 *
 * @param index the index
 * @param key the key
 * @param value the value
 */
public void insertLeaf(int index, Object key, Object value) {
  int len = keys.length + 1;
  Object[] newKeys = new Object[len];
  DataUtils.copyWithGap(keys, newKeys, len - 1, index);
  keys = newKeys;
  Object[] newValues = new Object[len];
  DataUtils.copyWithGap(values, newValues, len - 1, index);
  values = newValues;
  keys[index] = key;
  values[index] = value;
  totalCount++;
  addMemory(map.getKeyType().getMemory(key) +
      map.getValueType().getMemory(value));
}
origin: org.wowtools/h2

/**
 * Insert a child page into this node.
 *
 * @param index the index
 * @param key the key
 * @param childPage the child page
 */
public void insertNode(int index, Object key, Page childPage) {
  Object[] newKeys = new Object[keys.length + 1];
  DataUtils.copyWithGap(keys, newKeys, keys.length, index);
  newKeys[index] = key;
  keys = newKeys;
  int childCount = children.length;
  PageReference[] newChildren = new PageReference[childCount + 1];
  DataUtils.copyWithGap(children, newChildren, childCount, index);
  newChildren[index] = new PageReference(
      childPage, childPage.getPos(), childPage.totalCount);
  children = newChildren;
  totalCount += childPage.totalCount;
  addMemory(map.getKeyType().getMemory(key) +
      DataUtils.PAGE_MEMORY_CHILD);
}
origin: com.eventsourcing/h2

/**
 * Insert a child page into this node.
 *
 * @param index the index
 * @param key the key
 * @param childPage the child page
 */
public void insertNode(int index, Object key, Page childPage) {
  Object[] newKeys = new Object[keys.length + 1];
  DataUtils.copyWithGap(keys, newKeys, keys.length, index);
  newKeys[index] = key;
  keys = newKeys;
  int childCount = children.length;
  PageReference[] newChildren = new PageReference[childCount + 1];
  DataUtils.copyWithGap(children, newChildren, childCount, index);
  newChildren[index] = new PageReference(
      childPage, childPage.getPos(), childPage.totalCount);
  children = newChildren;
  totalCount += childPage.totalCount;
  addMemory(map.getKeyType().getMemory(key) +
      DataUtils.PAGE_MEMORY_CHILD);
}
origin: com.h2database/h2-mvstore

/**
 * Insert a key-value pair into this leaf.
 *
 * @param index the index
 * @param key the key
 * @param value the value
 */
public void insertLeaf(int index, Object key, Object value) {
  int len = keys.length + 1;
  Object[] newKeys = new Object[len];
  DataUtils.copyWithGap(keys, newKeys, len - 1, index);
  keys = newKeys;
  Object[] newValues = new Object[len];
  DataUtils.copyWithGap(values, newValues, len - 1, index);
  values = newValues;
  keys[index] = key;
  values[index] = value;
  totalCount++;
  if(isPersistent()) {
    addMemory(map.getKeyType().getMemory(key) +
        map.getValueType().getMemory(value));
  }
}
origin: com.h2database/h2-mvstore

/**
 * Insert a child page into this node.
 *
 * @param index the index
 * @param key the key
 * @param childPage the child page
 */
public void insertNode(int index, Object key, Page childPage) {
  Object[] newKeys = new Object[keys.length + 1];
  DataUtils.copyWithGap(keys, newKeys, keys.length, index);
  newKeys[index] = key;
  keys = newKeys;
  int childCount = children.length;
  PageReference[] newChildren = new PageReference[childCount + 1];
  DataUtils.copyWithGap(children, newChildren, childCount, index);
  newChildren[index] = new PageReference(
      childPage, childPage.getPos(), childPage.totalCount);
  children = newChildren;
  totalCount += childPage.totalCount;
  if(isPersistent()) {
    addMemory(map.getKeyType().getMemory(key) +
        DataUtils.PAGE_MEMORY_CHILD);
  }
}
org.h2.mvstoreDataUtilscopyWithGap

Javadoc

Copy the elements of an array, with a gap.

Popular methods of DataUtils

  • readVarInt
    Read a variable size int.
  • appendMap
    Append a map to the string builder, sorted by key.
  • checkArgument
    Throw an IllegalArgumentException if the argument is invalid.
  • copyExcept
    Copy the elements of an array, and remove one element.
  • encodeLength
    Convert the length to a length code 0..31. 31 means more than 1 MB.
  • formatMessage
    Format an error message.
  • getCheckValue
    Calculate a check value for the given integer. A check value is mean to verify the data is consisten
  • getErrorCode
    Get the error code from an exception message.
  • getFletcher32
    Calculate the Fletcher32 checksum.
  • getPageChunkId
    Get the chunk id from the position.
  • getPageMaxLength
    Get the maximum length for the given code. For the code 31, PAGE_LARGE is returned.
  • getPageOffset
    Get the offset from the position.
  • getPageMaxLength,
  • getPageOffset,
  • getPagePos,
  • getPageType,
  • getVarIntLen,
  • initCause,
  • newIllegalArgumentException,
  • newIllegalStateException,
  • newUnsupportedOperationException

Popular in Java

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (ScheduledExecutorService)
  • putExtra (Intent)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • String (java.lang)
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Vector (java.util)
    The Vector class implements a growable array of objects. Like an array, it contains components that
  • Collectors (java.util.stream)
  • Reference (javax.naming)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now