CDMA client API  3.1.0
CDMA core library
org.gumtree.data.Factory Class Reference

The Core factory is the entry point of the CDMA API. More...

List of all members.

Static Public Member Functions

static IDataset openDataset (URI uri) throws Exception
static IDataset openDataset (URI uri, boolean useDictionary) throws Exception
static void setActiveView (String experiment)
static String getActiveView ()
static String getKeyDictionaryPath ()
static String getMappingDictionaryFolder (IFactory factory)
static void setDictionariesFolder (String path)
static String getDictionariesFolder ()
static IIndex createIndex (int[] shape)
static IArray createArray (Class<?> clazz, int[] shape)
static IArray createArray (Class<?> clazz, int[] shape, final Object storage)
static IArray createArray (final Object javaArray)
static IArray createStringArray (String string)
static IArray createDoubleArray (double[] javaArray)
static IArray createDoubleArray (double[] javaArray, final int[] shape)
static IArray createArrayNoCopy (Object javaArray)
static IDataItem createDataItem (IDataset dataset, IGroup parent, String shortName, IArray array) throws InvalidArrayTypeException
static IDataItem createDataItem (IGroup parent, String shortName, IArray array) throws InvalidArrayTypeException
static IGroup createGroup (IDataset dataset, IGroup parent, String shortName, boolean init)
static IGroup createGroup (IGroup parent, String shortName, boolean updateParent)
static IGroup createGroup (String shortName) throws IOException
static ILogicalGroup createLogicalGroup (IDataset dataset, IKey key)
static IAttribute createAttribute (String name, Object value)
static IDataset createDatasetInstance (URI uri) throws Exception
static IDataset createDatasetInstance (URI uri, boolean useDictionary) throws Exception
static IDataset createEmptyDatasetInstance () throws IOException
static IKey createKey (String keyName)
static IPath createPath (String path)
static IDictionary createDictionary ()
static IFactoryManager getManager ()
static IFactory getFactory ()
static IFactory getFactory (String name)
static IFactory getFactory (URI uri)
static IFactory detectPlugin (URI uri)

Detailed Description

The Core factory is the entry point of the CDMA API.

The Factory class in common data model is a tools to create CDMA objects.. It manages all plug-ins instances.

According to an URI, it will detect which plug-in is relevant to that data source. It can take an URI as a parameter to instantiate a plug-in in order to get an access of the targeted data source using CDMA objects.

Abbreviation: Common Data Model Access -- CDMA

Author:
XIONG Norman RODRIGUEZ Clément
Version:
1.1

Member Function Documentation

static IArray org.gumtree.data.Factory.createArray ( Class<?>  clazz,
int[]  shape 
) [static]

Create an empty IArray with a certain data type and certain shape.

Parameters:
clazzClass type
shapejava array of integer
Returns:
CDMA IArray
Deprecated:
it is recommended to use IFactory#createArray(Class, int[])
static IArray org.gumtree.data.Factory.createArray ( Class<?>  clazz,
int[]  shape,
final Object  storage 
) [static]

Create an IArray with a given data type, shape and data storage.

Parameters:
clazzin Class type
shapejava array of integer
storagea 1D java array in the type reference by clazz
Returns:
CDMA IArray
Deprecated:
it is recommended to use IFactory#createArray(Class, int[], Object)
static IArray org.gumtree.data.Factory.createArray ( final Object  javaArray) [static]

Create an IArray from a java array. A new 1D java array storage will be created. The new CDMA IArray will be in the same type and same shape as the java array. The storage of the new array will be a COPY of the supplied java array.

Parameters:
javaArrayone to many dimensional java array
Returns:
CDMA IArray
Deprecated:
it is recommended to use IFactory#createArray(Object)
static IArray org.gumtree.data.Factory.createArrayNoCopy ( Object  javaArray) [static]

Create an IArray from a java array. A new 1D java array storage will be created. The new CDMA IArray will be in the same type and same shape as the java array. The storage of the new array will be the supplied java array.

Parameters:
javaArrayjava primary array
Returns:
CDMA array
Deprecated:
it is recommended to use IFactory#createArrayNoCopy(Object)
static IAttribute org.gumtree.data.Factory.createAttribute ( String  name,
Object  value 
) [static]

Create a CDMA Attribute with given name and value.

Parameters:
namein String type
valuein String type
Returns:
CDMA Attribute
Deprecated:
it is recommended to use IFactory#createAttribute(String, Object)
static IDataItem org.gumtree.data.Factory.createDataItem ( IDataset  dataset,
IGroup  parent,
String  shortName,
IArray  array 
) throws InvalidArrayTypeException [static]

