public class AdjacencyGraphUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static HashMap<Character,String[]> |
dvorak
Adjacency graph for the dvorak keyboard
|
static HashMap<Character,String[]> |
macKeypad
Adjacency graph for the macKeypad
|
static HashMap<Character,String[]> |
qwerty
Adjacency graph for the qwerty keyboard
|
static HashMap<Character,String[]> |
standardKeypad
Adjacency graph for the keypad
|
| Constructor and Description |
|---|
AdjacencyGraphUtil() |
| Modifier and Type | Method and Description |
|---|---|
static double |
calcAverageDegree(HashMap<Character,String[]> keys)
Calculates the average "degree" of a keyboard or keypad.
|
static Set<Character> |
getNeighbors(AdjacencyGraph adjacencyGraph,
Character key)
Returns a set of neighbors for a specific character.
|
static int |
getShifts(AdjacencyGraph adjacencyGraph,
String part)
Returns the number of shifts in case in the part passed in.
|
static int |
getTurns(AdjacencyGraph adjacencyGraph,
String part)
Returns the number of turns in the part passed in based on the adjacency graph.
|
static int |
neighborsNumber(String[] neighbors)
Count how many neighbors a key has
|
public static final HashMap<Character,String[]> qwerty
public static final HashMap<Character,String[]> dvorak
public static final HashMap<Character,String[]> standardKeypad
public static double calcAverageDegree(HashMap<Character,String[]> keys)
keys - a keyboard or keypadpublic static int neighborsNumber(String[] neighbors)
neighbors - the neighborspublic static Set<Character> getNeighbors(AdjacencyGraph adjacencyGraph, Character key)
adjacencyGraph - the graph you are using to get the neighbors.key - the character you are getting neighbors for.public static int getTurns(AdjacencyGraph adjacencyGraph, String part)
adjacencyGraph - the graph you are using to get the neighbors.part - the string you are getting turns for.AdjacencyGraphpublic static int getShifts(AdjacencyGraph adjacencyGraph, String part)
adjacencyGraph - the graph you are using to get the neighborspart - the string you are getting shifts for.AdjacencyGraphCopyright © 2017. All rights reserved.