TC Java
2009 Version

gov.nih.nlm.nls.tc.Jdi
Class JournalDescriptors

java.lang.Object
  extended by gov.nih.nlm.nls.tc.Jdi.JournalDescriptors

public final class JournalDescriptors
extends java.lang.Object

This class is to load Journal Descriptors from a flat file.

History:

Version:
V-2009
Author:
NLM Lexical Systems Group
See Also:
Design Document

Field Summary
static int BY_DOCUMENT
           
static int BY_WORD
           
 
Constructor Summary
JournalDescriptors(java.lang.String inFile)
          Create the Journal Descriptors List object by specifying the input file.
JournalDescriptors(java.lang.String inFile, boolean verbose)
          Create the Journal Descriptors List object by specifying the input file and flag of verbose.
 
Method Summary
 int GetIndex(java.lang.String idName)
          Get JD index by specifying JD id or name.
 int GetIndexByJdid(java.lang.String jdid)
          Get JD index by specifying JD id.
 int GetIndexByName(java.lang.String name)
          Get JD index by specifying JD name.
 JournalDescriptor GetJdByIndex(int index)
          Get JD object by specifying JD index.
 JournalDescriptor GetJdByJdid(java.lang.String jdid)
          Get JD object by specifying JD id.
 JournalDescriptor GetJdByName(java.lang.String name)
          Get JD object by specifying JD name.
 java.lang.String GetJdidByIndex(int index)
          Get JD id by specifying JD index.
 java.lang.String GetJdidByName(java.lang.String name)
          Get JD id by specifying JD name.
 java.util.Hashtable<java.lang.Integer,JournalDescriptor> GetJdsByIndex()
          Get the collection object (in hashtable) of all JDs with key in index.
 java.util.Hashtable<java.lang.String,JournalDescriptor> GetJdsByJdid()
          Get the collection object (in hashtable) of all JDs with key in id.
 java.util.Hashtable<java.lang.String,JournalDescriptor> GetJdsByName()
          Get the collection object (in hashtable) of all JDs with key in name.
 java.lang.String GetNameByIndex(int index)
          Get JD name by specifying JD index.
 java.lang.String GetNameByJdid(java.lang.String jdid)
          Get JD name by specifying JD id.
 java.lang.String GetNormalizedNameByName(java.lang.String name)
          Get JD normalized name by specifying JD name.
 int GetSize()
          Get the total number of journal descriptor from the JD list.
 boolean IsLegalJdid(java.lang.String jdid)
          Check if legal JD ID
 boolean IsLegalJdName(java.lang.String name)
          Check if legal JD name
static void main(java.lang.String[] args)
           
 void ShowJds(java.io.BufferedWriter outWriter, boolean fileOutput)
          Show index, id, and name of all Journal descriptors.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BY_WORD

public static final int BY_WORD
See Also:
Constant Field Values

BY_DOCUMENT

public static final int BY_DOCUMENT
See Also:
Constant Field Values
Constructor Detail

JournalDescriptors

public JournalDescriptors(java.lang.String inFile)
Create the Journal Descriptors List object by specifying the input file.

Parameters:
inFile - file name of journal descriptor (jds.txt)

JournalDescriptors

public JournalDescriptors(java.lang.String inFile,
                          boolean verbose)
Create the Journal Descriptors List object by specifying the input file and flag of verbose.

Parameters:
inFile - file name of journal descriptor (jds.txt)
verbose - flag of verbose on reading input file
Method Detail

GetSize

public int GetSize()
Get the total number of journal descriptor from the JD list.

Returns:
total number of journal descriptor from the JD list

GetJdByJdid

public JournalDescriptor GetJdByJdid(java.lang.String jdid)
Get JD object by specifying JD id.

Parameters:
jdid - Jd id
Returns:
JD Java object

GetJdByIndex

public JournalDescriptor GetJdByIndex(int index)
Get JD object by specifying JD index.

Parameters:
index - Jd index
Returns:
JD Java object

GetJdByName

public JournalDescriptor GetJdByName(java.lang.String name)
Get JD object by specifying JD name.

Parameters:
name - Jd name
Returns:
JD Java Object

IsLegalJdid

public boolean IsLegalJdid(java.lang.String jdid)
Check if legal JD ID

Parameters:
jdid - Jd ID
Returns:
true for legal and false for illegal JD ID

IsLegalJdName

public boolean IsLegalJdName(java.lang.String name)
Check if legal JD name

Parameters:
name - Jd name
Returns:
true for legal and false for illegal JD name

GetJdidByIndex

public java.lang.String GetJdidByIndex(int index)
Get JD id by specifying JD index.

Parameters:
index - Jd index
Returns:
JD id, if not valid index, id = null

GetJdidByName

public java.lang.String GetJdidByName(java.lang.String name)
Get JD id by specifying JD name.

Parameters:
name - Jd name
Returns:
JD id, if not valid name, id = null

GetNameByJdid

public java.lang.String GetNameByJdid(java.lang.String jdid)
Get JD name by specifying JD id.

Parameters:
jdid - Jd id
Returns:
JD name, if not value id, name = null

GetNameByIndex

public java.lang.String GetNameByIndex(int index)
Get JD name by specifying JD index.

Parameters:
index - Jd index
Returns:
JD name, if not value index, name = null

GetIndexByJdid

public int GetIndexByJdid(java.lang.String jdid)
Get JD index by specifying JD id.

Parameters:
jdid - Jd id
Returns:
JD index, if not valid id, index = -1

GetIndexByName

public int GetIndexByName(java.lang.String name)
Get JD index by specifying JD name.

Parameters:
name - Jd name
Returns:
JD index, if not valid name, index = -1

GetIndex

public int GetIndex(java.lang.String idName)
Get JD index by specifying JD id or name.

Parameters:
idName - Jd name or Jd Id
Returns:
JD index

GetNormalizedNameByName

public java.lang.String GetNormalizedNameByName(java.lang.String name)
Get JD normalized name by specifying JD name. The normalized name is the lower case of JD name.

Parameters:
name - Jd name
Returns:
JD normalized name (lower case)

GetJdsByIndex

public java.util.Hashtable<java.lang.Integer,JournalDescriptor> GetJdsByIndex()
Get the collection object (in hashtable) of all JDs with key in index.

Returns:
a hashtable of all JDs with key in index

GetJdsByJdid

public java.util.Hashtable<java.lang.String,JournalDescriptor> GetJdsByJdid()
Get the collection object (in hashtable) of all JDs with key in id.

Returns:
a hashtable of all JDs with key in id

GetJdsByName

public java.util.Hashtable<java.lang.String,JournalDescriptor> GetJdsByName()
Get the collection object (in hashtable) of all JDs with key in name.

Returns:
a hashtable of all JDs with key in name

ShowJds

public void ShowJds(java.io.BufferedWriter outWriter,
                    boolean fileOutput)
Show index, id, and name of all Journal descriptors.

Parameters:
outWriter - outfile buffer
fileOutput - boolean flag for file output

main

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

TC Java
2009 Version

Submit a bug or feature

Copyright © 2009 National Library of Medicine