"

2013 FRC Java API

"

edu.wpi.first.wpilibj.networktables2.util
Class List

java.lang.Object
  extended by edu.wpi.first.wpilibj.networktables2.util.ResizeableArrayObject
      extended by edu.wpi.first.wpilibj.networktables2.util.List
Direct Known Subclasses:
Set, Stack

public class List
extends ResizeableArrayObject

A simple unsynchronized list implementation

Author:
mwills

Field Summary
protected  int size
           
 
Fields inherited from class edu.wpi.first.wpilibj.networktables2.util.ResizeableArrayObject
array
 
Constructor Summary
List()
          create a new list
List(int initialSize)
          Create a new list with a given initial size of the backing array
 
Method Summary
 void add(Object o)
          Add an object to the end of the list
 void clear()
          clear all elements from the list
 boolean contains(Object object)
           
 Object get(int index)
           
 boolean isEmpty()
           
 void remove(int index)
          Remove an element from the list
 boolean remove(Object object)
          remove the first element in the list where Object.equals(Object) is true
 void set(int index, Object obj)
          set the value at a given index in the list
 int size()
           
 
Methods inherited from class edu.wpi.first.wpilibj.networktables2.util.ResizeableArrayObject
arraySize, ensureSize
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

size

protected int size
Constructor Detail

List

public List()
create a new list


List

public List(int initialSize)
Create a new list with a given initial size of the backing array

Parameters:
initialSize - the initial size of the backing array
Method Detail

isEmpty

public boolean isEmpty()
Returns:
true if the list is empty

size

public int size()
Returns:
the size of the list

add

public void add(Object o)
Add an object to the end of the list

Parameters:
o - the object to be added

remove

public void remove(int index)
            throws IndexOutOfBoundsException
Remove an element from the list

Parameters:
index - the index of the element to be removed
Throws:
IndexOutOfBoundsException - if the index is not in the list

clear

public void clear()
clear all elements from the list


get

public Object get(int index)
Parameters:
index -
Returns:
a given element from the list

remove

public boolean remove(Object object)
remove the first element in the list where Object.equals(Object) is true

Parameters:
object -
Returns:
true if the element was removed

contains

public boolean contains(Object object)
Parameters:
object -
Returns:
true if the list contains the given element (where Object.equals(Object) is true)

set

public void set(int index,
                Object obj)
set the value at a given index in the list

Parameters:
index - the index where the object should be put
obj - the new value at the index

"

2013 FRC Java API

"

"
For updated information see the Java FRC site
"