Package org.prolog4j
Class Converter<T>
- java.lang.Object
-
- org.prolog4j.Converter<T>
-
- Type Parameters:
T
- the type of the objects to convert
public abstract class Converter<T> extends Object
Converterinstances can convert objects of type T to another object.
-
-
Constructor Summary
Constructors Constructor Description Converter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Object
convert(T term)
Converts an object to another one.<R> R
convert(T object, Class<R> to)
Converts an object to another one of a specific type.
-
-
-
Method Detail
-
convert
public abstract Object convert(T term)
Converts an object to another one. If the conversion is not applicable then it returnsnull
.- Parameters:
term
- the object to convert- Returns:
- the result of the conversion or
null
if the object cannot be converted
-
convert
public <R> R convert(T object, Class<R> to)
Converts an object to another one of a specific type. If the conversion is not applicable then it returnsnull
.- Type Parameters:
R
- the type- Parameters:
object
- the object to convertto
- the type to convert to- Returns:
- the result of the conversion or
null
if the object cannot be converted
-
-