DLV
Class Predicate

java.lang.Object
  extended byDLV.Predicate
Direct Known Subclasses:
FilePredicate, JDBCPredicate

public class Predicate
extends java.lang.Object

This class allows to handle predicates (which corresponds to tables in a relational database).
A Predicate object may be part of a Model or it can be created to handle the input of DLV in a object oriented modality. You may use a predicate object which is part of a model as input for a new DLV invocation but if you would modify it without modifying the model you must clone it before using Object.clone().
Predicate class stores data in main memory, if you want to store data in a different storage device see JDBCPredicate and FilePredicate.


Two interfaces are provided. The first is java.util.Enumeration like the latter is java.sql.ResultSet like.

            Ex. 1.1 - How to work with predicates (Enumeration like)
    
            ...
            Model m=... // given a Model object m
            ...
    
            while (m.hasMorePredicates())
            {
             Predicate pred=m.nextPredicate();     // gets a predicate from m
             while(pred.hasMoreLiterals())            // iterate Literals contained in pred
             {
              Literal f=pred.nextLiteral();           // gets a Literal
              f.invert();                       // inverts Literal
              .. // do something else with f
             }
            }
            
            Ex. 1.2 - How to work with predicates (ResultSet like)
    
            ...
            Model m=... // given a Model object m
            ...
    
            while (m.next())
            {
             Predicate pred=m.getPredicate();     // gets a predicate from m
             while(pred.next())            // iterate Literals contained in pred
             {
              Literal f=pred.getLiteral();           // gets a Literal
              f.invert();                       // inverts Literal
              .. // do something else with f
             }
            }
            
            Ex. 2.1 - How to build a predicate (built in method)
    
            // we want build a predicate like that user("John","Red"). user("James","Bond").
    
            Predicate pred=new Predicate("user",2);     // builds a Predicate object ( a table )
    
            String[2] terms={"John","Red"};               // adds Literals
            pred.addLiteral(pred.new Literal(terms));
            terms={"James","Bond"}
            pred.addLiteral(pred.new Literal(terms));
    
            
            Ex. 2.2 - How to build a predicate (ResultSet like method)
    
            // we want build a predicate like that user("John","Red"). user("James","Bond").
    
            Predicate pred=new Predicate("user",2);     // builds a Predicate object ( a table )
    
            pred.moveToInsertRow();               // add Literals
            pred.updateString(1,"John");
            pred.updateString(2,"Red");
            pred.insertRow();
            pred.moveToInsertRow();
            pred.updateString(1,"James");
            pred.updateString(2,"Bond");
            pred.insertRow();
            

Version:
3.0
Author:
Francesco Ricca
See Also:
JDBCPredicate, FilePredicate, DlvHandler, Model

Nested Class Summary
 class Predicate.Literal
          This class represents Literals.
 
Constructor Summary
Predicate(java.lang.String name, int arity)
          Constructs a new Predicate instance.
Predicate(java.lang.String name, PredicateMetaData metadata)
          Constructs a new Predicate instance described by "meta".
 
