org.coode.oppl.utils.OWLObjectFinder Maven / Gradle / Ivy
package org.coode.oppl.utils;
import static org.coode.oppl.utils.ArgCheck.checkNotNull;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import org.semanticweb.owlapi.model.OWLObject;
/** @author Luigi Iannone */
public class OWLObjectFinder {
/** @param key
* key
* @param container
* container
* @return list of lists of positions */
public static List> findAll(OWLObject key, OWLObject container) {
checkNotNull(key, "key");
checkNotNull(container, "container");
List> toReturn = key.equals(container) ? Collections
.singletonList(Collections.singletonList(0)) : findAll(key, container,
Collections. emptyList());
return toReturn;
}
private static List> findAll(OWLObject key, OWLObject container,
List position) {
List> toReturn = new ArrayList>();
OWLObjectDecomposer decomposer = new OWLObjectDecomposer();
List