Parkinson Disease Database

spirals.motol.database
Class Engine

java.lang.Object
  extended by spirals.motol.database.Engine

public class Engine
extends java.lang.Object

Class with static and useful utilities used across application.

Copyright: Copyright (c) 2005 Jan Dolezel

Company: ČVUT FEL, Prague


Nested Class Summary
static class Engine.AbcComparator
          czech lexicographical comparator of two strings Sorting of characters with ¨ above should be performed otherwise.
 
Field Summary
private static int begin
           
(package private) static java.util.Comparator bornComparator
          comparator of two pacients by born date
private  Configuration config
          confihuration
private  Database database
          database
private static int end
           
private static Engine instance
           
private  MainFrame mf
          main frame
(package private) static java.util.Comparator nameComparator
          comparator of two pacients by name
private static java.text.SimpleDateFormat sdf
          date formater: DD.
private  Tablet tablet
          active tablet
(package private) static java.util.Comparator visitComparator
          comparator of two pacients by last visit
 
Constructor Summary
private Engine(MainFrame frame, Configuration conf)
          starts application with main frame and configuration Load database, then tries to open tablet.
 
Method Summary
 Configuration getConfiguration()
          return application configuration
 Database getDatabase()
          return database
static Engine getInstance()
          vrátí již vytvořeného jedináčka
static Engine getInstance(MainFrame frame, Configuration conf)
          Vrátí jedináčka s danými parametry
 MainFrame getMainFrame()
          return main frame
static java.util.Date getSimpleDate(java.lang.String date)
          converts string to date (DD.
static java.text.DateFormat getSimpleDateFormat()
          return date formatter (DD.
 Tablet getTablet()
          return active tablet
static java.lang.String hash(java.lang.String str)
          hashes string to 8 characters Reminds first pass of md5.
 boolean selectTablet(TabletInfo ti)
          set tablet as active tablet (if tablet is among available tablets)
 void setRestricted(boolean restricted)
          set database to view all or only choosen pacients
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

private static Engine instance

mf

private MainFrame mf
main frame


tablet

private Tablet tablet
active tablet


database

private Database database
database


config

private Configuration config
confihuration


sdf

private static final java.text.SimpleDateFormat sdf
date formater: DD. MM. YYYY


begin

private static final int begin
See Also:
Constant Field Values

end

private static final int end
See Also:
Constant Field Values

nameComparator

static final java.util.Comparator nameComparator
comparator of two pacients by name


bornComparator

static final java.util.Comparator bornComparator
comparator of two pacients by born date


visitComparator

static final java.util.Comparator visitComparator
comparator of two pacients by last visit

Constructor Detail

Engine

private Engine(MainFrame frame,
               Configuration conf)
starts application with main frame and configuration

Load database, then tries to open tablet.

Method Detail

getInstance

public static Engine getInstance()
vrátí již vytvořeného jedináčka

Returns:
Engine

getInstance

public static Engine getInstance(MainFrame frame,
                                 Configuration conf)
Vrátí jedináčka s danými parametry

Parameters:
frame - MainFrame
conf - Configuration
Returns:
Engine

getMainFrame

public MainFrame getMainFrame()
return main frame


getTablet

public Tablet getTablet()
return active tablet


getDatabase

public Database getDatabase()
return database


setRestricted

public void setRestricted(boolean restricted)
set database to view all or only choosen pacients


getConfiguration

public Configuration getConfiguration()
return application configuration


selectTablet

public boolean selectTablet(TabletInfo ti)
set tablet as active tablet (if tablet is among available tablets)


hash

public static final java.lang.String hash(java.lang.String str)
hashes string to 8 characters

Reminds first pass of md5.


getSimpleDate

public static final java.util.Date getSimpleDate(java.lang.String date)
converts string to date (DD. MM. YYYY)

Parameters:
date - String
Returns:
Date

getSimpleDateFormat

public static final java.text.DateFormat getSimpleDateFormat()
return date formatter (DD. MM. YYYY)


Parkinson Disease Database