List Class

Contains any number of elements that are accessed sequentially. Lists are structures that can contain values of any X++ type. All the values in the list must be of the same type.

Syntax

class List extends Object

Run On

Called

Methods

  Method Description
Gg921795.pubmethod(en-us,AX.60).gif addEnd Adds a value to the end of the list.
Gg921795.pubmethod(en-us,AX.60).gif addStart Adds a value to the start of the list.
Gg921795.pubmethod(en-us,AX.60).gif appendList
Gg921795.pubmethod(en-us,AX.60).gif cancelTimeOut Cancels a previous method call to the setTimeOut method. (Inherited from Object.)
Gg921795.pubmethod(en-us,AX.60).gif definitionString Returns a description of the type of the elements in the list.
Gg921795.pubmethod(en-us,AX.60).gif elements Specifies the number of elements in a list.
Gg921795.pubmethod(en-us,AX.60).gif empty Determines whether a list is empty.
Gg921795.pubmethod(en-us,AX.60).gif equal Determines whether the specified object is equal to the current one. (Inherited from Object.)
Gg921795.pubmethod(en-us,AX.60).gif equalTo Determines whether a list is the same as the current list.
Gg921795.pubmethod(en-us,AX.60).gif getEnumerator Creates an enumerator for a list which allows you to traverse the list.
Gg921795.pubmethod(en-us,AX.60).gif getTimeOutTimerHandle Returns the timer handle for the object. (Inherited from Object.)
Gg921795.pubmethod(en-us,AX.60).gif handle Retrieves the handle of the class of the object. (Inherited from Object.)
Gg921795.pubmethod(en-us,AX.60).gif new Creates a list. (Overrides the new Method.)
Gg921795.pubmethod(en-us,AX.60).gif notify Releases the hold on an object that has called the wait method on this object. (Inherited from Object.)
Gg921795.pubmethod(en-us,AX.60).gif notifyAll Releases a lock on the object that was issued by the wait method on this object. (Inherited from Object.)
Gg921795.pubmethod(en-us,AX.60).gif objectOnServer Determines whether the object is on a server. (Inherited from Object.)
Gg921795.pubmethod(en-us,AX.60).gif owner Returns the instance that owns the object. (Inherited from Object.)
Gg921795.pubmethod(en-us,AX.60).gif pack Serializes the current instance of the List class.
Gg921795.pubmethod(en-us,AX.60).gif setTimeOut Sets up the scheduled execution of a specified method. (Inherited from Object.)
Gg921795.pubmethod(en-us,AX.60).gif toString Returns a description of the values in the list. (Overrides the toString Method.)
Gg921795.pubmethod(en-us,AX.60).gif typeId Returns the type of the values in a list.
Gg921795.pubmethod(en-us,AX.60).gif usageCount Returns the current number of references, that is, the value of the reference counter, that the object has. (Inherited from Object.)
Gg921795.pubmethod(en-us,AX.60).gif wait Pauses a process. (Inherited from Object.)
Gg921795.pubmethod(en-us,AX.60).gif xml Returns an XML string that represents the current object. (Overrides the xml Method.)
Gg921795.pubmethod(en-us,AX.60).gif Gg921795.static(en-us,AX.60).gif ::create Creates a list from the container obtained from a prior call to the List.pack method.
Gg921795.pubmethod(en-us,AX.60).gif Gg921795.static(en-us,AX.60).gif ::createFromXML
Gg921795.pubmethod(en-us,AX.60).gif Gg921795.static(en-us,AX.60).gif ::equal Determines whether two lists are identical.
Gg921795.pubmethod(en-us,AX.60).gif Gg921795.static(en-us,AX.60).gif ::merge Combines two lists to create a new list.

Top

Remarks

The type of the values in the list is specified when the list is created and cannot be changed afterwards.

The implementation of lists makes traversal of the list elements very fast. Lists can be traversed by using the ListEnumerator class. To create a ListEnumerator object, use List.getEnumerator.

Examples

The following example creates a list of integers and prints out a description of the list and the values that it contains.

{ 
    // Create a list of integers 
    List il = new List(Types::Integer); 
  
    // Add some elements to the list 
    il.addEnd(1); 
    il.addEnd(2); 
    il.addStart(3); 
  
    // Print a description of the list 
    print il.definitionString(); 
    print il.toString(); 
    pause; 
}

Inheritance Hierarchy

Object Class
  List Class

See Also

Array Class

Set Class

Map Class

ListEnumerator Class