Codota Logo
RecyclingArrayList.rangeCheckForInsert
Code IndexAdd Codota to your IDE (free)

How to use
rangeCheckForInsert
method
in
us.ihmc.robotics.lists.RecyclingArrayList

Best Java code snippets using us.ihmc.robotics.lists.RecyclingArrayList.rangeCheckForInsert (Showing top 1 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Connection c =
  • Codota IconDataSource dataSource;dataSource.getConnection()
  • Codota IconString url;DriverManager.getConnection(url)
  • Codota IconIdentityDatabaseUtil.getDBConnection()
  • Smart code suggestions by Codota
}
origin: us.ihmc/IHMCRoboticsToolkit

/**
* Inserts a new element at the specified position in this
* list. Shifts the element currently at that position (if any) and
* any subsequent elements to the right (adds one to their indices).
*
* @param index index at which the new element is to be inserted
* @return the new inserted element
* @throws IndexOutOfBoundsException if the index is out of range
*         (<tt>index &lt; 0 || index &gt;= size()</tt>)
*/
public T insertAtIndex(int index)
{
 rangeCheckForInsert(index);
 // First add new element at last index
 T ret = add();
 // Then go trough the list by swapping elements two by two to reach the desired index
 for (int i = size - 1; i > index; i--)
   unsafeFastSwap(i, i - 1);
 return ret;
}
us.ihmc.robotics.listsRecyclingArrayListrangeCheckForInsert

Popular methods of RecyclingArrayList

  • get
    Returns the element at the specified position in this list.
  • add
    Unsupported operation.
  • clear
    Sets the size of the list to 0, but does not change its capacity. This method is meant to recycle a
  • size
    Returns the number of elements in this list.
  • <init>
  • isEmpty
    Returns true if this list contains no elements.
  • getAndGrowIfNeeded
    Returns the element at the specified position in this list. The list will grow if the given index is
  • getLast
    Returns the last element of this list. If the list is empty, it returns null.
  • remove
    Removes the first occurrence of the specified element from this list, if it is present. If the list
  • checkWithMaxCapacity
  • ensureCapacity
  • fillElementDataIfNeeded
  • ensureCapacity,
  • fillElementDataIfNeeded,
  • indexOf,
  • positiveIndexCheck,
  • rangeCheck,
  • toArray,
  • unsafeFastSwap,
  • unsafeGet,
  • unsafeGrowByN

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getApplicationContext (Context)
  • onCreateOptionsMenu (Activity)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • KeyStore (java.security)
    This class represents an in-memory collection of keys and certificates. It manages two types of entr
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Dictionary (java.util)
    The Dictionary class is the abstract parent of any class, such as Hashtable, which maps keys to valu
  • TreeMap (java.util)
    A Red-Black tree based NavigableMap implementation. The map is sorted according to the Comparable of
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
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