Intel

Developer Zone

List


com.intel.langutil
Class List

java.lang.Object
  extended by com.intel.langutil.List

public abstract class List
extends java.lang.Object

This class provides basic interface for an implementation of a list of objects.


Method Summary
abstract void add(java.lang.Object o)
Adds an object to the list
abstract void add(java.lang.Object[] arr)
Adds an array of objects to the list
abstract void clear()
Removes all objects from the list
static List create(boolean checkForNull)
Factory method for creating concrete lists
abstract Enumerator getEnumerator()
Returns an enumerator for this List.
abstract int length()
Returns the number of elements in the list
Methods inherited from class java.lang.Object
equals, hashCode, toString

Method Detail

create

public static final List create(boolean checkForNull)
Factory method for creating concrete lists

Parameters:
checkForNull - check that elements added are not null
Returns:
List instance

add

public abstract void add(java.lang.Object o)
Adds an object to the list

Parameters:
o - The object to add to the list
Throws:
java.lang.NullPointerException - if checkForNull is true and the object added is null

add

public abstract void add(java.lang.Object[] arr)
Adds an array of objects to the list

Parameters:
arr - An array of objects to add to the list
Throws:
java.lang.NullPointerException - the object array is null or if checkForNull is true and one of the objects added is null

clear

public abstract void clear()
Removes all objects from the list


length

public abstract int length()
Returns the number of elements in the list

Returns:
Returns the number of elements in the list

getEnumerator

public abstract Enumerator getEnumerator()
Returns an enumerator for this List. If the List object is modified during enumeration, the Enumerator behavior might be unexpected.

Returns:
the enumerator for this List object.