All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.liblouis.TableInfo Maven / Gradle / Ivy

Go to download

JNA based Java bindings to liblouis, an open-source braille translator and back-translator.

There is a newer version: 5.1.0
Show 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;
	
	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;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy