Interface TermFactory
- All Known Implementing Classes:
SameObjectTermFactory
public interface TermFactory
Factory for creating terms.
- Author:
- Florent Tornil
-
Method Summary
Modifier and TypeMethodDescriptionTwo objects created by a call to this function must never be equals according to the definition given by theVariableimplementation used An anonymous Variable must not be equals to an existing Variable created bycreateOrGetVariable(String).createOrGetConstant(String label) Two objects created by a call to this function with the same label argument must be equals according to the definition given by theConstantimplementation usedcreateOrGetFloatLiteral(T value) Creates or reuses a floating-point literal from a numeric value.Two objects created by a call to this function must never be equals according to the definition given by theConstantimplementation used A Fresh Constant must not be equals to an existing Constant created bycreateOrGetConstant(String).Two objects created by a call to this function must never be equals according to the definition given by theVariableimplementation used A Fresh Variable must not be equals to an existing Variable created bycreateOrGetVariable(String).createOrGetIntegerLiteral(T value) Creates or reuses an integer literal from a numeric value.<T> Literal<T> createOrGetLiteral(T value) Two object created by a call to this function with the same typed value argument must be equals according to the definition given by theLiteralimplementation used /!createOrGetLogicalFunctionalTerm(String name, List<Term> terms) Two objects created by a call to this function with the same label argument must be equals according to the definition given by theLogicalFunctionalTermimplementation usedcreateOrGetVariable(String label) Two objects created by a call to this function with the same label argument must be equals according to the definition given by theVariableimplementation usedLiteral<?> createOrGetXsdLiteral(String lexicalForm, XsdDataType dataType) Builds a literal from a lexical string and anXsdDataType.Literal<?> createOrGetXsdLiteral(String lexicalForm, String xsdType) Builds a literal from a lexical string and an XSD type reference (e.g.booleanforgetConstant(String label) Forgets a previously created constant.Literal<?> Gets the null literal value.
-
Method Details
-
createOrGetConstant
-
createOrGetLiteral
Two object created by a call to this function with the same typed value argument must be equals according to the definition given by theLiteralimplementation used /!\ This method must not be used to create a number literal- Type Parameters:
T- the native type of the literal- Parameters:
value- the value- Returns:
- a literal with the given value
-
createOrGetIntegerLiteral
-
createOrGetFloatLiteral
-
createOrGetVariable
-
createOrGetAnonymousVariable
Variable createOrGetAnonymousVariable()Two objects created by a call to this function must never be equals according to the definition given by theVariableimplementation used An anonymous Variable must not be equals to an existing Variable created bycreateOrGetVariable(String).- Returns:
- a variable with a new label
-
createOrGetLogicalFunctionalTerm
Two objects created by a call to this function with the same label argument must be equals according to the definition given by theLogicalFunctionalTermimplementation used- Parameters:
name- the name of the functionterms- the ordered arguments of the function- Returns:
- a logical functional term with the given name and terms
-
createOrGetFreshVariable
Variable createOrGetFreshVariable()Two objects created by a call to this function must never be equals according to the definition given by theVariableimplementation used A Fresh Variable must not be equals to an existing Variable created bycreateOrGetVariable(String).- Returns:
- a variable with a new label
-
createOrGetFreshConstant
Constant createOrGetFreshConstant()Two objects created by a call to this function must never be equals according to the definition given by theConstantimplementation used A Fresh Constant must not be equals to an existing Constant created bycreateOrGetConstant(String).- Returns:
- a constant with a new label
-
forgetConstant
Forgets a previously created constant.
This constant will no longer be considered as already existing in the factory.- Parameters:
label- the label of the previously created constant- Returns:
- true iff such a constant already exists in the factory, and thus forgets it.
-
createOrGetXsdLiteral
Builds a literal from a lexical string and an XSD type reference (e.g. "xsd:integer" or "http://www.w3.org/2001/XMLSchema#dateTime").The lexical string is parsed into a Java Object based on the XSD type, then stored in a Literal.
- Parameters:
lexicalForm- the lexical form to parsexsdType- the XSD type identifier- Returns:
- the parsed literal
-
createOrGetXsdLiteral
Builds a literal from a lexical string and anXsdDataType.- Parameters:
lexicalForm- the lexical form to parsedataType- the target datatype- Returns:
- the parsed literal
-
getNullLiteral
-