net.methodyne.bellvue.core
Class Finder

java.lang.Object
  extended bynet.methodyne.bellvue.core.Finder
All Implemented Interfaces:
java.io.Serializable

public class Finder
extends java.lang.Object
implements java.io.Serializable

The Finder is the interface to query the datastore.
It needs the name of the bclass to search in.
Querys can be added for each field of the queried bclass with the put method.
This interface is used by the Bellvue GUI as well so the syntax of the query fields is the same as described in the user
guide in the section about searching/querying.

Version:
1.0
Date: 19.02.2003
Time: 16:10:01
copyright Methodyne GmbH, Zug - Switzerland.
Author:
Yuri
See Also:
Serialized Form

Field Summary
 java.lang.String classname
          name of the Bclass with package
 boolean f_l
          used by GUI
 long id
           
 int index
          used by GUI
 java.util.Vector olist
          the Vector holding the matching objects
 java.util.HashMap querys
          here the "fieldname : query" get collected
 boolean t_o
          used by GUI
 java.lang.String title
           
 
Constructor Summary
Finder(java.lang.String classname)
           
 
Method Summary
 void actionExportReslut(Sdata sd)
          GUI Function to export the search result to a file
 java.lang.String getTitle()
          Shows a reasonable title to the user in the GUI
 void put(java.lang.String name, java.lang.String value)
          Adds querys
 java.util.Vector run(Sdata sd)
          Perform a query against the datastore
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

public long id

title

public java.lang.String title

classname

public java.lang.String classname
name of the Bclass with package


olist

public java.util.Vector olist
the Vector holding the matching objects


index

public int index
used by GUI


t_o

public boolean t_o
used by GUI


f_l

public boolean f_l
used by GUI


querys

public java.util.HashMap querys
here the "fieldname : query" get collected

Constructor Detail

Finder

public Finder(java.lang.String classname)
Parameters:
classname - of the Bclass to query
Method Detail

run

public java.util.Vector run(Sdata sd)
Perform a query against the datastore

Parameters:
sd - the session data
Returns:
A Vector holding the matching objects or null

put

public void put(java.lang.String name,
                java.lang.String value)
Adds querys

Parameters:
name - The name of a field from the searched Bclass
value - The query for example ">2000", "100 to 200", "true", "!Smith.*"
To logically join querys with "and", "or", "xor" do this:
Finder finder = new Finder("com.demo.User");
 finder.put("username", "John");
 finder.put("qry_username", "and"); // lowercase for "and", "or", "xor"
 finder.put("age", ">21");
 finder.run(sd); // the session dataset
 
This matches all objects where username is John AND the age is over 21.

getTitle

public java.lang.String getTitle()
Shows a reasonable title to the user in the GUI

Returns:
a String with the name of the Bclass and the number of matching objects

actionExportReslut

public void actionExportReslut(Sdata sd)
GUI Function to export the search result to a file

Parameters:
sd -


Copyright © 2003 Methodyne GmbH, Zug Switzerland. All Rights Reserved.