com.fourspaces.couchdb
Class View

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

public class View
extends 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  Integer count
           
protected  Document document
           
protected  String endKey
           
protected  String function
           
protected  String name
           
protected  Boolean reverse
           
protected  String skip
           
protected  String startKey
           
protected  Boolean update
           
 
Constructor Summary
View(Document doc, String name)
          Build a view given a document and a name
View(String fullname)
          Build a view given only a fullname ex: ("_add_docs", "_temp_view")
 
Method Summary
 String getFullName()
          the full name for this view (w/ doc id, if avail) in the form of : "docid:name" or "name"
 String getFunction()
          The function definition for this view, if it is available.
 String getName()
          The name for this view (w/o doc id)
 String getQueryString()
          Based upon settings, builds the queryString to add to the URL for this view.
 void setCount(Integer count)
          The number of entries to return
 void setEndKey(String endKey)
          Stop listing at this key
 void setReverse(Boolean reverse)
          Reverse the listing
 void setSkip(String skip)
          Skip listing these keys (not sure if this works, or the format)
 void setStartKey(String startKey)
          Start listing at this key
 void setUpdate(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 String startKey

endKey

protected String endKey

count

protected Integer count

update

protected Boolean update

reverse

protected Boolean reverse

skip

protected String skip

name

protected String name

document

protected Document document

function

protected String function
Constructor Detail

View

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

Parameters:
doc -
name -

View

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

Parameters:
fullname -
Method Detail

getQueryString

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

Returns:

setCount

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

Parameters:
count -

setEndKey

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

Parameters:
endKey -

setReverse

public void setReverse(Boolean reverse)
Reverse the listing

Parameters:
reverse -

setSkip

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

Parameters:
skip -

setStartKey

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

Parameters:
startKey -

setUpdate

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

Parameters:
update -

getName

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

Returns:

getFullName

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

Returns:

getFunction

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

Returns:


Copyright © 2012. All Rights Reserved.