org.molwind.chemical.io
Class SDFileLocator

java.lang.Object
  extended by org.molwind.io.AbstractWorldLocator
      extended by org.molwind.chemical.io.SDFileLocator
All Implemented Interfaces:
BasePathSupport, WorldLocator, Configurable

public class SDFileLocator
extends AbstractWorldLocator
implements BasePathSupport

SDFileLocator implements a locator to find worlds based on SDF chemical file format.

Version:
1.0
Author:
Oliver Karch

Field Summary
static java.lang.String DEFAULT_ID_ATTRIBUTE
          The default name of the attribute denoting the id.
static java.lang.String DEFAULT_PARENT_ATTRIBUTE
          The default name of the attribute denoting the parent.
static java.lang.String DEFAULT_PATH_SEPARATOR
          The default value for seperating a path
static java.lang.String[] DEFAULT_SDF_SUFFIX
          The default file extensions recognized by this locator.
static java.lang.String pathNames
          The relativ adress for looking up the worlds
 
Constructor Summary
SDFileLocator()
          Creates an SDFilelocator instance.
 
Method Summary
 void addBasePath(java.lang.String path)
          Adds a path to the base paths
 java.lang.String getIdAttributeName()
          Get the idAttributeName value.
 java.lang.String getParentAttributeName()
          Get the parentAttributeName value.
 java.lang.String getPathNames()
          Get the worldpaths
 java.lang.String[] getWorldNames()
           
 MolwindWorld locateByFileName(java.lang.String fileName)
          Locates the world by the given name by iteraring all world names
 MolwindWorld locateWorld(java.lang.String worldName)
          Locates a world with the given name.
 void removeBasePath(java.lang.String path)
          Removes the given path from the base paths
 void setIdAttributeName(java.lang.String newIdAttributeName)
          Set the idAttributeName value.
 void setParentAttributeName(java.lang.String newParentAttributeName)
          Set the ParentAttributeName value.
 void setPathNames(java.lang.String paths)
          Set the pathNames
 
Methods inherited from class org.molwind.io.AbstractWorldLocator
configure
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pathNames

public static java.lang.String pathNames
The relativ adress for looking up the worlds


DEFAULT_SDF_SUFFIX

public static final java.lang.String[] DEFAULT_SDF_SUFFIX
The default file extensions recognized by this locator.


DEFAULT_PARENT_ATTRIBUTE

public static final java.lang.String DEFAULT_PARENT_ATTRIBUTE
The default name of the attribute denoting the parent.

See Also:
Constant Field Values

DEFAULT_ID_ATTRIBUTE

public static final java.lang.String DEFAULT_ID_ATTRIBUTE
The default name of the attribute denoting the id.

See Also:
Constant Field Values

DEFAULT_PATH_SEPARATOR

public static final java.lang.String DEFAULT_PATH_SEPARATOR
The default value for seperating a path

See Also:
Constant Field Values
Constructor Detail

SDFileLocator

public SDFileLocator()
Creates an SDFilelocator instance.

Method Detail

addBasePath

public void addBasePath(java.lang.String path)
Adds a path to the base paths

Specified by:
addBasePath in interface BasePathSupport
Parameters:
path - the path to be add

removeBasePath

public void removeBasePath(java.lang.String path)
Removes the given path from the base paths

Specified by:
removeBasePath in interface BasePathSupport
Parameters:
path - the path to be removed

locateByFileName

public MolwindWorld locateByFileName(java.lang.String fileName)
                              throws java.io.IOException
Locates the world by the given name by iteraring all world names

Parameters:
the - filename
Returns:
a molwind world descriptor
Throws:
java.io.IOException - is thrown upon i/o error

locateWorld

public MolwindWorld locateWorld(java.lang.String worldName)
                         throws java.io.IOException
Locates a world with the given name.

Specified by:
locateWorld in interface WorldLocator
Specified by:
locateWorld in class AbstractWorldLocator
Parameters:
worldName - the name of the world
Returns:
a molwind world descriptor
Throws:
java.io.IOException - is thrown upon i/o error

getWorldNames

public java.lang.String[] getWorldNames()
Specified by:
getWorldNames in interface WorldLocator
Specified by:
getWorldNames in class AbstractWorldLocator
Returns:
returns an array of available worlds

getParentAttributeName

public java.lang.String getParentAttributeName()
Get the parentAttributeName value.

Returns:
the parentAttributeName value

setParentAttributeName

public void setParentAttributeName(java.lang.String newParentAttributeName)
Set the ParentAttributeName value.

Parameters:
newParentAttributeName - the new ParentAttributeName value

getIdAttributeName

public java.lang.String getIdAttributeName()
Get the idAttributeName value.

Returns:
the idAttributeName value

setIdAttributeName

public void setIdAttributeName(java.lang.String newIdAttributeName)
Set the idAttributeName value.

Parameters:
newIdAttributeName - the new idAttributeName value

setPathNames

public void setPathNames(java.lang.String paths)
Set the pathNames

Parameters:
paths - the new pathNames value

getPathNames

public java.lang.String getPathNames()
Get the worldpaths

Returns:
worldpaths


Copyright © 2008-2010. All Rights Reserved.