Elexis API documentation
Version 2.1.6 as of December 11 2011

ch.elexis.util
Interface IGenderService

All Known Implementing Classes:
GenderService, MarlovitsFirstname

public interface IGenderService

Contract for embedding a gender service


Field Summary
static java.lang.String dbFemaleString
           
static java.lang.String dbMaleString
           
static int FEMALE
           
static java.lang.String FEMALE_STR
           
static java.lang.String FIRSTNAME_SEXES_STR
           
static int GENDERUNDEFINED
           
static java.lang.String GENDERUNDEFINED_STR
           
static int MALE
           
static java.lang.String MALE_STR
           
static int UNISEX
           
static java.lang.String UNISEX_STR
           
 
Method Summary
 java.lang.Boolean addFirstname(java.lang.String firstname, java.lang.String sex)
          Adds a first name to the table.
 java.lang.Boolean addFirstname(java.lang.String firstname, java.lang.String sex, boolean userRecord)
          Adds a first name to the table.
 int getGender(java.lang.String firstName)
          Return the gender of the first name for param firstname.
 int getGender(java.lang.String firstname, boolean userRecord)
          Return the gender of the first name for param firstname. if userRecord is true then we look for the firstname in the user records only.
 java.lang.String getGenderString(java.lang.String firstName)
          Return the gender of the first name for param firstname.
 java.lang.String getGenderString(java.lang.String firstname, boolean userRecord)
          Return the gender of the first name for param firstname. if userRecord is true then we look for the firstname in the user records only.
 

Field Detail

MALE

static final int MALE
See Also:
Constant Field Values

FEMALE

static final int FEMALE
See Also:
Constant Field Values

UNISEX

static final int UNISEX
See Also:
Constant Field Values

GENDERUNDEFINED

static final int GENDERUNDEFINED
See Also:
Constant Field Values

MALE_STR

static final java.lang.String MALE_STR
See Also:
Constant Field Values

FEMALE_STR

static final java.lang.String FEMALE_STR
See Also:
Constant Field Values

UNISEX_STR

static final java.lang.String UNISEX_STR
See Also:
Constant Field Values

GENDERUNDEFINED_STR

static final java.lang.String GENDERUNDEFINED_STR
See Also:
Constant Field Values

FIRSTNAME_SEXES_STR

static final java.lang.String FIRSTNAME_SEXES_STR
See Also:
Constant Field Values

dbMaleString

static final java.lang.String dbMaleString
See Also:
Constant Field Values

dbFemaleString

static final java.lang.String dbFemaleString
See Also:
Constant Field Values
Method Detail

getGender

int getGender(java.lang.String firstName)
Return the gender of the first name for param firstname. First we look for the firstname in the user records. If there are no user records for firstname then we try to find the fitting record inside the imported records.

Parameters:
firstname - = first name
Returns:
int: 1=male, 2=female, 3=both genders, 0=not filled in or not found

getGender

int getGender(java.lang.String firstname,
              boolean userRecord)
Return the gender of the first name for param firstname. if userRecord is true then we look for the firstname in the user records only. If userRecord is false, then we try to find the fitting record inside the imported records.

Parameters:
firstname - first name
userRecord - boolean, true if we should look for a user record, else we look for an imported record
Returns:
int: 1=male, 2=female, 3=both genders, 0=not filled in or not found

getGenderString

java.lang.String getGenderString(java.lang.String firstName)
Return the gender of the first name for param firstname. First we look for the firstname in the user records. If there are no user records for firstname then we try to find the fitting record inside the imported records.

Parameters:
firstname - = first name
Returns:
String: "m"=male, "w"=female, "b"=both genders, ""=not filled in or not found

getGenderString

java.lang.String getGenderString(java.lang.String firstname,
                                 boolean userRecord)
Return the gender of the first name for param firstname. if userRecord is true then we look for the firstname in the user records only. If userRecord is false, then we try to find the fitting record inside the imported records.

Parameters:
firstname - = first name
userRecord - boolean, true if we should look for a user record, else we look for an imported record
Returns:
String: "m"=male, "w"=female, "b"=both genders, ""=not filled in or not found

addFirstname

java.lang.Boolean addFirstname(java.lang.String firstname,
                               java.lang.String sex)
Adds a first name to the table. Only "m", "w", "b" are allowed, all others are ignored/not added. the names are all saved in lowercase. No duplicates are created. If you add a firstname with a gender in opposite to one that is already saved in the db, then the gender is set to "b" for "both genders".

Parameters:
firstname - = first name
sex - = gender, String, "m", "w", "b" (both male AND female), all others are not added to the db
Returns:
true if the name is added or changed, false if not

addFirstname

java.lang.Boolean addFirstname(java.lang.String firstname,
                               java.lang.String sex,
                               boolean userRecord)
Adds a first name to the table. Only "m", "w", "b" are allowed, all others are ignored/not added. the names are all saved in lowercase. No duplicates are created. If you add a firstname with a gender in opposite to one that is already saved in the db, then the gender is set to "b" for "both genders".

Parameters:
firstname - first name
sex - gender, String, "m", "w", "b" (both male AND female), all others are not added to the db
userRecord - true if add to user records (alphanumeric id's), false if add to imported records (numeric id's)
Returns:
true if the name is added or changed, false if not

Elexis API documentation
Version 2.1.6 as of December 11 2011

Copyright 2005-2011 by Gerry Weirich, Elexis