public interface PrologJavaConverter
PrologTerm to the equivalent Java object taking
like reference the following equivalence table.
| Java Object | Prolog Term |
null |
PrologProvider.prologNil() |
String |
PrologAtom |
Boolean.FALSE |
PrologProvider.prologFalse() |
Boolean.TRUE |
PrologProvider.prologTrue() |
Integer |
PrologInteger |
Float |
PrologFloat |
Double |
PrologDouble |
Long |
PrologLong |
Object[] |
PrologList |
Byte,
Character, Short that can be converted to
PrologInteger using your numeric value. The main problems is that
after PrologInteger conversion this value will be converted in
Integer.| Modifier and Type | Method and Description |
|---|---|
boolean |
containQuotes(String functor)
Check if the current functor have quotes at the start and end of the given
functor.
|
String |
removeQuotes(String functor)
Remove functor quotes if they are present.
|
Object |
toObject(PrologTerm term)
Create a Java object from given Prolog term.
|
List<Object> |
toObjectList(PrologTerm[] terms)
Create a Java objects list from given Prolog term array.
|
List<List<Object>> |
toObjectLists(PrologTerm[][] terms)
Create an equivalent list of objects lists using the given Prolog terms
matrix.
|
Map<String,Object> |
toObjectMap(Map<String,PrologTerm> map)
Create an equivalent Java object map using the given Prolog terms map.
|
List<Map<String,Object>> |
toObjectMaps(Map<String,PrologTerm>[] maps)
Create an equivalent Java object map list using the given Prolog terms map
array.
|
Object[] |
toObjectsArray(PrologTerm[] terms)
Create a Java objects array from given Prolog term array.
|
PrologTerm |
toTerm(Object object)
Create an equivalent Prolog term using the given Java object.
|
PrologTerm[] |
toTermsArray(Object[] objects)
Create an equivalent Prolog terms array using the given Java objects array.
|
List<Map<String,Object>> toObjectMaps(Map<String,PrologTerm>[] maps)
maps - Prolog terms map list to be converted in Java objects map list.Map<String,Object> toObjectMap(Map<String,PrologTerm> map)
map - Prolog terms map representation to be convertedList<Object> toObjectList(PrologTerm[] terms)
terms - Prolog term array to be converted to Java objects array.List<List<Object>> toObjectLists(PrologTerm[][] terms)
terms - Prolog terms matrix to be convertedObject[] toObjectsArray(PrologTerm[] terms)
terms - Prolog term array to be converted to Java objects array.PrologTerm[] toTermsArray(Object[] objects)
objects - Java objects array representation to be convertedObject toObject(PrologTerm term)
term - Prolog term to be converted to Java object.PrologTerm toTerm(Object object)
object - Java object to be convertedboolean containQuotes(String functor)
functor - string functor to be checkedString removeQuotes(String functor)
functor - string functor to remove quotes if they are present.Copyright © 2020–2024 Prolobjectlink Project. All rights reserved.