HandListΒΆ

HandList Class Reference

The HandList class represents a list of Hand objects. More...

Inherits Interface, and Iterable< Hand >.

Public Member Functions

HandList append (HandList other)
 Appends the members of the specified HandList to this HandList. More...
 
int count ()
 Returns the number of hands in this list. More...
 
Hand frontmost ()
 The member of the list that is farthest to the front within the standard Leap Motion frame of reference (i.e has the smallest Z coordinate). More...
 
Hand get (int index)
 Access a list member by its position in the list. More...
 
 HandList ()
 Constructs an empty list of hands. More...
 
boolean isEmpty ()
 Reports whether the list is empty. More...
 
Hand leftmost ()
 The member of the list that is farthest to the left within the standard Leap Motion frame of reference (i.e has the smallest X coordinate). More...
 
Hand rightmost ()
 The member of the list that is farthest to the right within the standard Leap Motion frame of reference (i.e has the largest X coordinate). More...
 

Detailed Description

The HandList class represents a list of Hand objects.

Get a HandList object by calling Frame::hands().

HandList allHands = frame.hands();
Since
1.0

Constructor & Destructor Documentation

HandList ( )

Constructs an empty list of hands.

Since
1.0

Member Function Documentation

HandList append ( HandList  other)

Appends the members of the specified HandList to this HandList.

Parameters
otherA HandList object containing Hand objects to append to the end of this HandList.
int count ( )

Returns the number of hands in this list.

if (frame.hands().count() > 0) {
//Process hand data...
}
Returns
The number of hands in this list.
Since
1.0
Hand frontmost ( )

The member of the list that is farthest to the front within the standard Leap Motion frame of reference (i.e has the smallest Z coordinate).

Hand frontHand = frame.hands().frontmost();
Returns
The frontmost hand, or invalid if list is empty.
Since
1.0
Hand get ( int  index)

Access a list member by its position in the list.

HandList allHandsinFrame = frame.hands();
for (int index = 0; index < allHandsinFrame.count(); index++) {
System.out.println(allHandsinFrame.get(index));
}
Parameters
indexThe zero-based list position index.
Returns
The Hand object at the specified index.
Since
1.0
boolean isEmpty ( )

Reports whether the list is empty.

if (!frame.hands().isEmpty()) {
//Process hands...
}
Returns
True, if the list has no members.
Since
1.0
Hand leftmost ( )

The member of the list that is farthest to the left within the standard Leap Motion frame of reference (i.e has the smallest X coordinate).

Note: to determine whether a hand is the left hand, use the Hand::isLeft() function.

Hand furthestLeft = frame.hands().leftmost();
Returns
The leftmost hand, or invalid if list is empty.
Since
1.0
Hand rightmost ( )

The member of the list that is farthest to the right within the standard Leap Motion frame of reference (i.e has the largest X coordinate).

Note: to determine whether a hand is the right hand, use the Hand::isRight() function.

Hand furthestRight = frame.hands().rightmost();
Returns
The rightmost hand, or invalid if list is empty.
Since
1.0