Create a CDMA IDataItem with a given parent Group, Dataset, name and GDM IArray data.

Parameters:
datasetCDMA Dataset
parentCDMA Group
shortNamein String type
arrayCDMA IArray
Returns:
CDMA IDataItem
Exceptions:
InvalidArrayTypeExceptionwrong type
Deprecated:
use createDataItem(IGroup, String, IArray) instead
Since:
18/06/2008
static IDataItem org.gumtree.data.Factory.createDataItem ( IGroup  parent,
String  shortName,
IArray  array 
) throws InvalidArrayTypeException [static]

Create a IDataItem with a given CDMA parent Group, name and CDMA IArray data. If the parent Group is null, it will generate a temporary Group as the parent group.

Parameters:
parentCDMA Group
shortNamein String type
arrayCDMA IArray
Returns:
CDMA IDataItem
Exceptions:
InvalidArrayTypeException
Deprecated:
it is recommended to use IFactory#createDataItem(IGroup, String, IArray)
static IDataset org.gumtree.data.Factory.createDatasetInstance ( URI  uri) throws Exception [static]

Create a CDMA Dataset that can read the given URI.

Parameters:
uriURI object
Returns:
CDMA Dataset
Exceptions:
Exception
Deprecated:
use openDataset(URI)
static IDataset org.gumtree.data.Factory.createDatasetInstance ( URI  uri,
boolean  useDictionary 
) throws Exception [static]

Create a CDMA Dataset that can read the given URI and use optionally the Extended Dictionary mechanism.

Parameters:
uriURI object
useProduceronly
Returns:
CDMA Dataset
Exceptions:
Exception
Deprecated:
use openDataset(URI, boolean)

Create an empty CDMA IDictionary

Returns:
a CDMA IDictionary
Deprecated:
it is recommended to use IFactory#createDictionary()
static IArray org.gumtree.data.Factory.createDoubleArray ( double[]  javaArray) [static]

Create a double type IArray with a given single dimensional java double storage. The rank of the generated IArray object will be 1.

Parameters:
javaArrayjava double array in one dimension
Returns:
new IArray object
Deprecated:
it is recommended to use IFactory#createDoubleArray(double[])
static IArray org.gumtree.data.Factory.createDoubleArray ( double[]  javaArray,
final int[]  shape 
) [static]

Create a double type IArray with a given java double storage and shape.

Parameters:
javaArrayjava double array in one dimension
shapejava integer array
Returns:
new IArray object
Deprecated:
it is recommended to use IFactory#createDoubleArray(double[], int[])
static IDataset org.gumtree.data.Factory.createEmptyDatasetInstance ( ) throws IOException [static]

Create a CDMA Dataset in memory only. The dataset is not open yet. It is necessary to call dataset.open() to access the root of the dataset.

Returns:
a CDMA Dataset
Exceptions:
IOExceptionI/O error
Deprecated:
it is recommended to use IFactory#createEmptyDatasetInstance()
static IGroup org.gumtree.data.Factory.createGroup ( IDataset  dataset,
IGroup  parent,
String  shortName,
boolean  init 
) [static]

Create a CDMA Group with given Dataset, parent CDMA Group, name. A boolean initiate parameter tells the factory if the new group will be put in the list of children of the parent Group.

Parameters:
datasetCDMA Dataset
parentCDMA Group
shortNamein String type
initboolean type
Returns:
CDMA Group
Deprecated:
use createGroup(IGroup, String, boolean) instead
static IGroup org.gumtree.data.Factory.createGroup ( IGroup  parent,
String  shortName,
boolean  updateParent 
) [static]

Create a CDMA Group with a given parent CDMA Group, name, and a boolean initiate parameter telling the factory if the new group will be put in the list of children of the parent. Group.

Parameters:
parentCDMA Group
shortNamein String type
updateParentif the parent will be updated
Returns:
CDMA Group
Deprecated:
it is recommended to use IFactory#createGroup(IGroup, String, boolean)
static IGroup org.gumtree.data.Factory.createGroup ( String  shortName) throws IOException [static]

Create an empty CDMA Group with a given name. The factory will create an empty CDMA Dataset first, and create the new Group under the root group of the Dataset.

Parameters:
shortNamein String type
Returns:
CDMA Group
Exceptions:
IOException
Deprecated:
it is recommended to use IFactory#createGroup(String)
static IIndex org.gumtree.data.Factory.createIndex ( int[]  shape) [static]