Method Summary
 boolean absolute(int row)
          Moves the cursor to the given "row number" (in a relational view) in this Predicate object.
 void addLiteral(Predicate.Literal literal)
          This method append a new Literal to this Predicate.
 void afterLast()
          Moves the cursor to the end of this Predicate object, just after the last Literal.
 void appendTo(java.io.PrintWriter out)
          This method allows to save this Predicate in the file handled by "out".
 int arity()
          Returns the arity of this predicate.
 void beforeFirst()
          Moves the cursor to the front of this Predicate object, just before the first Literal.
 void cancelRowUpdates()
          Cancels the updates made to the current row in this Predicate object.
 boolean first()
          This method moves the cursor to the first Literal in this Predicate object.
 Predicate.Literal firstLiteral()
          This method returns the first literal and sets the cursor at the first position of this Predicate.
 java.math.BigDecimal getBigDecimal(int columnIndex)
          Gets the value of the designated column in the current row of this Predicate object as a java.math.BigDecimal object in the Java programming language.
 boolean getBoolean(int columnIndex)
          Gets the value of the designated column in the current row of this Predicate object as a boolean in the Java programming language.
 byte getByte(int columnIndex)
          Gets the value of the designated column in the current row of this Predicate object as a byte in the Java programming language.
 int getCursor()
          This method returns the position of current Literal.
 java.sql.Date getDate(int columnIndex)
          Gets the value of the designated column in the current row of this Predicate object as a java.sql.Date object in the Java programming language.
 double getDouble(int columnIndex)
          Gets the value of the designated column in the current row of this Predicate object as a double in the Java programming language.
 float getFloat(int columnIndex)
          Gets the value of the designated column in the current row of this Predicate object as a float in the Java programming language.
 int getInt(int columnIndex)
          Gets the value of the designated column in the current row of this Predicate object as a int in the Java programming language.
 boolean getIsPositive()
          Returns true if the i-th Literal is positive.
 boolean getIsPositive(int row)
          Returns true if the row-th Literal is positive.
 Predicate.Literal getLiteral()
          Returns the literal currently pointed by the cursor.
 Predicate.Literal getLiteral(int i)
          Returns the i-th literal.
 java.util.Enumeration getLiterals()
          This method returns an Enumeration of the Literals of this Predicate.
 long getLong(int columnIndex)
          Gets the value of the designated column in the current row of this Predicate object as a long in the Java programming language.
 Model getModel()
          Returns the model which contains this predicate, null otherwise.
 PredicateMetaData getPredicateMetaData()
          Gets meta information for this Predicate
 int getRow()
          Retrieves the current row number.
 short getShort(int columnIndex)
          Gets the value of the designated column in the current row of this Predicate object as a short in the Java programming language.
 java.lang.String getString(int columnIndex)
          Gets the value of the designated column in the current row of this Predicate object as a String object in the Java programming language.
 java.lang.String getTermAt(int i, int j)
          Returns the term contained in the j-th argument of the i-th Literal.
 java.sql.Time getTime(int columnIndex)
          Gets the value of the designated column in the current row of this Predicate object as a java.sql.Time object in the Java programming language.
 boolean hasMoreLiterals()
          This method returns true if there are more literals.
 void insertRow()
          Inserts the contents of the insert row into this Predicate object and into the database.
 boolean isFirst()
          Indicates whether the cursor is on the first Literal of this Predicate object.
 boolean isLast()
          Indicates whether the cursor is on the last Literal of this Predicate object.
 boolean last()
          This method moves the cursor to the last Literal in this Predicate object.
 Predicate.Literal lastLiteral()
          This method returns the last literal and set the cursor at the last position of this Predicate.
 void moveToCurrentRow()
          Moves the cursor to the remembered cursor position, usually the current row.
 void moveToInsertRow()
           
 java.lang.String name()
          Returns the name of this predicate.
 boolean next()
          Moves the cursor down one position from its current.
 Predicate.Literal nextLiteral()
          This method returns the next literal.
 boolean previous()
          Moves the cursor to the previous Literal in this Predicate object.
 Predicate.Literal previousLiteral()
          This method returns the previous literal.
 boolean relative(int i)
          Moves the cursor a relative number of positions, either positive or negative.
 void removeLiteral()
          This method removes the current literal if it exists, otherwise no operation is performed.
 void removeLiteral(int i)
          This method removes the i-th literal if it exists, otherwise no operation is performed.
 void saveTo(java.lang.String file)
          This method allows to save this Predicate in the file "file".
 void setIsPositive(int row, boolean positive)
          Updates the designated row (literal) with a boolean value indicating if row-th Literal must be positive.
 void setName(java.lang.String name)
          Sets predicate name.
 void setPredicateMetaData(PredicateMetaData meta)
          Sets meta information for this Predicate.
 void setTermAt(int i, int j, java.lang.String term)
          Sets the term contained in the j-th argument of the i-th Literal.
 int size()
          Returns the size of this predicate (number of tuples in a "relational view").
 java.lang.String toString()
           
 void updateBigDecimal(int columnIndex, java.math.BigDecimal x)
          Updates the designated column with a value.
 void updateBoolean(int columnIndex, boolean x)
          Updates the designated column with a boolean value.
 void updateByte(int columnIndex, byte x)
          Updates the designated column with an byte value.
 void updateDate(int columnIndex, java.sql.Date x)
          Updates the designated column with a java.sql.Date value.
 void updateDouble(int columnIndex, double x)
          Updates the designated column with a double value.
 void updateFloat(int columnIndex, float x)
          Updates the designated column with a Float value.
 void updateInt(int columnIndex, int x)
          Updates the designated column with an int value.
 void updateIsPositive(boolean positive)
          Updates the designated row (literal) with a boolean value indicating if current Literal must be positive.
 void updateLiteral(int i, Predicate.Literal literal)
          This method updates (replace) the i-th literal if it exists, otherwise NoSuchLiteralException is thrown.
 void updateLiteral(Predicate.Literal literal)
          This method updates (replace) the literal currently pointed by the cursor if it exists, otherwise NoSuchLiteralException is thrown.
 void updateLong(int columnIndex, long x)
          Updates the designated column with a long value.
 void updateNull(int columnIndex)
          Gives a nullable column a null value.
 void updateRow()
          Updates the underlying Predicate object with the new contents of the current row.
 void updateShort(int columnIndex, short x)
          Updates the designated column with a Short value.
 void updateString(int columnIndex, java.lang.String x)
          Updates the designated column with a String value.
 void updateTime(int columnIndex, java.sql.Time x)
          Updates the designated column with a Time value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Predicate

