Example usage for android.view.accessibility AccessibilityNodeInfo hashCode

List of usage examples for android.view.accessibility AccessibilityNodeInfo hashCode

Introduction

In this page you can find the example usage for android.view.accessibility AccessibilityNodeInfo hashCode.

Prototype

@Override
    public int hashCode() 

Source Link

Usage

From source file:com.googlecode.eyesfree.brailleback.TreeDebugNavigationMode.java

private void printNodeTree(AccessibilityNodeInfo node, String indent, HashSet<AccessibilityNodeInfo> seen) {
    if (node == null) {
        return;//from  w w w. j  a v a 2  s .  c  o m
    }
    if (!seen.add(node)) {
        LogUtils.log(this, Log.VERBOSE, "Cycle: %d", node.hashCode());
        return;
    }
    // Include the hash code as a "poor man's" id, knowing that it
    // might not always be unique.
    LogUtils.log(this, Log.VERBOSE, "%s(%d)%s", indent, node.hashCode(), formatNode(node));
    int childCount = node.getChildCount();
    String childIndent = indent + "  ";
    for (int i = 0; i < childCount; ++i) {
        AccessibilityNodeInfo child = node.getChild(i);
        if (child == null) {
            LogUtils.log(this, Log.VERBOSE, "%sCouldn't get child %d", indent, i);
            continue;
        }
        printNodeTree(child, childIndent, seen);
    }
}