com.fourspaces.couchdb
Class View

java.lang.Object
  extended by com.fourspaces.couchdb.View
Direct Known Subclasses:
AdHocView

public class View
extends java.lang.Object

The View is the mechanism for performing Querys on a CouchDB instance. The view can be named or ad-hoc (see AdHocView). (Currently [14 Sept 2007] named view aren't working in the mainline CouchDB code... but this _should_ work.)

The View object exists mainly to apply filtering to the view. Otherwise, views can be called directly from the database object by using their names (or given an ad-hoc query).

Author:
mbreese

Field Summary
protected  java.lang.Integer count
           
protected  Document document
           
protected  java.lang.String endKey
           
protected  java.lang.String function
           
protected  java.lang.String name
           
protected  java.lang.Boolean reverse
           
protected  java.lang.String skip
           
protected  java.lang.String startKey
           
protected  java.lang.Boolean update
           
 
Constructor Summary
View(Document doc, java.lang.String name)
          Build a view given a document and a name
View(java.lang.String fullname)
          Build a view given only a fullname ex: ("_add_docs", "_temp_view")
 
Method Summary
 java.lang.String getFullName()
          the full name for this view (w/ doc id, if avail) in the form of : "docid:name" or "name"
 java.lang.String getFunction()
          The function definition for this view, if it is available.
 java.lang.String getName()
          The name for this view (w/o doc id)
 java.lang.String getQueryString()
          Based upon settings, builds the queryString to add to the URL for this view.
 void setCount(java.lang.Integer count)
          The number of entries to return
 void setEndKey(java.lang.String endKey)
          Stop listing at this key
 void setReverse(java.lang.Boolean reverse)
          Reverse the listing
 void setSkip(java.lang.String skip)
          Skip listing these keys (not sure if this works, or the format)
 void setStartKey(java.lang.String startKey)
          Start listing at this key
 void setUpdate(java.lang.Boolean update)
          Not sure...
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

startKey

protected java.lang.String startKey

endKey

protected java.lang.String endKey

count

protected java.lang.Integer count

update

protected java.lang.Boolean update

reverse

protected java.lang.Boolean reverse

skip

protected java.lang.String skip

name

protected java.lang.String name

document

protected Document document

function

protected java.lang.String function
Constructor Detail

View

public View(Document doc,
            java.lang.String name)
Build a view given a document and a name

Parameters:
doc -
name -

View

public View(java.lang.String fullname)
Build a view given only a fullname ex: ("_add_docs", "_temp_view")

Parameters:
fullname -
Method Detail

getQueryString

public java.lang.String getQueryString()
Based upon settings, builds the queryString to add to the URL for this view.

Returns:

setCount

public void setCount(java.lang.Integer count)
The number of entries to return

Parameters:
count -

setEndKey

public void setEndKey(java.lang.String endKey)
Stop listing at this key

Parameters:
endKey -

setReverse

public void setReverse(java.lang.Boolean reverse)
Reverse the listing

Parameters:
reverse -

setSkip

public void setSkip(java.lang.String skip)
Skip listing these keys (not sure if this works, or the format)

Parameters:
skip -

setStartKey

public void setStartKey(java.lang.String startKey)
Start listing at this key

Parameters:
startKey -

setUpdate

public void setUpdate(java.lang.Boolean update)
Not sure... might be for batch updates, but not sure.

Parameters:
update -

getName

public java.lang.String getName()
The name for this view (w/o doc id)

Returns:

getFullName

public java.lang.String getFullName()
the full name for this view (w/ doc id, if avail) in the form of : "docid:name" or "name"

Returns:

getFunction

public java.lang.String getFunction()
The function definition for this view, if it is available.

Returns: