Tabnine Logo
PriorityBuffer.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.apache.commons.collections.buffer.PriorityBuffer
constructor

Best Java code snippets using org.apache.commons.collections.buffer.PriorityBuffer.<init> (Showing top 8 results out of 315)

origin: commons-collections/commons-collections

/**
 * Return a new, empty {@link Object} to used for testing.
 */
public Collection makeCollection() {
  return new PriorityBuffer();
}
origin: commons-collections/commons-collections

for(int i=0; i < iterations; i++) {
  if (i < iterations / 2) {          
    h = new PriorityBuffer(true);
  } else {
    h = new PriorityBuffer(false);
origin: commons-collections/commons-collections

for (int i = 0; i < iterations; i++) {
  if (i < iterations / 2) {
    h = new PriorityBuffer(true);
  } else {
    h = new PriorityBuffer(false);
origin: apache/accumulo

@VisibleForTesting
synchronized boolean seek(WritableComparable<?> key) throws IOException {
 PriorityBuffer reheap = new PriorityBuffer(heap.size());
 boolean result = false;
 for (Object obj : heap) {
  Index index = (Index) obj;
  try {
   WritableComparable<?> found = index.reader.getClosest(key, index.value, true);
   if (found != null && found.equals(key)) {
    result = true;
   }
  } catch (EOFException ex) {
   // thrown if key is beyond all data in the map
  }
  index.cached = false;
  reheap.add(index);
 }
 heap = reheap;
 return result;
}
origin: commons-collections/commons-collections

public void testBasicOps() {
  PriorityBuffer heap = new PriorityBuffer();
origin: commons-collections/commons-collections

public void testBasicComparatorOps() {
  PriorityBuffer heap = new PriorityBuffer(new ReverseComparator(new ComparableComparator()));
origin: org.apache.accumulo/accumulo-tserver

@VisibleForTesting
synchronized boolean seek(WritableComparable<?> key) throws IOException {
 PriorityBuffer reheap = new PriorityBuffer(heap.size());
 boolean result = false;
 for (Object obj : heap) {
  Index index = (Index) obj;
  try {
   WritableComparable<?> found = index.reader.getClosest(key, index.value, true);
   if (found != null && found.equals(key)) {
    result = true;
   }
  } catch (EOFException ex) {
   // thrown if key is beyond all data in the map
  }
  index.cached = false;
  reheap.add(index);
 }
 heap = reheap;
 return result;
}
origin: org.apache.accumulo/accumulo-server

public synchronized boolean seek(WritableComparable key) throws IOException {
 PriorityBuffer reheap = new PriorityBuffer(heap.size());
 boolean result = false;
 for (Object obj : heap) {
  Index index = (Index) obj;
  try {
   WritableComparable found = index.reader.getClosest(key, index.value, true);
   if (found != null && found.equals(key)) {
    result = true;
   }
  } catch (EOFException ex) {
   // thrown if key is beyond all data in the map
  }
  index.cached = false;
  reheap.add(index);
 }
 heap = reheap;
 return result;
}
org.apache.commons.collections.bufferPriorityBuffer<init>

Javadoc

Constructs a new empty buffer that sorts in ascending order by the natural order of the objects added.

Popular methods of PriorityBuffer

  • get
    Gets the next element to be removed without actually removing it (peek).
  • 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.
  • 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

  • Creating JSON documents from java classes using gson
  • scheduleAtFixedRate (ScheduledExecutorService)
  • onRequestPermissionsResult (Fragment)
  • requestLocationUpdates (LocationManager)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • 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