jmathlib.core.functions
Class FunctionPathBroker

java.lang.Object
  extended by jmathlib.core.functions.FunctionPathBroker

public class FunctionPathBroker
extends java.lang.Object

Using a base directory, uses a consistent search to find a function by its name


Field Summary
private  java.io.File baseDir
           
private  java.util.ArrayList paths
           
private  boolean traverseChildren
           
 
Constructor Summary
FunctionPathBroker(java.io.File _baseDir, boolean _traverseChildren)
           
 
Method Summary
private  void addSearchPath(java.io.File path)
          build up the list of directories to search for functions
private  java.io.File findClassOrMFile(java.io.File path, java.lang.String functionName)
          Searchs a directory for the specified class
 java.io.File findFunction(java.lang.String functionName)
           
 java.io.File getBaseDirectory()
           
 java.io.File getPath(int index)
           
 int getPathCount()
           
private  void populateSearchPaths()
           
 void setBaseDirectory(java.io.File dir)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

baseDir

private java.io.File baseDir

paths

private java.util.ArrayList paths

traverseChildren

private boolean traverseChildren
Constructor Detail

FunctionPathBroker

public FunctionPathBroker(java.io.File _baseDir,
                          boolean _traverseChildren)
Method Detail

populateSearchPaths

private void populateSearchPaths()

getBaseDirectory

public java.io.File getBaseDirectory()

setBaseDirectory

public void setBaseDirectory(java.io.File dir)

findFunction

public java.io.File findFunction(java.lang.String functionName)

findClassOrMFile

private java.io.File findClassOrMFile(java.io.File path,
                                      java.lang.String functionName)
Searchs a directory for the specified class

Parameters:
path - - the directory to search
functionName - - the function to search for
Returns:
a File object representing the full path to the file that matches the fileName

addSearchPath

private void addSearchPath(java.io.File path)
build up the list of directories to search for functions


getPathCount

public int getPathCount()
Returns:

getPath

public java.io.File getPath(int index)
Parameters:
index -
Returns:

FOOTER

BOTTOM