Lvg Java
2011 Version

gov.nih.nlm.nls.lvg.Lib
Class Category

java.lang.Object
  extended by gov.nih.nlm.nls.lvg.Lib.BitMaskBase
      extended by gov.nih.nlm.nls.lvg.Lib.Category

public class Category
extends BitMaskBase

This Category class extends BitMaskBase class and performs as LVG category.

History:

Version:
V-2011
Author:
NLM NLS Development Team
See Also:
Design document

Field Summary
static int ADJ_BIT
          Adjective bit for category
static int ADV_BIT
          Adverb bit for category
static long ALL_BIT_VALUE
           
static int AUX_BIT
          Auxiliary bit for category
static int COMPL_BIT
          Complementizer bit for category
static int CONJ_BIT
          Conjunction bit for category
static int DET_BIT
          Determiner bit for category
static int MODAL_BIT
          Modal bit for category
static long NO_BIT_VALUE
           
static int NOUN_BIT
          Noun bit for category
static int PREP_BIT
          Preposition bit for category
static int PRON_BIT
          Pronoun bit for category
static int TOTAL_BITS
          All bits for category
static int VERB_BIT
          Verb bit for category
 
Fields inherited from class gov.nih.nlm.nls.lvg.Lib.BitMaskBase
mask_, MAX_BIT
 
Constructor Summary
Category()
          Creates a default category object
Category(long value)
          Creates a default category object, using a long value
 
Method Summary
static long Enumerate(java.lang.String valueStr)
          Get the long value for one single name (no combine names of bits).
static java.lang.String GetBitName(int bitValue)
          Get the name (first in the name list) of a specified bit (single).
static java.lang.String GetBitName(int bitValue, int index)
          Get the name at index order of a specified bit (single).
static void main(java.lang.String[] args)
          Test driver for this class
static java.lang.String ToName(long value)
          Convert a long category value to a combined string (abbreviation).
static long ToValue(java.lang.String valueStr)
          Convert a combined value string to a long category value.
static java.util.Vector<java.lang.Long> ToValues(long value)
          Get a Vector includes all values from the combined value.
static long[] ToValuesArray(long value)
          Get an array includes all values from the combined value.
 
Methods inherited from class gov.nih.nlm.nls.lvg.Lib.BitMaskBase
Contains, Contains, Enumerate, GetBitFlag, GetBitIndex, GetBitName, GetBitValue, GetName, GetValue, SetBitFlag, SetValue, ToName, ToValue, ToValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ADJ_BIT

public static final int ADJ_BIT
Adjective bit for category

See Also:
Constant Field Values

ADV_BIT

public static final int ADV_BIT
Adverb bit for category

See Also:
Constant Field Values

AUX_BIT

public static final int AUX_BIT
Auxiliary bit for category

See Also:
Constant Field Values

COMPL_BIT

public static final int COMPL_BIT
Complementizer bit for category

See Also:
Constant Field Values

CONJ_BIT

public static final int CONJ_BIT
Conjunction bit for category

See Also:
Constant Field Values

DET_BIT

public static final int DET_BIT
Determiner bit for category

See Also:
Constant Field Values

MODAL_BIT

public static final int MODAL_BIT
Modal bit for category

See Also:
Constant Field Values

NOUN_BIT

public static final int NOUN_BIT
Noun bit for category

See Also:
Constant Field Values

PREP_BIT

public static final int PREP_BIT
Preposition bit for category

See Also:
Constant Field Values

PRON_BIT

public static final int PRON_BIT
Pronoun bit for category

See Also:
Constant Field Values

VERB_BIT

public static final int VERB_BIT
Verb bit for category

See Also:
Constant Field Values

TOTAL_BITS

public static final int TOTAL_BITS
All bits for category

See Also:
Constant Field Values

ALL_BIT_VALUE

public static final long ALL_BIT_VALUE
See Also:
Constant Field Values

NO_BIT_VALUE

public static final long NO_BIT_VALUE
See Also:
Constant Field Values
Constructor Detail

Category

public Category()
Creates a default category object


Category

public Category(long value)
Creates a default category object, using a long value

Method Detail

ToValue

public static long ToValue(java.lang.String valueStr)
Convert a combined value string to a long category value.

Parameters:
valueStr - combined name in String format
Returns:
a long value of the specified name

ToName

public static java.lang.String ToName(long value)
Convert a long category value to a combined string (abbreviation).

Parameters:
value - number for finding it's combined name
Returns:
name in a String format

GetBitName

public static java.lang.String GetBitName(int bitValue)
Get the name (first in the name list) of a specified bit (single). The first one in LVG is the abbreviation name.

Parameters:
bitValue - bit nubmer for finding it's name
Returns:
name of the bit specified

GetBitName

public static java.lang.String GetBitName(int bitValue,
                                          int index)
Get the name at index order of a specified bit (single).

Parameters:
bitValue - bit nubmer for finding it's name
index - the order index of the name in bitStr_[]
Returns:
name at index order of the bit specified

Enumerate

public static long Enumerate(java.lang.String valueStr)
Get the long value for one single name (no combine names of bits).

Parameters:
valueStr - name of a bit for finding it's long value
Returns:
a long value of the specified name

ToValues

public static java.util.Vector<java.lang.Long> ToValues(long value)
Get a Vector includes all values from the combined value. For examples, a value of 129 will return a vector contains two elements (Long) with value of 1 and 128.

Parameters:
value - combined value
Returns:
Vector - all values from the combined value

ToValuesArray

public static long[] ToValuesArray(long value)
Get an array includes all values from the combined value. For example, a value of 129 will return an array contains two elements (long) with value of 1 and 128.

Parameters:
value - combined value
Returns:
an array includes all values from the combined value

main

public static void main(java.lang.String[] args)
Test driver for this class


Lvg Java
2011 Version

Submit a bug or feature

Copyright © 2011 National Library of Medicine