ToolListΒΆ

Methods:

class com::leapmotion::leap::ToolList

The ToolList class represents a list of Tool objects.

ToolList allToolsInFrame = frame.tools();

Public Functions

ToolList append(ToolList other)

Appends the members of the specified ToolList to this ToolList.

Parameters

int count()

Returns the number of tools in this list.

if (frame.tools().count() > 0) {
    //Process tools
}

Return
The number of tools in this list.

Tool 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).

Tool frontmostTool = frame.tools().frontmost();

Return
The frontmost tool, or invalid if list is empty.

Tool get(int index)

Access a list member by its position in the list.

ToolList allToolsinFrame = frame.tools();
for (int index = 0; index < allToolsinFrame.count(); index++) {
    System.out.println(allToolsinFrame.get(index));
}

Return
The Tool object at the specified index.
Parameters
  • index -

    The zero-based list position index.

boolean isEmpty()

Reports whether the list is empty.

if(!frame.tools().isEmpty()){
    //Process this frame's tools
}

Return
True, if the list has no members.

Tool 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).

Tool leftmostTool = frame.tools().leftmost();

Return
The leftmost tool, or invalid if list is empty.

Tool 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).

Tool rightmostTool = frame.tools().rightmost();

Return
The rightmost tool, or invalid if list is empty.

ToolList()

Constructs an empty list of tools.

class ToolListIterator