public Predicate(java.lang.String name,
                 int arity)
Constructs a new Predicate instance.

Parameters:
name - Is the name of this predicate.
arity - Is the arity of this predicate.
Throws:
java.lang.NullPointerException - if "name" is null.

Predicate

public Predicate(java.lang.String name,
                 PredicateMetaData metadata)
Constructs a new Predicate instance described by "meta".

Parameters:
name - Is the name of this predicate.
metadata - A PredicateMetaData object.
Throws:
java.lang.NullPointerException - if "name" is null.
Method Detail

setName

public void setName(java.lang.String name)
Sets predicate name.

Parameters:
name - A predicate name.

setPredicateMetaData

public void setPredicateMetaData(PredicateMetaData meta)
Sets meta information for this Predicate.

Parameters:
meta - A PredicateMetaData object.
Throws:
BadArityException - if "meta" is invalid.

getPredicateMetaData

public PredicateMetaData getPredicateMetaData()
Gets meta information for this Predicate

Returns:
If exists, a PredicateMetaData object which describe this predicate, otherwise null.

name

public java.lang.String name()
Returns the name of this predicate.

Returns:
The name of this predicate.

arity

public int arity()
Returns the arity of this predicate.

Returns:
The arity of this predicate.

size

public int size()
Returns the size of this predicate (number of tuples in a "relational view").

Returns:
The size of this predicate.

getModel

public Model getModel()
Returns the model which contains this predicate, null otherwise.

Returns:
The model which contains this predicate, null otherwise.

getTermAt

public java.lang.String getTermAt(int i,
                                  int j)
Returns the term contained in the j-th argument of the i-th Literal.

Parameters:
i - identifies the i-th Literal.
j - identifies the j-th argument.
Returns:
The term contained in the j-th argument of the i-th Literal.
Throws:
NoSuchLiteralException - if you try to get a Literal which doesn't exist.
NoSuchTermException - if you try to get a term which doesn't exist.

setTermAt

public void setTermAt(int i,
                      int j,
                      java.lang.String term)
Sets the term contained in the j-th argument of the i-th Literal.

Parameters:
i - identifies the i-th Literal.
j - identifies the j-th argument.
term - a term.
Throws:
NoSuchLiteralException - if you try to get a Literal which doesn't exist.
NoSuchTermException - if you try to get a term which doesn't exist.
MalformedtermException - if the term "term" is malformed.

getLiteral

public Predicate.Literal getLiteral()
Returns the literal currently pointed by the cursor.

Returns:
The literal currently pointed by the cursor.
Throws:
NoSuchLiteralException - if you try to get a Literal which doesn't exist.

getLiteral

public Predicate.Literal getLiteral(int i)
Returns the i-th literal.

Returns:
The i-th literal.
Throws:
NoSuchLiteralException - if you try to get a Literal which doesn't exist.

updateLiteral

public void updateLiteral(Predicate.Literal literal)
This method updates (replace) the literal currently pointed by the cursor if it exists, otherwise NoSuchLiteralException is thrown.

Parameters:
literal - the new version of the literal.
Throws:
NoSuchLiteralException - if you try to update a literal which doesn't exist.
BadArityException - if term length is less than the arity of the Predicate.
TrueNegationNotSupportedException - if you try to insert a negative literal and the implementation of the current Predicate does not support true negation.

