public abstract class AbstractConverter<T> extends Object implements PrologConverter<T>
PrologConverter
interface.Modifier and Type | Field and Description |
---|---|
protected PrologProvider |
provider |
protected HashMap<String,T> |
sharedPrologVariables |
protected HashMap<String,PrologVariable> |
sharedVariables |
static String |
SIMPLE_ATOM_REGEX |
Modifier | Constructor and Description |
---|---|
protected |
AbstractConverter() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
<K> K |
fromTerm(PrologTerm term,
Class<K> to)
Create a native rule representation term from given head and body and cast
this native term to some specific given class.
|
<K> K |
fromTerm(PrologTerm head,
PrologTerm[] body,
Class<K> to)
Create a native rule representation term from given head and body and cast
this native term to some specific given class.
|
<K> K[] |
fromTermArray(PrologTerm[] terms,
Class<K[]> to)
Create a native term array representation from given Prolog term array and
cast this native term array to some specific given array class.
|
Class<T> |
getGenericClass()
Get the generic class for the current Prolog converter at runtime.
|
protected PrologLogger |
getLogger() |
int |
hashCode() |
String |
removeQuoted(String functor) |
<K extends PrologTerm> |
toTerm(Object o,
Class<K> from)
Create an equivalent Prolog term using the given native term representation
and cast this Prolog term to some specific given class.
|
<K extends PrologTerm> |
toTermArray(Object[] os,
Class<K[]> from)
Create an equivalent Prolog terms array using the given native terms array
representation and cast this Prolog term array to some specific array
component class.
|
PrologTerm[] |
toTermArray(T[] terms)
Create an equivalent Prolog terms array using the given native terms array
representation.
|
Map<String,PrologTerm> |
toTermMap(Map<String,T> map)
Create an equivalent Prolog terms map using the given native terms map
representation.
|
<K extends PrologTerm,V> |
toTermMap(Map<String,V> map,
Class<K> from)
Create an equivalent Prolog terms map using the given native terms map
representation and cast every Prolog term to some specific given class.
|
Map<String,PrologTerm>[] |
toTermMapArray(Map<String,T>[] map)
Create an equivalent Prolog terms map array using the given native terms map
array representation.
|
<K extends PrologTerm,V> |
toTermMapArray(Map<String,V>[] map,
Class<K> from)
Create an equivalent Prolog terms map array using the given native terms map
array representation and cast every Prolog term to some specific given class.
|
<K extends PrologTerm> |
toTermMatrix(Object[][] oss,
Class<K[][]> from)
Create an equivalent Prolog terms matrix using the given native terms matrix
representation and cast every Prolog terms matrix to some specific matrix
component class.
|
PrologTerm[][] |
toTermMatrix(T[][] terms)
Create an equivalent Prolog terms matrix using the given native terms matrix
representation.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
createProvider, fromTerm, fromTerm, fromTermArray, toTerm
public static final String SIMPLE_ATOM_REGEX
protected final HashMap<String,PrologVariable> sharedVariables
protected final PrologProvider provider
protected final PrologLogger getLogger()
public final PrologTerm[] toTermArray(T[] terms)
PrologConverter
toTermArray
in interface PrologConverter<T>
terms
- native terms array representation to be convertedpublic final PrologTerm[][] toTermMatrix(T[][] terms)
PrologConverter
toTermMatrix
in interface PrologConverter<T>
terms
- native terms matrix representation to be convertedpublic final Map<String,PrologTerm> toTermMap(Map<String,T> map)
PrologConverter
toTermMap
in interface PrologConverter<T>
map
- native terms map representation to be convertedpublic final Map<String,PrologTerm>[] toTermMapArray(Map<String,T>[] map)
PrologConverter
toTermMapArray
in interface PrologConverter<T>
map
- native terms map array to be converted in Prolog terms map array.public final <K extends PrologTerm> K toTerm(Object o, Class<K> from)
K
- generic type that extends from PrologTerm
o
- native term representation to be convertedfrom
- class to be cast the result Prolog termpublic final <K extends PrologTerm> K[] toTermArray(Object[] os, Class<K[]> from)
K
- generic type that extends from PrologTerm
os
- native terms array representation to be convertedfrom
- class to be cast the result Prolog termpublic final <K extends PrologTerm> K[][] toTermMatrix(Object[][] oss, Class<K[][]> from)
K
- generic type that extends from PrologTerm
oss
- native terms matrix representation to be convertedfrom
- class to be cast the result Prolog termpublic final <K extends PrologTerm,V> Map<String,PrologTerm> toTermMap(Map<String,V> map, Class<K> from)
K
- generic type that extends from PrologTerm
V
- generic type that extends from Object
representing a
native prolog term.map
- native terms map representation to be convertedfrom
- class to be cast the result Prolog termpublic final <K extends PrologTerm,V> Map<String,PrologTerm>[] toTermMapArray(Map<String,V>[] map, Class<K> from)
K
- generic type that extends from PrologTerm
V
- generic type that extends from Object
representing a
native prolog term.map
- native terms map array to be converted in Prolog terms map array.from
- class to be cast the result Prolog termpublic final <K> K fromTerm(PrologTerm term, Class<K> to)
K
- generic type that represent native prolog typeterm
- Prolog term to be converted to native term.to
- class to be cast the result native termpublic final <K> K[] fromTermArray(PrologTerm[] terms, Class<K[]> to)
K
- generic type that represent native prolog typeterms
- Prolog term array to be converted to native array.to
- class to be cast the result native termpublic final <K> K fromTerm(PrologTerm head, PrologTerm[] body, Class<K> to)
K
- generic type that represent native prolog typehead
- rule headbody
- rule bodyto
- class to be cast the result native termpublic final Class<T> getGenericClass()
PrologConverter
getGenericClass
in interface PrologConverter<T>
Copyright © 2020–2024 Prolobjectlink Project. All rights reserved.