Class FlkMap

java.lang.Object
  extended by FlkMap

public class FlkMap
extends java.lang.Object

FlkMap contains methods to maintain the DB/FlkMapDB.txt database used by Flicker. The file is a tab-delimited file with the following 5 fields: MenuName, CickableURL, ImageURL, BaseURL, DatabaseName

 The map is used to build menus of images to load
 a map entry contains the following fields:
 1. MenuName: is the menu image name: e.g.,
   "Expasy Plasma (3-7)"
 2. CickableURL: is the clickable map URL added to the BaseURL: e.g.,
   "http://www.expasy.org/cgi-bin/map3/big/PLASMA_HUMAN?"
 3. ImageURL: is the Image URL added to the BaseURL: e.g.
   "http://www.expasy.org/ch2dgifs/PLASMA_HUMAN/PLASMA_HUMAN_id.gif"
 4. BaseURL: of the database web site URL: e.g.,
   "www.expasy.org"
 5. DatabaseName: is the Web database name (used to create a sub-menu):
   "Swiss-2DPAGE"

 The database file DB/FlkMapDB.txt contains data Fields:
        MenuName, ClickableURL, ImageURL, BaseURL, DatabaseName
 E.g. of a data entry:
        Human Liver
        cgi-bin/map3/big/LIVER_HUMAN?
        ch2dgifs/LIVER_HUMAN/LIVER_HUMAN_id
        http://www.expasy.org/
        SWISS-2DPROT

This work was produced by Peter Lemkin of the National Cancer Institute, an agency of the United States Government. As a work of the United States Government there is no associated copyright. It is offered as open source software under the Mozilla Public License (version 1.1) subject to the limitations noted in the accompanying LEGAL file. This notice must be included with the code. The Flicker Mozilla and Legal files are available on http://open2dprot.sourceforge.net/Flicker

Version:
$Date$ $Revision$
Author:
P. Lemkin (LECB/NCI), G. Thornwall (SAIC), Frederick, MD
See Also:
Flicker Home

Field Summary
(package private)  java.lang.String baseURL
          file field BaseURL: of the database web site URL: e.g., "http://www.expasy.org/"
(package private)  java.lang.String clickableURL
          file field ClickableURL: is the clickable map URL added to the BaseURL: e.g., "cgi-bin/map3/big/PLASMA_HUMAN?"
(package private)  java.lang.String databaseName
          file field DatabaseName: is the Web database name (used to create a sub-menu): "Swiss-2DPAGE"
private static Flicker flk
          Instance of Flicker
static java.lang.String flkMapDBfile
          name of the database file
static FlkMap[] flkMaps
          FlkMap database [0:nMaps]
(package private)  java.lang.String imageURL
          file field ImageURL: is the Image URL added to the BaseURL: e.g.
static int MAX_DATABASES
          Maximum number of Web clickable databases
static int MAX_MAPS
          Max # of clickable image maps on the Web
(package private)  java.lang.String menuName
          file field MenuName: is the menu image name: e.g., "Expasy Plasma (3-7)"
static int nMaps
           
 
Constructor Summary
FlkMap(Flicker flkS)
          FlkMap() - constructor for Class FlkMap
FlkMap(java.lang.String menuName, java.lang.String clickableURL, java.lang.String imageURL, java.lang.String baseURL, java.lang.String databaseName)
          FlkMap() - constructor to add a new FlkMap entry NOTE: to do add of an entry, use 'new FlkMap()' method
 
Method Summary
(package private) static void clear()
          clear() - clear database flkMaps[0:nMaps-1].
(package private)  boolean delete()
          delete() - rmv entry from database flkMaps[0:nMaps-1].
(package private) static int lookup(FlkMap fm)
          lookup() - lookup entry to database flkMaps[0:nMaps-1].
(package private) static int lookupByMenuName(java.lang.String menuName)
          lookupByMenuName() - lookup entry by menu name in flkMaps[0:nMaps-1].
(package private) static boolean read()
          read() - read database from DB/FlkMapDB.txt file to flkMaps[0:nMaps-1].
(package private)  boolean set(java.lang.String menuName, java.lang.String clickableURL, java.lang.String imageURL, java.lang.String baseURL, java.lang.String databaseName)
          set() - set entry to database flkMaps[0:nMaps-1].
(package private) static boolean write()
          write() - write database in memory to DB/FlkMapDB.txt database file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

flk

private static Flicker flk
Instance of Flicker


MAX_MAPS

public static final int MAX_MAPS
Max # of clickable image maps on the Web

See Also:
Constant Field Values

MAX_DATABASES

public static final int MAX_DATABASES
Maximum number of Web clickable databases

See Also:
Constant Field Values

flkMaps

public static FlkMap[] flkMaps
FlkMap database [0:nMaps]


nMaps

public static int nMaps

flkMapDBfile

public static java.lang.String flkMapDBfile
name of the database file


menuName

java.lang.String menuName
file field MenuName: is the menu image name: e.g., "Expasy Plasma (3-7)"


clickableURL

java.lang.String clickableURL
file field ClickableURL: is the clickable map URL added to the BaseURL: e.g., "cgi-bin/map3/big/PLASMA_HUMAN?"


imageURL

java.lang.String imageURL
file field ImageURL: is the Image URL added to the BaseURL: e.g. "ch2dgifs/PLASMA_HUMAN/PLASMA_HUMAN_id.gif"


baseURL

java.lang.String baseURL
file field BaseURL: of the database web site URL: e.g., "http://www.expasy.org/"


databaseName

java.lang.String databaseName
file field DatabaseName: is the Web database name (used to create a sub-menu): "Swiss-2DPAGE"

Constructor Detail

FlkMap

public FlkMap(Flicker flkS)
FlkMap() - constructor for Class FlkMap

Parameters:
flk - instance of Flicker

FlkMap

public FlkMap(java.lang.String menuName,
              java.lang.String clickableURL,
              java.lang.String imageURL,
              java.lang.String baseURL,
              java.lang.String databaseName)
FlkMap() - constructor to add a new FlkMap entry NOTE: to do add of an entry, use 'new FlkMap()' method

Parameters:
MenuName -
ClickableURL -
ImageURL -
BaseURL -
DatabaseName -
Method Detail

read

static boolean read()
read() - read database from DB/FlkMapDB.txt file to flkMaps[0:nMaps-1].

Returns:
true if succeed

write

static boolean write()
write() - write database in memory to DB/FlkMapDB.txt database file.

Returns:
true if succeed

lookup

static int lookup(FlkMap fm)
lookup() - lookup entry to database flkMaps[0:nMaps-1].

Parameters:
fm - is the instance to lookup
Returns:
index of flkMaps[] if succeed, else -1

lookupByMenuName

static int lookupByMenuName(java.lang.String menuName)
lookupByMenuName() - lookup entry by menu name in flkMaps[0:nMaps-1].

Parameters:
menuName - is the menu name of the instance to lookup
Returns:
index of flkMaps[] if succeed, else -1

set

boolean set(java.lang.String menuName,
            java.lang.String clickableURL,
            java.lang.String imageURL,
            java.lang.String baseURL,
            java.lang.String databaseName)
set() - set entry to database flkMaps[0:nMaps-1]. NOTE: to do add of an entry, use 'new FlkMap()' method

Returns:
true if succeed

delete

boolean delete()
delete() - rmv entry from database flkMaps[0:nMaps-1].

Returns:
true if succeed

clear

static void clear()
clear() - clear database flkMaps[0:nMaps-1].