com.intel.langutil
Class List
- java.lang.Object
-
- 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
Methods Modifier and Type Method and Description abstract void
add(java.lang.Object o)
Adds an object to the listabstract void
add(java.lang.Object[] arr)
Adds an array of objects to the listabstract void
clear()
Removes all objects from the liststatic List
create(boolean checkForNull)
Factory method for creating concrete listsabstract Enumerator
getEnumerator()
Returns an enumerator for thisList
.abstract int
length()
Returns the number of elements in the list
-
-
-
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 thisList
. If theList
object is modified during enumeration, theEnumerator
behavior might be unexpected.- Returns:
- the enumerator for this
List
object.
-
-