DeviceListΒΆ

DeviceList Class Reference

The DeviceList class represents a list of Device objects. More...

Inherits Interface, and Iterable< Device >.

Public Member Functions

DeviceList append (DeviceList other)
 Appends the members of the specified DeviceList to this DeviceList. More...
 
int count ()
 Returns the number of devices in this list. More...
 
 DeviceList ()
 Constructs an empty list of devices. More...
 
Device get (int index)
 Access a list member by its position in the list. More...
 
boolean isEmpty ()
 Reports whether the list is empty. More...
 

Detailed Description

The DeviceList class represents a list of Device objects.

Get a DeviceList object by calling Controller::devices().

Since
1.0

Constructor & Destructor Documentation

Constructs an empty list of devices.

Since
1.0

Member Function Documentation

DeviceList append ( DeviceList  other)

Appends the members of the specified DeviceList to this DeviceList.

Parameters
otherA DeviceList object containing Device objects to append to the end of this DeviceList.
Since
1.0
int count ( )

Returns the number of devices in this list.

Returns
The number of devices in this list.
Since
1.0
Device get ( int  index)

Access a list member by its position in the list.

Parameters
indexThe zero-based list position index.
Returns
The Device object at the specified index.
Since
1.0
boolean isEmpty ( )

Reports whether the list is empty.

if (!controller.devices().isEmpty()) {
Device leapDevice = controller.devices().get(0);
}
Returns
True, if the list has no members.
Since
1.0