jacquard 1.12.0 by The Web Engineering Factory and Toolworks

uk.co.weft.dbutil
Class Contexts

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractList
          extended byjava.util.Vector
              extended byuk.co.weft.dbutil.Contexts
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, DataStoreDescriptor, java.util.List, java.util.RandomAccess, java.io.Serializable
Direct Known Subclasses:
RSContexts

public class Contexts
extends java.util.Vector
implements DataStoreDescriptor

A collection of contexts; at minimum, a wrapper around Vector. At some stage subclass this to provide a somewhat more clever wrapper around a ResultSet, which only generates contexts when asked for.

Version:
$Revision: 1.6.4.1 $ This revision:
Author:
Simon Brooke, $Author: simon $
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
Contexts()
          default constructor does nothing
Contexts(java.sql.ResultSet results)
          create a contexts set based on this resultset
 
Method Summary
 void drop(Context c, java.lang.Object key)
          drop the (first) of my contexts with this value for its keyname
 int fetch(Context c, java.lang.Object key)
          fetch the values from the (first) of my contexts with this value for its keyname.
 Contexts match(Context c)
          Deprecated. use match( Context, boolean)
 Contexts match(Context c, boolean exact)
          Fetch all those of my contexts which match the values contained in this context.
 java.lang.Object store(Context c)
          Add this context to me.
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Constructor Detail

Contexts

public Contexts()
default constructor does nothing


Contexts

public Contexts(java.sql.ResultSet results)
create a contexts set based on this resultset

Method Detail

drop

public void drop(Context c,
                 java.lang.Object key)
          throws DataStoreException
drop the (first) of my contexts with this value for its keyname

Specified by:
drop in interface DataStoreDescriptor
Throws:
DataStoreException

fetch

public int fetch(Context c,
                 java.lang.Object key)
          throws DataStoreException
fetch the values from the (first) of my contexts with this value for its keyname.

Specified by:
fetch in interface DataStoreDescriptor
Throws:
DataStoreException

match

public Contexts match(Context c)
               throws DataStoreException
Deprecated. use match( Context, boolean)

Fetch all those of my contexts which match the values contained in this context

Specified by:
match in interface DataStoreDescriptor
Throws:
DataStoreException

match

public Contexts match(Context c,
                      boolean exact)
               throws DataStoreException
Fetch all those of my contexts which match the values contained in this context. Note that at present all matches on Contexts objects are exact. TODO: implement fuzzy matching

Specified by:
match in interface DataStoreDescriptor
Parameters:
c - the context to be matched
exact - whether or not an exact match is required
Throws:
DataStoreException

store

public java.lang.Object store(Context c)
                       throws DataStoreException
Add this context to me. Return its key value if any.

Specified by:
store in interface DataStoreDescriptor
Throws:
DataStoreException

jacquard 1.12.0 by The Web Engineering Factory and Toolworks