updateLiteral

public void updateLiteral(int i,
                          Predicate.Literal literal)
This method updates (replace) the i-th literal if it exists, otherwise NoSuchLiteralException is thrown.

Parameters:
literal - the new version of the i-th literal.
Throws:
NoSuchLiteralException - if you try to update a literal which doesn't exist.
BadArityException - if term length is less than the arity of the Predicate.
java.lang.NullPointerException - if literal is null.
TrueNegationNotSupportedException - if you try to insert a negative literal and the implementation of the current Predicate does not support true negation.

removeLiteral

public void removeLiteral()
This method removes the current literal if it exists, otherwise no operation is performed.


removeLiteral

public void removeLiteral(int i)
This method removes the i-th literal if it exists, otherwise no operation is performed.

Parameters:
i - the position of the literal that you would remove from this Predicate.

addLiteral

public void addLiteral(Predicate.Literal literal)
This method append a new Literal to this Predicate. If "literal" belongs to another Predicate object, a new Literal object, which belongs to this Predicate object, is created and added to this. The new Literal has the same terms of "literal".

Parameters:
literal - The Literal object you would add.
Throws:
java.lang.NullPointerException - if "literal" is null
BadArityException - if "literal" arity differs from the arity of this Predicate.
TrueNegationNotSupportedException - if you try to insert a negative literal and the implementation of the current Predicate does not support true negation.

hasMoreLiterals

public boolean hasMoreLiterals()
This method returns true if there are more literals. This method is useful to iterate inside a Predicate object.

Returns:
true if there are more literals, false otherwise.

nextLiteral

public Predicate.Literal nextLiteral()
This method returns the next literal. It moves the cursor a position down and then returns the literal pointed by it. This method is useful to iterate inside a Predicate object.

Returns:
The next literal.
Throws:
NoSuchLiteralException - if you try to get a literal which doesn't exist.

previousLiteral

public Predicate.Literal previousLiteral()
This method returns the previous literal. It moves the cursor a position up and then returns the literal pointed by it. This method is useful to iterate inside a Predicate object.

Returns:
The previous literal.
Throws:
NoSuchLiteralException - if you try to get a literal which doesn't exist.

firstLiteral

public Predicate.Literal firstLiteral()
This method returns the first literal and sets the cursor at the first position of this Predicate. This method is useful to iterate inside a Predicate object.

Returns:
The first literal of this Predicate.
Throws:
NoSuchLiteralException - if you try to get a literal which doesn't exist.

lastLiteral

public Predicate.Literal lastLiteral()
This method returns the last literal and set the cursor at the last position of this Predicate. (After calling this method you can call nextLiteral() an other time without throwing a NoSuchLiteralException) This method is useful to iterate inside a Predicate object.

Returns:
The last literal of this Predicate.
Throws:
NoSuchLiteralException - if you try to get a literal which doesn't exist.

getCursor

public int getCursor()
This method returns the position of current Literal. If it returns -1 the cursor is before the first Literal. The call of getCursor() is the same as getRow()-1.

Returns:
The position of the current Literal.

first

public boolean first()
This method moves the cursor to the first Literal in this Predicate object.

Returns:
true if the cursor is on a valid Literal; false if there are no Literals in the Predicate

last

public boolean last()
This method moves the cursor to the last Literal in this Predicate object.

Returns:
true if the cursor is on a valid Literal; false if there are no Literals in the Predicate

beforeFirst

public void beforeFirst()
Moves the cursor to the front of this Predicate object, just before the first Literal. This method has no effect if the Predicate contains no Literals.


afterLast

public void afterLast()
Moves the cursor to the end of this Predicate object, just after the last Literal. This method has no effect if the Predicate contains no Literals.


isFirst

public boolean isFirst()
Indicates whether the cursor is on the first Literal of this Predicate object.

Returns:
true if the cursor is on the first Literal; false otherwise

isLast

public boolean isLast()
Indicates whether the cursor is on the last Literal of this Predicate object.

Returns:
true if the cursor is on the last Literal; false otherwise

relative

