com.couchbase.client.protocol.views
Class AbstractView

java.lang.Object
  extended by com.couchbase.client.protocol.views.AbstractView
Direct Known Subclasses:
SpatialView, View

public abstract class AbstractView
extends java.lang.Object

The base class for Views and Spatial Views. This class acts as a base class for both map/reduce views and spatial views. Do not use this class directly, but instead create instances from either the View or the SpatialView classes.


Constructor Summary
AbstractView(java.lang.String database, java.lang.String designDoc, java.lang.String view)
          Instantiate a AbstractView object.
 
Method Summary
 java.lang.String getDatabaseName()
          Returns the database (bucket) name.
 java.lang.String getDesignDocumentName()
          Returns the design document name.
abstract  java.lang.String getURI()
          Returns the URI/String representation of the View.
 java.lang.String getViewName()
          Returns the view name.
abstract  boolean hasMap()
          Checks if the view has a "map" method defined.
abstract  boolean hasReduce()
          Checks if the view has a "reduce" method defined.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractView

public AbstractView(java.lang.String database,
                    java.lang.String designDoc,
                    java.lang.String view)
Instantiate a AbstractView object. This should only be used by subclasses like View or SpatialView.

Parameters:
database - the name of the database.
designDoc - the name of the corresponding design document.
view - the name of the view itself.
Method Detail

getDatabaseName

public java.lang.String getDatabaseName()
Returns the database (bucket) name.

Returns:
the database (bucket) name.

getDesignDocumentName

public java.lang.String getDesignDocumentName()
Returns the design document name.

Returns:
the name of the design document.

getViewName

public java.lang.String getViewName()
Returns the view name.

Returns:
the name of the view.

hasMap

public abstract boolean hasMap()
Checks if the view has a "map" method defined.

Returns:
true if it has a "map" method defined, false otherwise.

hasReduce

public abstract boolean hasReduce()
Checks if the view has a "reduce" method defined.

Returns:
true if it has a "reduce" method defined, false otherwise.

getURI

public abstract java.lang.String getURI()
Returns the URI/String representation of the View.

Returns:
the URI path of the View to query against the cluster.


Copyright © 2006-2009 Dustin Sallings, 2009-2012 Couchbase, Inc.