com.springrts.ai.oo
Class Roots

java.lang.Object
  extended by com.springrts.ai.oo.Roots
All Implemented Interfaces:
Comparable<Roots>

public class Roots
extends Object
implements Comparable<Roots>


Method Summary
 String allocatePath(String relPath, boolean writeable, boolean create, boolean dir)
           
 int compareTo(Roots other)
           
 boolean equals(Object otherObject)
           
 boolean getDir(String path, int path_sizeMax, int dirIndex)
          Returns the data dir at dirIndex, which is valid between 0 and (DataDirs_Roots_getSize() - 1).
 int getSize()
          Returns the number of springs data dirs.
 int hashCode()
           
 boolean locatePath(String path, int path_sizeMax, String relPath, boolean writeable, boolean create, boolean dir)
          Returns an absolute path which consists of: data-dir + relative-path.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

compareTo

public int compareTo(Roots other)
Specified by:
compareTo in interface Comparable<Roots>

equals

public boolean equals(Object otherObject)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

getSize

public int getSize()
Returns the number of springs data dirs.


getDir

public boolean getDir(String path,
                      int path_sizeMax,
                      int dirIndex)
Returns the data dir at dirIndex, which is valid between 0 and (DataDirs_Roots_getSize() - 1).


locatePath

public boolean locatePath(String path,
                          int path_sizeMax,
                          String relPath,
                          boolean writeable,
                          boolean create,
                          boolean dir)
Returns an absolute path which consists of: data-dir + relative-path. example: input: "AI/Skirmish", writeable, create, dir output: "/home/userX/.spring/AI/Skirmish/" The path "/home/userX/.spring/AI/Skirmish/" is created, if it does not yet exist.

Parameters:
path - store for the resulting absolute path
path_sizeMax - storage size of the above
relPath - the relative path to find
writeable - if true, only the writeable data-dir is considered
create - if true, and realPath is not found, its dir structure is created recursively under the writeable data-dir
dir - if true, realPath specifies a dir, which means if create is true, the whole path will be created, including the last part
Returns:
whether the locating process was successfull -> the path exists and is stored in an absolute form in path
See Also:
DataDirs_locatePath

allocatePath

public String allocatePath(String relPath,
                           boolean writeable,
                           boolean create,
                           boolean dir)