public boolean relative(int i)
Moves the cursor a relative number of positions, either positive or negative. Attempting to move beyond the first/last Literal in the Predicate positions the cursor before/after the the first/last Literal. Calling relative(0) is valid, but does not change the cursor position. Note: Calling the method relative(1) is different from calling the method next() because is makes sense to call next() when there is no current Literal, for example, when the cursor is positioned before the first Literal or after the last Literal of the Predicate.

Returns:
true if the cursor is on a Literal; false otherwise

previous

public boolean previous()
Moves the cursor to the previous Literal in this Predicate object.

Returns:
true if the cursor is on a valid position; false if it is off the Predicate

next

public boolean next()
Moves the cursor down one position from its current. A Predicate cursor is initially positioned before the first Literal; the first call to the method next makes the first Literal the current Literal; the second call makes the second Literal the current Literal, and so on.

Returns:
true if the new current position is valid; false if there are no more Literals.

getRow

public int getRow()
Retrieves the current row number. The first row is number 1, the second number 2, and so on.

Returns:
the current row number; 0 if there is no current row

absolute

public boolean absolute(int row)
Moves the cursor to the given "row number" (in a relational view) in this Predicate object. If the row number is positive, the cursor moves to the given row number with respect to the beginning of the result set. The first row is row 1, the second is row 2, and so on.

If the given row number is negative, the cursor moves to an absolute row position with respect to the end of the result set. For example, calling absolute(-1) positions the cursor on the last row (the cursor points the last Literal); calling absolute(-2) moves the cursor to the next-to-last row (the cursor points the next-to-last Literal), and so on.

An attempt to position the cursor beyond the first/last row in the Predicate leaves the cursor before the first Literal or after the last Literal.

Note: Calling absolute(1) is the same as calling first(). Calling absolute(-1) is the same as calling last().

Parameters:
row - the number of the row which the cursor should move to. A positive number indicates the row number counting from the beginning of the Predicate; a negative number indicates the row number counting from the end of the Predicate
Returns:
true if the cursor is on the Predicate; false otherwise

saveTo

public void saveTo(java.lang.String file)
            throws java.io.IOException
This method allows to save this Predicate in the file "file". The file "file" is overwritten by this method if it already exists, otherwise a new file is created. The file created by this method can be reused as input of DLV.

Throws:
java.io.IOException - if an error occurs during file creation.

appendTo

public void appendTo(java.io.PrintWriter out)
This method allows to save this Predicate in the file handled by "out". This Predicate is appended if "out" already exists. Be sure that "out" is open before call this method. This method doesn't close "out". The file modified by this method could be reused as input of DLV.

Throws:
java.io.IOException - if an error occurs processing "out".

getLiterals

public java.util.Enumeration getLiterals()
This method returns an Enumeration of the Literals of this Predicate. The Enumeration returned does not access the underlying Predicate implementation in sinchronized mode


toString

public java.lang.String toString()

getIsPositive

public boolean getIsPositive(int row)
Returns true if the row-th Literal is positive.

Parameters:
row - identifies the row-th Literal.
Returns:
true if the row-th Literal is positive.
Throws:
NoSuchLiteralException - if you try to get a Literal which doesn't exist.

setIsPositive

public void setIsPositive(int row,
                          boolean positive)
Updates the designated row (literal) with a boolean value indicating if row-th Literal must be positive.

Parameters:
row - A row.
positive - true if row-th literal must be a positive literal, false otherwise.
Throws:
NoSuchLiteralException - if you try to update a Literal which doesn't exist.
TrueNegationNotSupportedException - if the implementation of the current Predicate does not support true negation and positive is false.

getIsPositive

public boolean getIsPositive()
Returns true if the i-th Literal is positive.
This method extends JDBC-Like interface to handle negative Literals
Notice that it works like getXXX() methods

Returns:
true if the current Literal is positive.
Throws:
NoSuchLiteralException - if you try to get a Literal which doesn't exist.

updateIsPositive

public void updateIsPositive(boolean positive)
Updates the designated row (literal) with a boolean value indicating if current Literal must be positive. The updateXXX methods are used to update values in the current row or within the the insert row. The updateXXX methods do not update the underlying Predicate; instead the updateRow or insertRow methods are called to update the Predicate. This method extends JDBC-Like interface to handle negative Literals
Notice that it works like updateXXX() methods

Parameters:
positive - A boolean.
Throws:
NoSuchLiteralException - if you try to get a Literal which doesn't exist.
TrueNegationNotSupportedException - if the implementation of the current Predicate does not support true negation and positive is false.