Create an index of IArray by given a shape of the IArray.

Parameters:
shapejava array of integer
Returns:
CDMA IArray Index
Deprecated:
it is recommended to use Array::getIndex() instead.
See also:
IArray::getIndex()
static IKey org.gumtree.data.Factory.createKey ( String  keyName) [static]

Create a key having the given name

Parameters:
keyNameString
Returns:
new created IKey
Deprecated:
it is recommended to use IFactory#createKey(String)
static ILogicalGroup org.gumtree.data.Factory.createLogicalGroup ( IDataset  dataset,
IKey  key 
) [static]

Create an empty CDMA Logical Group with a given key.

Parameters:
parentan ILogicalGroup
keyan IKey that this group will correspond
Returns:
CDMA Logical Group
Exceptions:
IOException
Deprecated:
it is recommended to use IFactory#createLogicalGroup(IDataset, IKey)
static IPath org.gumtree.data.Factory.createPath ( String  path) [static]

Create a path having the given value

Parameters:
pathString
Returns:
new created IPath
Deprecated:
it is recommended to use IFactory#createPath(String)
static IArray org.gumtree.data.Factory.createStringArray ( String  string) [static]

Create an IArray of String storage. The rank of the new IArray will be 2 because it treat the IArray as 2D char array.

Parameters:
stringString value
Returns:
new IArray object
static IFactory org.gumtree.data.Factory.detectPlugin ( URI  uri) [static]

Return a plug-in IFactory that is the most relevant for the given URI. Try to detect factories according the following: if a plug-in declares itself as the owner of the targeted data source returns its factory else returns the first plug-in that is compatible with given data format no plug-in is compatible returns null

Parameters:
uriof the data source
Returns:
IFactory instance
static String org.gumtree.data.Factory.getActiveView ( ) [static]

Returns the name of the current view (e.q experiment) that is active for the Extended Dictionary mechanism.

Returns:
experiment name

Get the folder path where to search for key dictionary files (e.q: view or experiment). This folder should contains all dictionaries that the above application needs.

Returns:
path targeting a folder
static IFactory org.gumtree.data.Factory.getFactory ( ) [static]

Return the IFactory of the first available plug-in that was loaded

Returns:
first loaded IFactory
static IFactory org.gumtree.data.Factory.getFactory ( String  name) [static]

Return the plug-in's factory having the given name

Parameters:
nameof the requested factory
Returns:
IFactory instance
static IFactory org.gumtree.data.Factory.getFactory ( URI  uri) [static]

Return a plug-in IFactory that is the most relevant for the given URI. Try to detect factories according the following: if a plug-in declares itself as the owner of the targeted data source returns its factory else returns the first plug-in that is compatible with given data format no plug-in is compatible returns null

Parameters:
uriof the data source
Returns:
IFactory instance

According to the currently defined experiment, this method will return the path to reach the declarative dictionary. It means the file where is defined what should be found in a IDataset that fits the experiment. It's a descriptive file.

Returns:
the path to the standard declarative file
static IFactoryManager org.gumtree.data.Factory.getManager ( ) [static]

Return the singleton instance of the plug-ins factory manager

Returns:
IFactoryManager unique instance
static String org.gumtree.data.Factory.getMappingDictionaryFolder ( IFactory  factory) [static]

According to the given factory this method will return the path to reach the folder containing mapping dictionaries. This file associate entry keys to paths that are plug-in dependent.

Parameters:
factoryof the plug-in instance from which we want to load the dictionary
Returns:
the path to the plug-in's mapping dictionaries folder
static IDataset org.gumtree.data.Factory.openDataset ( URI  uri) throws Exception [static]

Create a CDMA Dataset that can read the given URI.

Parameters:
uriURI object
Returns:
CDMA Dataset
Exceptions:
Exception
static IDataset org.gumtree.data.Factory.openDataset ( URI  uri,
boolean  useDictionary 
) throws Exception [static]

Create a CDMA Dataset that can read the given URI and use optionally the Extended Dictionary mechanism.

Parameters:
uriURI object
useProduceronly
Returns:
CDMA Dataset
Exceptions:
Exception
static void org.gumtree.data.Factory.setActiveView ( String  experiment) [static]

Set the name of the current view (e.q experiment) that will be active for the Extended Dictionary mechanism.

Parameters:
experimentname
static void org.gumtree.data.Factory.setDictionariesFolder ( String  path) [static]

Set the folder path where to search for key dictionary files. This folder should contains all dictionaries that the above application needs.

Parameters:
pathtargeting a folder

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables