org.liblouis.TableInfo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of liblouis-java Show documentation
Show all versions of liblouis-java Show documentation
JNA based Java bindings to liblouis, an open-source braille translator and back-translator.
The newest version!
package org.liblouis;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
public class TableInfo {
private final String table;
private final Map cache;
private final Set missingFields;
public TableInfo(String table) {
this.table = table;
cache = new HashMap();
missingFields = new HashSet();
}
public String get(String key) {
if (cache.containsKey(key))
return cache.get(key);
if (missingFields.contains(key))
return null;
String value = Louis.getLibrary().lou_getTableInfo(table, key);
if (value != null)
cache.put(key, value);
else
missingFields.add(key);
return value;
}
}