📄 racertermparser.java
字号:
package org.mindswap.swoop.racer;
import java.util.*;
/** This class provides an interface to parse RACER concept and role terms. The behaviour provided here
performs no parsing at all; but provides syntax checking capabilities. The class can be extended in
order to provide also term parsing.<p>
In order to be able to provide a parser that returns object representations for concept and role
terms, only the build methods need to be redefined.
*/
public class RacerTermParser {
/**
* RacerTermParser constructor comment.
*/
public RacerTermParser() {
super();
}
/** This method builds a representation for an all term. For this class,
the returned value is null.
* @return java.lang.Object The representation of the all term (null for this class).
* @param role Object The role term.
* @param concept Object The concept term.
*/
protected Object buildAll(Object role,Object concept) {
return null;
}
/** This method builds a representation for an at-least term. For this class,
the returned value is null.
* @return java.lang.Object The representation of the at-least term (null for this class).
* @param n int An integer.
* @param role Object The role term.
*/
protected Object buildAtLeast(int n,Object role) {
return null;
}
/** This method builds a representation for an at-least term. For this class,
the returned value is null.
* @return java.lang.Object The representation of the at-least term (null for this class).
* @param n int An integer.
* @param role Object The role term.
* @param concept Object The concept term.
*/
protected Object buildAtLeast(int n,Object role,Object concept) {
return null;
}
/** This method builds a representation for an at-most term. For this class,
the returned value is null.
* @return java.lang.Object The representation of the at-most term (null for this class).
* @param n int An integer.
* @param role Object The role term.
*/
protected Object buildAtMost(int n,Object role) {
return null;
}
/** This method builds a representation for an at-least term. For this class,
the returned value is null.
* @return java.lang.Object The representation of the at-most term (null for this class).
* @param n int An integer.
* @param role Object The role term.
* @param concept Object The concept term.
*/
protected Object buildAtMost(int n,Object role,Object concept) {
return null;
}
/** This method builds an atomic concept.
* @return java.lang.Object The representation for the atomic concept (null for this class).
*/
protected Object buildAtomicConcept(String s) {
return null;
}
/** This method builds an atomic role.
* @return java.lang.Object The representation for the atomic role (null for this class).
*/
protected Object buildAtomicRole(String s) {
return null;
}
/** This method builds the bottom concept.
* @return java.lang.Object The representation for the bottom concept (null for this class).
*/
protected Object buildBottom() {
return null;
}
/** This method builds a representation for a conjunction term. For this class,
the returned value is null.
* @return java.lang.Object The representation of the conjunction term (null for this class).
* @param terms Object[] The subconcepts.
*/
protected Object buildConjunction(Object[] terms) {
return null;
}
/** This method builds a representation for a conjunction term. For this class,
the returned value is null.
* @return java.lang.Object The representation of the conjunction term (null for this class).
* @param terms Object[] The subconcepts.
*/
protected Object buildDisjunction(Object[] terms) {
return null;
}
/** This method builds a representation for an exactly term. For this class,
the returned value is null.
* @return java.lang.Object The representation of the exactly term (null for this class).
* @param n int An integer.
* @param role Object The role term.
*/
protected Object buildExactly(int n,Object role) {
return null;
}
/** This method builds a representation for an exactly term. For this class,
the returned value is null.
* @return java.lang.Object The representation of the exactly term (null for this class).
* @param n int An integer.
* @param role Object The role term.
* @param concept Object The concept term.
*/
protected Object buildExactly(int n,Object role,Object concept) {
return null;
}
/** This method builds the inverse of a role.
* @return java.lang.Object The representation for the inverse role (null for this class).
*/
protected Object buildInverse(Object role) {
return null;
}
/** This method builds the negation of a concept.
* @return java.lang.Object The representation for the negated concept (null for this class).
*/
protected Object buildNot(Object concept) {
return null;
}
/** This method builds a representation for a some term. For this class,
the returned value is null.
* @return java.lang.Object The representation of the some term (null for this class).
* @param role Object The role term.
* @param concept Object The concept term.
*/
protected Object buildSome(Object role,Object concept) {
return null;
}
/** This method builds the top concept.
* @return java.lang.Object The representation for the top concept (null for this class).
*/
protected Object buildTop() {
return null;
}
/** This method builds a litteral concept.
* @return java.lang.Object The representation for the litteral concept (null for this class).
*/
protected Object buildLitteral() {
return null;
}
/** This method returns the representation of the all concept represented by the vector. For this class,
the returned value is null.
* @return java.lang.Object The representation of the all term (null for this class).
* @param v java.util.Vector A vector of strings. The first position is filled with "all", the second
with the role term and the third with a concept term.
* @exception jracer.RacerIllegalConstruction If the term is not a racer term.
*/
protected Object parseAll(Vector v) throws RacerIllegalConstruction {
if (v.size()!=3) throw new RacerIllegalConstruction(v);
Object role=parseRole((String)v.elementAt(1));
Object concept=parseConcept((String)v.elementAt(2));
return buildAll(role,concept);
}
/** This method returns the representation of the at-least concept represented by the vector. For this class,
the returned value is null.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -