public String[] getAllGestureIDs() { Set<String> keys = this.myGestureMap.keySet(); String[] keyStrings = keys.toArray(new String[keys.size()]); Arrays.sort(keyStrings); if (DEBUG) Log.d("getAllGestureIDs", keyStrings.toString()); if (keyStrings.length > 0) { for (int i = 0; i < keyStrings.length; i++) { int entry_count = myGestureMap.get(keyStrings[i]).size(); keyStrings[i] += " : " + entry_count; } return keyStrings; } else { return new String[] {"No Gestures in Library"}; } }
public void printInfo(String originatingMethod) { /* * Prints Debug info * */ if (myGestureMap != null) { Set<String> gestureIDs = myGestureMap.keySet(); Iterator<String> ids = gestureIDs.iterator(); int ctr = 0; while (ids.hasNext()) { ctr++; String current_gid = ids.next(); int gestureCount = myGestureMap.get(current_gid).size(); if (originatingMethod != null) { Log.d( "printInfo", "[-->" + originatingMethod + "]" + "Gesture ID " + current_gid + " has " + gestureCount + " gestures in Lib"); } else { Log.d( "printInfo", "Gesture ID " + current_gid + " has " + gestureCount + " gestures in Lib"); } } if (ctr < 1) { Log.i("printInfo", "no gestures in Library!"); } } else { Log.i("printInfo", "gesture Library isn't initialized"); } }
private boolean areTheSameLocations(List<Location> locations, Location[] otherLocations) { Set<Location> setOne = new HashSet<>(locations); Set<Location> setTwo = stream(otherLocations).collect(toSet()); return setOne.equals(setTwo); }