Tabnine Logo
AVLTree$Node
Code IndexAdd Tabnine to your IDE (free)

How to use
AVLTree$Node
in
org.apache.commons.math3.geometry.partitioning.utilities

Best Java code snippets using org.apache.commons.math3.geometry.partitioning.utilities.AVLTree$Node (Showing top 10 results out of 315)

origin: org.apache.commons/commons-math3

/** Delete an element from the tree.
 * <p>The element is deleted only if there is a node {@code n}
 * containing exactly the element instance specified, i.e. for which
 * {@code n.getElement() == element}. This is purposely
 * <em>different</em> from the specification of the
 * {@code java.util.Set} {@code remove} method (in fact,
 * this is the reason why a specific class has been developed).</p>
 * @param element element to delete (silently ignored if null)
 * @return true if the element was deleted from the tree
 */
public boolean delete(final T element) {
  if (element != null) {
    for (Node node = getNotSmaller(element); node != null; node = node.getNext()) {
      // loop over all elements neither smaller nor larger
      // than the specified one
      if (node.element == element) {
        node.delete();
        return true;
      } else if (node.element.compareTo(element) > 0) {
        // all the remaining elements are known to be larger,
        // the element is not in the tree
        return false;
      }
    }
  }
  return false;
}
origin: io.virtdata/virtdata-lib-realer

/** Delete an element from the tree.
 * <p>The element is deleted only if there is a node {@code n}
 * containing exactly the element instance specified, i.e. for which
 * {@code n.getElement() == element}. This is purposely
 * <em>different</em> from the specification of the
 * {@code java.util.Set} {@code remove} method (in fact,
 * this is the reason why a specific class has been developed).</p>
 * @param element element to delete (silently ignored if null)
 * @return true if the element was deleted from the tree
 */
public boolean delete(final T element) {
  if (element != null) {
    for (Node node = getNotSmaller(element); node != null; node = node.getNext()) {
      // loop over all elements neither smaller nor larger
      // than the specified one
      if (node.element == element) {
        node.delete();
        return true;
      } else if (node.element.compareTo(element) > 0) {
        // all the remaining elements are known to be larger,
        // the element is not in the tree
        return false;
      }
    }
  }
  return false;
}
origin: io.virtdata/virtdata-lib-realer

/** Get the node whose element is the smallest one in the tree.
 * @return the tree node containing the smallest element in the tree
 * or null if the tree is empty
 * @see #getLargest
 * @see #getNotSmaller
 * @see #getNotLarger
 * @see Node#getPrevious
 * @see Node#getNext
 */
public Node getSmallest() {
  return (top == null) ? null : top.getSmallest();
}
origin: io.virtdata/virtdata-lib-realer

/** Get the number of elements of the tree.
 * @return number of elements contained in the tree
 */
public int size() {
  return (top == null) ? 0 : top.size();
}
origin: io.virtdata/virtdata-lib-realer

/** Insert an element in the tree.
 * @param element element to insert (silently ignored if null)
 */
public void insert(final T element) {
  if (element != null) {
    if (top == null) {
      top = new Node(element, null);
    } else {
      top.insert(element);
    }
  }
}
origin: io.virtdata/virtdata-lib-realer

/** Get the node whose element is the largest one in the tree.
 * @return the tree node containing the largest element in the tree
 * or null if the tree is empty
 * @see #getSmallest
 * @see #getNotSmaller
 * @see #getNotLarger
 * @see Node#getPrevious
 * @see Node#getNext
 */
public Node getLargest() {
  return (top == null) ? null : top.getLargest();
}
origin: org.apache.commons/commons-math3

/** Insert an element in the tree.
 * @param element element to insert (silently ignored if null)
 */
public void insert(final T element) {
  if (element != null) {
    if (top == null) {
      top = new Node(element, null);
    } else {
      top.insert(element);
    }
  }
}
origin: org.apache.commons/commons-math3

/** Get the node whose element is the largest one in the tree.
 * @return the tree node containing the largest element in the tree
 * or null if the tree is empty
 * @see #getSmallest
 * @see #getNotSmaller
 * @see #getNotLarger
 * @see Node#getPrevious
 * @see Node#getNext
 */
public Node getLargest() {
  return (top == null) ? null : top.getLargest();
}
origin: org.apache.commons/commons-math3

/** Get the node whose element is the smallest one in the tree.
 * @return the tree node containing the smallest element in the tree
 * or null if the tree is empty
 * @see #getLargest
 * @see #getNotSmaller
 * @see #getNotLarger
 * @see Node#getPrevious
 * @see Node#getNext
 */
public Node getSmallest() {
  return (top == null) ? null : top.getSmallest();
}
origin: org.apache.commons/commons-math3

/** Get the number of elements of the tree.
 * @return number of elements contained in the tree
 */
public int size() {
  return (top == null) ? 0 : top.size();
}
org.apache.commons.math3.geometry.partitioning.utilitiesAVLTree$Node

Most used methods

  • <init>
  • delete
  • getLargest
  • getNext
  • getSmallest
  • insert
  • size

Popular in Java

  • Parsing JSON documents to java classes using gson
  • setContentView (Activity)
  • startActivity (Activity)
  • getSharedPreferences (Context)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top 12 Jupyter Notebook extensions
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