Class GEDCOMLocater
java.lang.Object
|
+----GEDCOMLocater
- public class GEDCOMLocater
- extends Object
This class locates and picks out relevant lines from a file of GEDCOM code.
The lines are then passed on to the GEDCOMInterpreter class and
initialised person or family objects are returned to the user.
- Author:
- Vegard Brox
-
BIRTH
- GEDCOM code for birth
-
BURIAL
- GEDCOM code for burial
-
CFAMILY
- GEDCOM code for family where this person was child
-
CHILD
- GEDCOM code for child
-
CHRISTENING
- GEDCOM code for christening
-
DATE
- GEDCOM code for date
-
DEATH
- GEDCOM code for death
-
FAMILY
- GEDCOM code for family
-
HUSBAND
- GEDCOM code for husband
-
INDIVIDUAL
- GEDCOM code for individual
-
MARRIAGE
- GEDCOM code for marriage
-
SEX
- GEDCOM code for sex
-
SFAMILY
- GEDCOM code for family where this person was spouse
-
TRAILER
- GEDCOM code for trailer (end of file)
-
WIFE
- GEDCOM code for wife
-
GEDCOMLocater(File)
- Constructor that prepares for reading from the specified file.
-
getElementType(String)
- Finds the element type from a line of GEDCOM code.
-
nextFamily()
- Reads information for the next family in the GEDCOM file and returns it
as a family object.
-
nextPerson()
- Reads information for the next person in the GEDCOM file and returns it
as a person object.
INDIVIDUAL
public static final String INDIVIDUAL
- GEDCOM code for individual
FAMILY
public static final String FAMILY
- GEDCOM code for family
BIRTH
public static final String BIRTH
- GEDCOM code for birth
DEATH
public static final String DEATH
- GEDCOM code for death
CHRISTENING
public static final String CHRISTENING
- GEDCOM code for christening
BURIAL
public static final String BURIAL
- GEDCOM code for burial
SEX
public static final String SEX
- GEDCOM code for sex
DATE
public static final String DATE
- GEDCOM code for date
CFAMILY
public static final String CFAMILY
- GEDCOM code for family where this person was child
SFAMILY
public static final String SFAMILY
- GEDCOM code for family where this person was spouse
HUSBAND
public static final String HUSBAND
- GEDCOM code for husband
WIFE
public static final String WIFE
- GEDCOM code for wife
CHILD
public static final String CHILD
- GEDCOM code for child
MARRIAGE
public static final String MARRIAGE
- GEDCOM code for marriage
TRAILER
public static final String TRAILER
- GEDCOM code for trailer (end of file)
GEDCOMLocater
public GEDCOMLocater(File file) throws FileNotFoundException
- Constructor that prepares for reading from the specified file.
- Parameters:
- file - The GEDCOM file to read from
- Throws: FileNotFoundException
- If the specified file could not be found
nextPerson
public Person nextPerson()
- Reads information for the next person in the GEDCOM file and returns it
as a person object. If no more persons exist, null is returned.
- Returns:
- A person object for the next individual in the file
nextFamily
public Family nextFamily()
- Reads information for the next family in the GEDCOM file and returns it
as a family object. If no more families exist, null is returned.
- Returns:
- A family object for the next family in the file
getElementType
public static String getElementType(String line)
- Finds the element type from a line of GEDCOM code.
The element type is e.g. birth, death, wife, child.
- Parameters:
- line - The line of GEDCOM code
- Returns:
- The element type for this line, or an empty string
if no element type could be found