ch.claudio.jars
Class ModelHash

java.lang.Object
  extended by ch.claudio.jars.ModelHash
All Implemented Interfaces:
Model

public class ModelHash
extends java.lang.Object
implements Model

Universal jar finder application

Version:
$Id: Model.java 264 2008-05-11 20:39:18Z claudio $

Copyright (C) 2006-2008 Claudio Nieder <private@claudio.ch>, CH-8610 Uster

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

Author:
Claudio Nieder

Constructor Summary
ModelHash()
          Load data from files.
 
Method Summary
 void addFromDirs(Status status, java.io.File... startDirs)
          Search a list of directories recursively to find jar files and store the information found in the database.
 void close()
          Give the model a chance to close the database if this is needed.
 int getClassCount()
          Return the number of stored classes.
 int getJarCount()
          Return the number of stored jars.
static void main(java.lang.String[] args)
           
 ClassInfo[] search(java.lang.String name)
          Search database for a jar containing the searched class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModelHash

public ModelHash()
Load data from files.

Method Detail

addFromDirs

public void addFromDirs(Status status,
                        java.io.File... startDirs)
Description copied from interface: Model
Search a list of directories recursively to find jar files and store the information found in the database.

Specified by:
addFromDirs in interface Model
Parameters:
status - status object into which the current state is reported.
startDirs - List of directories to search
See Also:
Model.addFromDirs(Status, java.io.File...)

close

public void close()
Description copied from interface: Model
Give the model a chance to close the database if this is needed.

Specified by:
close in interface Model
See Also:
Model.close()

getClassCount

public int getClassCount()
Description copied from interface: Model
Return the number of stored classes.

Specified by:
getClassCount in interface Model
Returns:
count
See Also:
Model.getClassCount()

getJarCount

public int getJarCount()
Description copied from interface: Model
Return the number of stored jars.

Specified by:
getJarCount in interface Model
Returns:
count
See Also:
Model.getJarCount()

search

public ClassInfo[] search(java.lang.String name)
Description copied from interface: Model
Search database for a jar containing the searched class.

Specified by:
search in interface Model
Parameters:
name - Either a plain class name or a qualified name. If the class is not qualified by a package name several classes might be returned.
Returns:
list of found classes
See Also:
Model.search(java.lang.String)

main

public static void main(java.lang.String[] args)
Parameters:
args -