Lvg Java
2011 Version

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

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

public class Gender
extends BitMaskBase

This Gender class extends BitMaskBase class and performs as LVG gender.

History:

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

Field Summary
static long ALL_BIT_VALUE
          all bits for gender
static int FEMALE_BIT
          female bit for gender
static int MALE_BIT
          male bit for gender
static int NEUTER_BIT
          neuter bit for gender
static int NOT_KNOWABLE_BIT
          unknown gender bit for gender
 
Fields inherited from class gov.nih.nlm.nls.lvg.Lib.BitMaskBase
mask_, MAX_BIT
 
Constructor Summary
Gender()
          Creates a default gender object
Gender(long value)
          Creates a default gender object, using a integer 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 gender value to a combined string (abbreviation).
static long ToValue(java.lang.String valueStr)
          Convert a combined value string to a long gender 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

MALE_BIT

public static final int MALE_BIT
male bit for gender

See Also:
Constant Field Values

FEMALE_BIT

public static final int FEMALE_BIT
female bit for gender

See Also:
Constant Field Values

NEUTER_BIT

public static final int NEUTER_BIT
neuter bit for gender

See Also:
Constant Field Values

NOT_KNOWABLE_BIT

public static final int NOT_KNOWABLE_BIT
unknown gender bit for gender

See Also:
Constant Field Values

ALL_BIT_VALUE

public static final long ALL_BIT_VALUE
all bits for gender

See Also:
Constant Field Values
Constructor Detail

Gender

public Gender()
Creates a default gender object


Gender

public Gender(long value)
Creates a default gender object, using a integer value

Method Detail

ToValue

public static long ToValue(java.lang.String valueStr)
Convert a combined value string to a long gender 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 gender 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

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