updateBoolean

public void updateBoolean(int columnIndex,
                          boolean x)
Updates the designated column with a boolean value. The updateXXX methods are used to update column values in the current row or within the the insert row. The updateXXX methods do not update the underlying Predicate; instead the updateRow or insertRow methods are called to update the Predicate.

Parameters:
columnIndex - The first column is 1, the second is 2, ...
x - The new column value.

updateBigDecimal

public void updateBigDecimal(int columnIndex,
                             java.math.BigDecimal x)
Updates the designated column with a value. The updateXXX methods are used to update column values in the current row or within the insert row. The updateXXX methods do not update the underlying Predicate; instead the updateRow or insertRow methods are called to update the Predicate.

Parameters:
columnIndex - The first column is 1, the second is 2, ...
x - The new column value.

updateByte

public void updateByte(int columnIndex,
                       byte x)
Updates the designated column with an byte value. The updateXXX methods are used to update column values in the current row or the insert row. The updateXXX methods do not update the underlying Predicate; instead the updateRow or insertRow methods are called to update the Predicate.

Parameters:
columnIndex - The first column is 1, the second is 2, ...
x - The new column value.

updateDate

public void updateDate(int columnIndex,
                       java.sql.Date x)
Updates the designated column with a java.sql.Date value. The updateXXX methods are used to update column values in the current row or the insert row. The updateXXX methods do not update the underlying Predicate; instead the updateRow or insertRow methods are called to update the Predicate.

Parameters:
columnIndex - The first column is 1, the second is 2, ...
x - The new column value.

updateDouble

public void updateDouble(int columnIndex,
                         double x)
Updates the designated column with a double value. The updateXXX methods are used to update column values in the current row or the insert row. The updateXXX methods do not update the underlying Predicate; instead the updateRow or insertRow methods are called to update the Predicate.

Parameters:
columnIndex - The first column is 1, the second is 2, ...
x - The new column value.

updateFloat

public void updateFloat(int columnIndex,
                        float x)
Updates the designated column with a Float value. The updateXXX methods are used to update column values in the current row or the insert row. The updateXXX methods do not update the underlying Predicate; instead the updateRow or insertRow methods are called to update the Predicate.

Parameters:
columnIndex - The first column is 1, the second is 2, ...
x - The new column value.

updateInt

public void updateInt(int columnIndex,
                      int x)
Updates the designated column with an int value. The updateXXX methods are used to update column values in the current row or the insert row. The updateXXX methods do not update the underlying Predicate; instead the updateRow or insertRow methods are called to update the Predicate.

Parameters:
columnIndex - The first column is 1, the second is 2, ...
x - The new column value.

updateLong

public void updateLong(int columnIndex,
                       long x)
Updates the designated column with a long value. The updateXXX methods are used to update column values in the current row or the insert row. The updateXXX methods do not update the underlying Predicate; instead the updateRow or insertRow methods are called to update the Predicate.

Parameters:
columnIndex - The first column is 1, the second is 2, ...
x - The new column value.

updateNull

public void updateNull(int columnIndex)
Gives a nullable column a null value. The updateXXX methods are used to update column values in the current row or the insert row. The updateXXX methods do not update the underlying Predicate; instead the updateRow or insertRow methods are called to update the Predicate.

Parameters:
columnIndex - The first column is 1, the second is 2, ...

updateShort

public void updateShort(int columnIndex,
                        short x)
Updates the designated column with a Short value. The updateXXX methods are used to update column values in the current row or the insert row. The updateXXX methods do not update the underlying Predicate; instead the updateRow or insertRow methods are called to update the Predicate.

Parameters:
columnIndex - The first column is 1, the second is 2, ...
x - The new column value.

updateString

public void updateString(int columnIndex,
                         java.lang.String x)
Updates the designated column with a String value. The updateXXX methods are used to update column values in the current row or the insert row. The updateXXX methods do not update the underlying Predicate; instead the updateRow or insertRow methods are called to update the Predicate.

Parameters:
columnIndex - The first column is 1, the second is 2, ...
x - The new column value.

updateTime

public void updateTime(int columnIndex,
                       java.sql.Time x)
Updates the designated column with a Time value. The updateXXX methods are used to update column values in the current row or the insert row. The updateXXX methods do not update the underlying Predicate; instead the updateRow or insertRow methods are called to update the Predicate.

