/** * Iterates on all factories and append all index engines. * * @return Set of all index engines. */ public static Set<String> getIndexEngines() { final Set<String> engines = new HashSet<>(); final Iterator<OIndexFactory> ite = getAllFactories(); while (ite.hasNext()) { engines.addAll(ite.next().getAlgorithms()); } return engines; }
/** * Iterates on all factories and append all index types. * * @return Set of all index types. */ private static Set<String> getIndexTypes() { final Set<String> types = new HashSet<>(); final Iterator<OIndexFactory> ite = getAllFactories(); while (ite.hasNext()) { types.addAll(ite.next().getTypes()); } return types; }
public static OIndexFactory getFactory(String indexType, String algorithm) { if (algorithm == null) { algorithm = chooseDefaultIndexAlgorithm(indexType); } algorithm = algorithm.toUpperCase(Locale.ENGLISH); final Iterator<OIndexFactory> ite = getAllFactories(); while (ite.hasNext()) { final OIndexFactory factory = ite.next(); if (factory.getTypes().contains(indexType) && factory.getAlgorithms().contains(algorithm)) { return factory; } } throw new OIndexException("Index with type " + indexType + " and algorithm " + algorithm + " does not exist."); }
HighLanderIndexFactory f = new HighLanderIndexFactory(); Set<OIndexFactory> set = new HashSet<OIndexFactory>(); Iterator<OIndexFactory> ite = OIndexes.getAllFactories(); while (ite.hasNext()) { set.add(ite.next());
for (Iterator<OIndexFactory> it = OIndexes.getAllFactories(); it.hasNext(); ) { try { final OIndexFactory indexFactory = it.next();