rita.support
Class RiDataStore

java.lang.Object
  extended by rita.RiHtmlParser
      extended by rita.support.RiDataStore

public class RiDataStore
extends RiHtmlParser

Simple key-value based datastore with 3 functions (get, set, & find).

An example:

     RiDataStore rds = new RiDataStore("my.name.space");
     println( rds.set("mykey1", "fox1") ); 
     println( rds.set("mykey2", "fox12") );
     println( rds.get("mykey2") );
     println( rds.find("mykey") );   returns a String[]
 

Invisible:

Field Summary
 
Fields inherited from class rita.RiHtmlParser
DEFAULT_CHARSET, DEFAULT_CONNECT_TIMEOUT, DEFAULT_READ_TIMEOUT, DEFAULT_USER_AGENT
 
Constructor Summary
RiDataStore(processing.core.PApplet p, java.lang.String namespace)
           
RiDataStore(java.lang.String namespace)
           
 
Method Summary
 java.lang.String[] find(java.lang.String toMatch)
          Returns a String[] (containing one or more values) where the specified input ('toMatch') is contained in any part of the key, using the specified namespace, or null if none exist.
 java.lang.String get(java.lang.String key)
          Returns the single value for the specified key, or null if the key is not found.
 java.lang.String getHost()
           
 java.lang.String getLogin()
           
 java.lang.String getNamespace()
           
 java.lang.String getPassword()
           
static void main(java.lang.String[] args)
           
 boolean set(java.lang.String key, java.lang.String value)
          This method will inserts the value for the given key in the specified namespace, updating it if it already exists.
 void setHost(java.lang.String host)
           
 void setLogin(java.lang.String login)
           
 void setNamespace(java.lang.String namespace)
           
 void setPassword(java.lang.String password)
           
 
Methods inherited from class rita.RiHtmlParser
customParse, fetch, fetch, fetch, fetch, fetchImage, fetchLinks, fetchLinkText, fetchPImage, getConnectTimeout, getReadTimeout, getUserAgent, post, post, setConnectTimeout, setReadTimeout, setUserAgent
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RiDataStore

public RiDataStore(java.lang.String namespace)

RiDataStore

public RiDataStore(processing.core.PApplet p,
                   java.lang.String namespace)
Method Detail

set

public boolean set(java.lang.String key,
                   java.lang.String value)
This method will inserts the value for the given key in the specified namespace, updating it if it already exists.


get

public java.lang.String get(java.lang.String key)
Returns the single value for the specified key, or null if the key is not found.


find

public java.lang.String[] find(java.lang.String toMatch)
Returns a String[] (containing one or more values) where the specified input ('toMatch') is contained in any part of the key, using the specified namespace, or null if none exist.


getNamespace

public java.lang.String getNamespace()

setNamespace

public void setNamespace(java.lang.String namespace)

getHost

public java.lang.String getHost()

setHost

public void setHost(java.lang.String host)

getLogin

public java.lang.String getLogin()

setLogin

public void setLogin(java.lang.String login)

getPassword

public java.lang.String getPassword()

setPassword

public void setPassword(java.lang.String password)

main

public static void main(java.lang.String[] args)
Invisible: