com.zentense.step2.view
Class RowView

java.lang.Object
  extended by com.zentense.step2.view.View
      extended by com.zentense.step2.view.RowView
Direct Known Subclasses:
VectorRowView

public class RowView
extends View

This class is a view of a single row. A row is a group of pairs (key, value), as in a Hashtable (in fact a RowView is a wrapper of a Hashtable) and this is the simplest view possible and can contain a row or none.

Author:
kurt

Nested Class Summary
 
Nested classes/interfaces inherited from class com.zentense.step2.view.View
View.Empty
 
Field Summary
protected  java.util.Hashtable row
          Current row values
 
Fields inherited from class com.zentense.step2.view.View
EMPTY
 
Constructor Summary
RowView()
          Empty constructor
RowView(java.util.Hashtable row)
          Constructs a RowView from a Hashtable
RowView(java.util.Vector v)
          Constructs a RowView from a Vector.
 
Method Summary
 java.lang.Object get(java.lang.String colName)
          Gets a column value
 java.lang.String[] getCols()
          Gets column names (keys)
 java.util.Hashtable getRow()
          Gets the row of this view
 int getSize()
          Gets results size
 boolean isEmpty()
          Is this row empty?
 void set(java.lang.String colName, java.lang.Object obj)
          Sets a (key, value) pair
 void setRow(java.util.Hashtable row)
          Sets the row (the Hashtable) of this view.
 void setRow(java.util.Vector v)
          Sets the row of this view.
 RowView setRowOp(java.util.Vector v)
          This method is used internally by 2step.
 java.lang.String toString()
          Returns an string representation of this object
 
Methods inherited from class com.zentense.step2.view.View
asDelegated, asDelegatedResultSet, asResultSet, fillFromRow, fillRowFromRequest, first, getBool, getCachedClone, getColsAsView, getCount, getDouble, getIndent, getInt, getOrdinal, getRow, getStart, getSum, insertRow, next, open, randomPosition, setPageBounds, setPageBounds, setPageBounds, setPageBounds, setPosition, updateRow
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

row

protected java.util.Hashtable row
Current row values

Constructor Detail

RowView

public RowView()
Empty constructor


RowView

public RowView(java.util.Hashtable row)
Constructs a RowView from a Hashtable

Parameters:
row - The (key, value) pairs.

RowView

public RowView(java.util.Vector v)
Constructs a RowView from a Vector. The Vector must be empty (then an empty RowView is constructed), or must contain a Hashtable as the first element that will be used for constructing the RowView.

Parameters:
v - A Vector
Method Detail

setRow

public final void setRow(java.util.Hashtable row)
Sets the row (the Hashtable) of this view.

Parameters:
row - A Hashtable

setRow

public final void setRow(java.util.Vector v)
Sets the row of this view.

Parameters:
v - An empty Vector, or a Vector that contains a Hashtable as the first element.

setRowOp

public final RowView setRowOp(java.util.Vector v)
This method is used internally by 2step.

Parameters:
v - A Vector
Returns:
this RowView

getRow

public final java.util.Hashtable getRow()
Gets the row of this view

Overrides:
getRow in class View
Returns:
A Hashtable with the (key, value) pairs

isEmpty

public final boolean isEmpty()
Is this row empty?

Returns:
true if there is not any pair (key, value)

getSize

public int getSize()
            throws java.lang.Exception
Gets results size

Specified by:
getSize in class View
Returns:
Number of pairs in row
Throws:
java.lang.Exception

set

public void set(java.lang.String colName,
                java.lang.Object obj)
         throws java.lang.Exception
Sets a (key, value) pair

Specified by:
set in class View
Parameters:
colName - Column name (key)
obj - Value
Throws:
java.lang.Exception

get

public java.lang.Object get(java.lang.String colName)
Gets a column value

Specified by:
get in class View
Parameters:
colName - Column name (key)
Returns:
Column value

getCols

public java.lang.String[] getCols()
                           throws java.lang.Exception
Gets column names (keys)

Specified by:
getCols in class View
Returns:
Array of names
Throws:
java.lang.Exception

toString

public java.lang.String toString()
Returns an string representation of this object

Overrides:
toString in class java.lang.Object
Returns:
String representation of the rowview

 

© Zentense 2008