28 lines
618 B
Java
28 lines
618 B
Java
package org.gcube.informationsystem.types.knowledge;
|
|
|
|
import java.util.HashSet;
|
|
import java.util.Set;
|
|
|
|
import org.gcube.informationsystem.tree.NodeInformation;
|
|
import org.gcube.informationsystem.types.reference.Type;
|
|
|
|
/**
|
|
* @author Luca Frosini (ISTI - CNR)
|
|
*/
|
|
public class TypeInformation implements NodeInformation<Type> {
|
|
|
|
@Override
|
|
public String getIdentifier(Type type) {
|
|
return type.getName();
|
|
}
|
|
|
|
@Override
|
|
public Set<String> getParentIdentifiers(Type root, Type type) {
|
|
if(getIdentifier(type).compareTo(getIdentifier(root))==0) {
|
|
return new HashSet<>();
|
|
}
|
|
return type.getSuperClasses();
|
|
}
|
|
|
|
}
|