public abstract class Translator
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
LOG
reference to the logback logger instance
|
(package private) java.util.Map<java.lang.Class<?>,Pair<java.lang.Integer,java.lang.Class<?>>> |
translateMap |
static int |
TT_ASSOC |
static int |
TT_ATOM |
static int |
TT_PREDICATE |
static int |
TT_RULE |
Constructor and Description |
---|
Translator() |
Modifier and Type | Method and Description |
---|---|
protected static <T> T |
createInstance(java.lang.Class<T> cls) |
protected abstract java.util.Map<java.lang.Class<?>,Pair<java.lang.Integer,java.lang.Class<?>>> |
createTranslateMap() |
protected Pair<java.lang.Integer,java.lang.Class<?>> |
getTranslateInfo(java.lang.Class<?> cls) |
<A extends AssociativeFormula<? extends SimpleLogicalFormula>> |
translateAssociative(A source,
java.lang.Class<?> assocCls)
Translates the given AssociativeFormula into another AssociativeFormula
thats type is given by the parameter assocCls
|
Atom |
translateAtom(Atom source,
java.lang.Class<?> atomCls)
Translates the given source atom into an instance of atomCls and returns the
translation.
|
<C extends Predicate> |
translatePredicate(Predicate source,
java.lang.Class<C> predicateCls)
Translates the given source predicate into an instance of the given predicate
class and returns the translation.
|
Rule<?,?> |
translateRule(Rule<? extends SimpleLogicalFormula,? extends SimpleLogicalFormula> source,
java.lang.Class<?> ruleCls) |
SimpleLogicalFormula |
translateUsingMap(SimpleLogicalFormula source) |
private static org.slf4j.Logger LOG
public static final int TT_PREDICATE
public static final int TT_ATOM
public static final int TT_ASSOC
public static final int TT_RULE
java.util.Map<java.lang.Class<?>,Pair<java.lang.Integer,java.lang.Class<?>>> translateMap
protected abstract java.util.Map<java.lang.Class<?>,Pair<java.lang.Integer,java.lang.Class<?>>> createTranslateMap()
public <C extends Predicate> C translatePredicate(Predicate source, java.lang.Class<C> predicateCls) throws LanguageException
source
- The predicate acting as source for the operationpredicateCls
- The description of the destination Predicate classLanguageException
public Atom translateAtom(Atom source, java.lang.Class<?> atomCls) throws LanguageException
source
- The atom acting as sourceatomCls
- The description of the destination Atom classLanguageException
public <A extends AssociativeFormula<? extends SimpleLogicalFormula>> AssociativeFormula<?> translateAssociative(A source, java.lang.Class<?> assocCls)
source
- TheassocCls
- protected Pair<java.lang.Integer,java.lang.Class<?>> getTranslateInfo(java.lang.Class<?> cls)
public SimpleLogicalFormula translateUsingMap(SimpleLogicalFormula source)
public Rule<?,?> translateRule(Rule<? extends SimpleLogicalFormula,? extends SimpleLogicalFormula> source, java.lang.Class<?> ruleCls)
protected static <T> T createInstance(java.lang.Class<T> cls) throws LanguageException
LanguageException