Parameters:
columnIndex - The first column is 1, the second is 2, ...
x - The new column value.

getBoolean

public boolean getBoolean(int columnIndex)
Gets the value of the designated column in the current row of this Predicate object as a boolean in the Java programming language.

Parameters:
columnIndex - The first column is 1, the second is 2, ...
Returns:
the column value; if the value is SQL NULL, the value returned is false.

getBigDecimal

public java.math.BigDecimal getBigDecimal(int columnIndex)
Gets the value of the designated column in the current row of this Predicate object as a java.math.BigDecimal object in the Java programming language.

Parameters:
columnIndex - The first column is 1, the second is 2, ...
Returns:
the column value; if the value is SQL NULL, the value returned is null.

getByte

public byte getByte(int columnIndex)
Gets the value of the designated column in the current row of this Predicate object as a byte in the Java programming language.

Parameters:
columnIndex - The first column is 1, the second is 2, ...
Returns:
the column value; if the value is SQL NULL, the value returned is 0.

getDate

public java.sql.Date getDate(int columnIndex)
Gets the value of the designated column in the current row of this Predicate object as a java.sql.Date object in the Java programming language.

Parameters:
columnIndex - The first column is 1, the second is 2, ...
Returns:
the column value; if the value is SQL NULL, the value returned is null.

getDouble

public double getDouble(int columnIndex)
Gets the value of the designated column in the current row of this Predicate object as a double in the Java programming language.

Parameters:
columnIndex - The first column is 1, the second is 2, ...
Returns:
the column value; if the value is SQL NULL, the value returned is 0.

getFloat

public float getFloat(int columnIndex)
Gets the value of the designated column in the current row of this Predicate object as a float in the Java programming language.

Parameters:
columnIndex - The first column is 1, the second is 2, ...
Returns:
the column value; if the value is SQL NULL, the value returned is 0.

getInt

public int getInt(int columnIndex)
Gets the value of the designated column in the current row of this Predicate object as a int in the Java programming language.

Parameters:
columnIndex - The first column is 1, the second is 2, ...
Returns:
the column value; if the value is SQL NULL, the value returned is 0.

getLong

public long getLong(int columnIndex)
Gets the value of the designated column in the current row of this Predicate object as a long in the Java programming language.

Parameters:
columnIndex - The first column is 1, the second is 2, ...
Returns:
the column value; if the value is SQL NULL, the value returned is 0.

getShort

public short getShort(int columnIndex)
Gets the value of the designated column in the current row of this Predicate object as a short in the Java programming language.

Parameters:
columnIndex - The first column is 1, the second is 2, ...
Returns:
the column value; if the value is SQL NULL, the value returned is 0.

getString

public java.lang.String getString(int columnIndex)
Gets the value of the designated column in the current row of this Predicate object as a String object in the Java programming language. In DLV syntax strings are quoted. This method removes quotes from the string if ConversionType.QUOTED_STRING is the type specified for this column in meta data informations.

Parameters:
columnIndex - The first column is 1, the second is 2, ...
Returns:
the column value; if the value is SQL NULL, the value returned is null.

getTime

public java.sql.Time getTime(int columnIndex)
Gets the value of the designated column in the current row of this Predicate object as a java.sql.Time object in the Java programming language. In DLV syntax strings are quoted. This method removes quotes from the string.

Parameters:
columnIndex - The first column is 1, the second is 2, ...
Returns:
the column value; if the value is SQL NULL, the value returned is null.

moveToInsertRow

public void moveToInsertRow()

cancelRowUpdates

public void cancelRowUpdates()
Cancels the updates made to the current row in this Predicate object. This method may be called after calling an updater method(s) and before calling the method updateRow to roll back the updates made to a row. If no updates have been made or updateRow has already been called, this method has no effect.


moveToCurrentRow

public void moveToCurrentRow()
Moves the cursor to the remembered cursor position, usually the current row. This method has no effect if the cursor is not on the insert row


insertRow

public void insertRow()
Inserts the contents of the insert row into this Predicate object and into the database. The cursor must be on the insert row when this method is called.


updateRow

public void updateRow()
Updates the underlying Predicate object with the new contents of the current row. This method cannot be called when the cursor is on the insert row.