FingerListΒΆ

FingerList Class Reference

The FingerList class represents a list of Finger objects. More...

Inherits Interface, and Iterable< Finger >.

Public Member Functions

FingerList append (FingerList other)
 Appends the members of the specified FingerList to this FingerList. More...
 
int count ()
 Returns the number of fingers in this list. More...
 
FingerList extended ()
 Returns a new list containing those fingers in the current list that are extended. More...
 
 FingerList ()
 Constructs an empty list of fingers. More...
 
FingerList fingerType (Finger.Type type)
 Returns a list containing fingers from the current list of a given finger type by modifying the existing list. More...
 
Finger 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...
 
Finger get (int index)
 Access a list member by its position in the list. More...
 
boolean isEmpty ()
 Reports whether the list is empty. More...
 
Finger 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...
 
Finger 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 FingerList class represents a list of Finger objects.

Get a FingerList object by calling Frame::fingers().

FingerList allFingers = frame.fingers();
Since
1.0

Constructor & Destructor Documentation

Constructs an empty list of fingers.

Since
1.0

Member Function Documentation

FingerList append ( FingerList  other)

Appends the members of the specified FingerList to this FingerList.

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

Returns the number of fingers in this list.

for (Finger finger : frame.fingers()) {
System.out.println(finger);
}
Returns
The number of fingers in this list.
Since
1.0
FingerList extended ( )

Returns a new list containing those fingers in the current list that are extended.

FingerList extendedFingerList = hand.fingers().extended();
Returns
The list of extended fingers from the current list.
Since
2.0
FingerList fingerType ( Finger.Type  type)

Returns a list containing fingers from the current list of a given finger type by modifying the existing list.

FingerList indexFingerList = hand.fingers().fingerType(Finger.Type.TYPE_INDEX);
Finger indexFinger = indexFingerList.get(0); //since there is only one per hand
Returns
The list of matching fingers from the current list.
Since
2.0
Finger 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).

Finger mostForwardFinger = frame.fingers().frontmost();
Returns
The frontmost finger, or invalid if list is empty.
Since
1.0
Finger get ( int  index)

Access a list member by its position in the list.

Finger firstFingerInList = frame.fingers().get(0);
Parameters
indexThe zero-based list position index.
Returns
The Finger object at the specified index.
Since
1.0
boolean isEmpty ( )

Reports whether the list is empty.

if (!frame.fingers().isEmpty()) {
//Use the fingers
}
Returns
True, if the list has no members.
Since
1.0
Finger 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).

Finger fingerWithSmallestX = frame.fingers().leftmost();
Returns
The leftmost finger, or invalid if list is empty.
Since
1.0
Finger 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).

Finger fingerWithLargestX = frame.fingers().rightmost();
Returns
The rightmost finger, or invalid if list is empty.
Since
1.0