|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object standup.joke.InstantiationConstraintLexicon
public class InstantiationConstraintLexicon
An InstantiationConstraint
that constrains a joke to make use of at
least one Lexeme
in a given LexemeSet
.
Currently, if used to actually generate a joke, it requires a member
Lexeme
to appear in both the schema and clause
instantiations! Use either InstantiationConstraintLexiconSchema
or
InstantiationConstraintLexiconClause
instead.
It works as expected for validate(JokeStructure)
, though.
Field Summary | |
---|---|
(package private) LexemeSet |
lexicon
The LexemeSet where at least one Lexeme is required to appear in the joke. |
(package private) String |
lxsTable
The name of the (temporary) SQL table that has been created in the SQL database for querying purposes. |
Constructor Summary | |
---|---|
InstantiationConstraintLexicon(LexemeSet lexs)
Constructor must provide the LexemeSet and the name for the SQL table. |
Method Summary | |
---|---|
protected void |
finalize()
|
String |
getSQLConstraint(Clause s,
List<SQLSelectElement> taqlsses)
Returns an SQL code snippet that is to be appended to the WHERE clause of the SQL query when instantiating the given Clause . |
void |
handleSchema(SQLQuerySchema schemaSQLQuery)
Modifies the given SQLQuerySchema to reflect this constraint. |
String |
toString()
|
boolean |
validate(JokeStructure j)
Returns true if the given JokeStructure satisfies this
constraint, and false if not. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
LexemeSet lexicon
String lxsTable
Constructor Detail |
---|
public InstantiationConstraintLexicon(LexemeSet lexs)
lexs
- tableName
- Method Detail |
---|
public void handleSchema(SQLQuerySchema schemaSQLQuery)
InstantiationConstraint
SQLQuerySchema
to reflect this constraint.
handleSchema
in interface InstantiationConstraint
public String getSQLConstraint(Clause s, List<SQLSelectElement> taqlsses)
InstantiationConstraint
Clause
.
getSQLConstraint
in interface InstantiationConstraint
s
- the Clause
being instantiated.
public boolean validate(JokeStructure j)
JokeConstraint
true
if the given JokeStructure
satisfies this
constraint, and false
if not.
validate
in interface JokeConstraint
j
- the JokeStructure
being validated
true
if j
satisfies this constraint,
false
otherwise.public String toString()
toString
in class Object
protected void finalize() throws Throwable
finalize
in class Object
Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |