ch.agent.crnickl.mongodb
Class ReadMethodsForValueType

java.lang.Object
  extended by ch.agent.crnickl.impl.DatabaseMethodsImpl
      extended by ch.agent.crnickl.mongodb.MongoDatabaseMethods
          extended by ch.agent.crnickl.mongodb.ReadMethodsForValueType
All Implemented Interfaces:
ch.agent.crnickl.impl.DatabaseMethods, ch.agent.crnickl.impl.PermissionChecker

public class ReadMethodsForValueType
extends MongoDatabaseMethods

A stateless object with methods providing read access to value types.

Author:
Jean-Paul Vetterli

Nested Class Summary
 
Nested classes/interfaces inherited from class ch.agent.crnickl.mongodb.MongoDatabaseMethods
MongoDatabaseMethods.Operator
 
Constructor Summary
ReadMethodsForValueType()
           
 
Method Summary
<T> ch.agent.crnickl.api.ValueType<T>
getValueType(ch.agent.crnickl.api.Database database, String name)
          Find a value type with a given name.
<T> ch.agent.crnickl.api.ValueType<T>
getValueType(ch.agent.crnickl.api.Surrogate s)
          Find a value type corresponding to a surrogate.
 Collection<ch.agent.crnickl.api.ValueType<?>> getValueTypes(ch.agent.crnickl.api.Database database, String pattern)
          Find a collection of value types with names matching a pattern.
 
Methods inherited from class ch.agent.crnickl.mongodb.MongoDatabaseMethods
addOperation, asQuery, compositeName, extractRegexp, getId, getId, getIdOrZero, getMongoDB, getMongoDB, getMongoDB, getObject, getObjectId, makeSurrogate, mongoObject, operation
 
Methods inherited from class ch.agent.crnickl.impl.DatabaseMethodsImpl
check, check, check, check, checkIntegrity, makeSurrogate, makeSurrogate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadMethodsForValueType

public ReadMethodsForValueType()
Method Detail

getValueType

public <T> ch.agent.crnickl.api.ValueType<T> getValueType(ch.agent.crnickl.api.Database database,
                                                          String name)
                                               throws ch.agent.crnickl.T2DBException
Find a value type with a given name.

Parameters:
database - a database
name - a string
Returns:
a value type or null
Throws:
ch.agent.crnickl.T2DBException

getValueTypes

public Collection<ch.agent.crnickl.api.ValueType<?>> getValueTypes(ch.agent.crnickl.api.Database database,
                                                                   String pattern)
                                                            throws ch.agent.crnickl.T2DBException
Find a collection of value types with names matching a pattern. If the pattern is enclosed in slashes it is taken as a standard regexp pattern; the slashes will be removed. If it is not enclosed in slashes, it is taken as a minimal pattern and all occurrences of "*" will be replaced with ".*" (zero or more arbitrary characters).

Parameters:
database - a database
pattern - a simple pattern or a regexp pattern
Returns:
a collection of value types, possibly empty, never null
Throws:
ch.agent.crnickl.T2DBException

getValueType

public <T> ch.agent.crnickl.api.ValueType<T> getValueType(ch.agent.crnickl.api.Surrogate s)
                                               throws ch.agent.crnickl.T2DBException
Find a value type corresponding to a surrogate.

Parameters:
s - a surrogate
Returns:
a value type or null
Throws:
ch.agent.crnickl.T2DBException


Copyright © 2013. All Rights Reserved.