Tabnine Logo
PriorityBuffer.get
Code IndexAdd Tabnine to your IDE (free)

How to use
get
method
in
org.apache.commons.collections.buffer.PriorityBuffer

Best Java code snippets using org.apache.commons.collections.buffer.PriorityBuffer.get (Showing top 9 results out of 315)

origin: commons-collections/commons-collections

/**
 * Gets and removes the next element (pop).
 *
 * @return the next element
 * @throws BufferUnderflowException if the buffer is empty
 */
public Object remove() {
  final Object result = get();
  elements[1] = elements[size--];
  // set the unused element to 'null' so that the garbage collector
  // can free the object if not used anywhere else.(remove reference)
  elements[size + 1] = null;
  if (size != 0) {
    // percolate top element to it's place in tree
    if (ascendingOrder) {
      percolateDownMinHeap(1);
    } else {
      percolateDownMaxHeap(1);
    }
  }
  return result;
}
origin: wildfly/wildfly

/**
 * Gets and removes the next element (pop).
 *
 * @return the next element
 * @throws BufferUnderflowException if the buffer is empty
 */
public Object remove() {
  final Object result = get();
  elements[1] = elements[size--];
  // set the unused element to 'null' so that the garbage collector
  // can free the object if not used anywhere else.(remove reference)
  elements[size + 1] = null;
  if (size != 0) {
    // percolate top element to it's place in tree
    if (ascendingOrder) {
      percolateDownMinHeap(1);
    } else {
      percolateDownMaxHeap(1);
    }
  }
  return result;
}
origin: commons-collections/commons-collections

    "get using default constructor should return minimum value in the binary heap",
    String.valueOf((char) ('a' + i)),
    heap.get());
  heap.get();
  fail("NoSuchElementException should be thrown if get is called after all elements are removed");
} catch (BufferUnderflowException ex) {}
origin: commons-collections/commons-collections

  heap.get();
  fail("NoSuchElementException should be thrown if get is called before any elements are added");
} catch (BufferUnderflowException ex) {}
    "get using default constructor should return minimum value in the binary heap",
    String.valueOf((char) ('n' - i)),
    heap.get());
  heap.get();
  fail("NoSuchElementException should be thrown if get is called after all elements are removed");
} catch (BufferUnderflowException ex) {}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-collections

/**
 * Gets and removes the next element (pop).
 *
 * @return the next element
 * @throws BufferUnderflowException if the buffer is empty
 */
public Object remove() {
  final Object result = get();
  elements[1] = elements[size--];
  // set the unused element to 'null' so that the garbage collector
  // can free the object if not used anywhere else.(remove reference)
  elements[size + 1] = null;
  if (size != 0) {
    // percolate top element to it's place in tree
    if (ascendingOrder) {
      percolateDownMinHeap(1);
    } else {
      percolateDownMaxHeap(1);
    }
  }
  return result;
}
origin: org.apache.openjpa/openjpa-all

/**
 * Gets and removes the next element (pop).
 *
 * @return the next element
 * @throws BufferUnderflowException if the buffer is empty
 */
public Object remove() {
  final Object result = get();
  elements[1] = elements[size--];
  // set the unused element to 'null' so that the garbage collector
  // can free the object if not used anywhere else.(remove reference)
  elements[size + 1] = null;
  if (size != 0) {
    // percolate top element to it's place in tree
    if (ascendingOrder) {
      percolateDownMinHeap(1);
    } else {
      percolateDownMaxHeap(1);
    }
  }
  return result;
}
origin: org.apache.directory.api/api-ldap-client-all

/**
 * Gets and removes the next element (pop).
 *
 * @return the next element
 * @throws BufferUnderflowException if the buffer is empty
 */
public Object remove() {
  final Object result = get();
  elements[1] = elements[size--];
  // set the unused element to 'null' so that the garbage collector
  // can free the object if not used anywhere else.(remove reference)
  elements[size + 1] = null;
  if (size != 0) {
    // percolate top element to it's place in tree
    if (ascendingOrder) {
      percolateDownMinHeap(1);
    } else {
      percolateDownMaxHeap(1);
    }
  }
  return result;
}
origin: com.alibaba.citrus.tool/antx-autoexpand

/**
 * Gets and removes the next element (pop).
 *
 * @return the next element
 * @throws BufferUnderflowException if the buffer is empty
 */
public Object remove() {
  final Object result = get();
  elements[1] = elements[size--];
  // set the unused element to 'null' so that the garbage collector
  // can free the object if not used anywhere else.(remove reference)
  elements[size + 1] = null;
  if (size != 0) {
    // percolate top element to it's place in tree
    if (ascendingOrder) {
      percolateDownMinHeap(1);
    } else {
      percolateDownMaxHeap(1);
    }
  }
  return result;
}
origin: org.jboss.eap/wildfly-client-all

/**
 * Gets and removes the next element (pop).
 *
 * @return the next element
 * @throws BufferUnderflowException if the buffer is empty
 */
public Object remove() {
  final Object result = get();
  elements[1] = elements[size--];
  // set the unused element to 'null' so that the garbage collector
  // can free the object if not used anywhere else.(remove reference)
  elements[size + 1] = null;
  if (size != 0) {
    // percolate top element to it's place in tree
    if (ascendingOrder) {
      percolateDownMinHeap(1);
    } else {
      percolateDownMaxHeap(1);
    }
  }
  return result;
}
org.apache.commons.collections.bufferPriorityBufferget

Javadoc

Gets the next element to be removed without actually removing it (peek).

Popular methods of PriorityBuffer

  • isEmpty
  • compare
    Compares two objects using the comparator if specified, or the natural order otherwise.
  • grow
    Increases the size of the heap to support additional elements
  • isAtCapacity
    Tests if the buffer is at capacity.
  • percolateDownMaxHeap
    Percolates element down heap from the position given by the index. Assumes it is a maximum heap.
  • percolateDownMinHeap
    Percolates element down heap from the position given by the index. Assumes it is a minimum heap.
  • percolateUpMaxHeap
    Percolates a new element up heap from the bottom. Assume it is a maximum heap.
  • percolateUpMinHeap
    Percolates a new element up heap from the bottom. Assumes it is a minimum heap.
  • <init>
    Constructs a new empty buffer specifying the sort order and comparator.
  • add
    Adds an element to the buffer. The element added will be sorted according to the comparator in use.
  • remove
  • size
    Returns the number of elements in this buffer.
  • remove,
  • size,
  • contains,
  • iterator

Popular in Java

  • Start an intent from android
  • getResourceAsStream (ClassLoader)
  • setRequestProperty (URLConnection)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now