public class Individual extends Person implements java.io.Serializable, Locatable, java.lang.Comparable
Family
s and participate in them via Marriage
s.
In the Kinship system, societies are composed only of Families and Individuals.Modifier and Type | Field and Description |
---|---|
Family |
birthFamily
The Family containing this Individual's biological mother/father pair.
|
java.util.ArrayList<Link> |
links |
java.util.ArrayList<java.lang.Object> |
marriages
A list of all Families created by former & current marriages (& child births).
|
int |
serialNmbr
A unique, system-assigned ID for this individual.
|
static java.util.ArrayList<java.lang.String> |
specialItems |
java.util.ArrayList<java.lang.Object> |
starLinks
A TreeMap of all non-genealogical relationships for this Individual, i.e.
|
int |
tempTreeLevel
A unique, system-assigned ID for this individual.
|
java.util.TreeMap |
userDefinedProperties
A TreeMap of all the User-Defined Properties (aka *properties) for this Individual.
|
Constructor and Description |
---|
Individual()
Constructor with 0 arguments: for use ONLY by Serialization.
|
Individual(Context context,
java.lang.String sex)
Constructor with w/ context & sex.
|
Individual(Context context,
java.lang.String sex,
Family marriage)
Constructor with w/ context, sex, & marriage.
|
Individual(Context context,
java.lang.String name,
java.lang.String sex,
Family birthFam)
Constructor with w/ context, name, sex, & birthFamily.
|
Individual(Kind gend,
java.awt.Point loc)
Constructor with w/ sex & location.
|
Individual(java.lang.String root)
Constructor with w/ a single string == "root".
|
Individual(java.lang.String name,
java.lang.String sex)
Constructor with w/ name & sex.
|
Individual(java.lang.String name,
java.lang.String sex,
Family marriage)
Constructor with w/ name, sex, & marriage-family.
|
Individual(java.lang.String name,
java.lang.String sex,
Family ofOrigin,
java.lang.String birthdate)
Constructor with w/ name, sex, birth-family & birth date.
|
Individual(java.lang.String name,
java.lang.String sex,
java.lang.String birthdate)
Constructor with w/ name, sex, & birthdate.
|
Modifier and Type | Method and Description |
---|---|
void |
addMarriage(Family newfam)
Append
newfam to the 'marriages' field for this Individual. |
void |
addNote(java.lang.String not)
Append the String
not to the 'comment' field for this Individual. |
void |
adjustLimitsToMathVarConstraints(float[] limits,
MathVariable mathVar,
java.util.ArrayList<java.lang.Object> unEqLst)
Analyze the constraints on this mathVar and determine the correct limits on its value.
|
void |
assureContainedBy(Argument arg,
java.util.ArrayList<java.lang.Object> reqElements,
java.util.ArrayList<java.lang.Object> constraintSet,
java.lang.String starPropName,
java.util.ArrayList<java.lang.Object> starBindings,
java.util.TreeMap bindings,
java.lang.Class requiredClass,
ConstraintObj constraints,
ClauseBody cb)
Assure that all members of
constraintSet include in their values, without duplication,
all of the reqElements. |
void |
assureContains(MathVariable mathVarOrig,
java.util.ArrayList<java.lang.Object> superSet,
java.util.ArrayList<java.lang.Object> constraintSet,
java.lang.String starPropName,
java.util.ArrayList<java.lang.Object> starBindings,
java.util.TreeMap bindings,
java.lang.Class requiredClass,
ConstraintObj constraints,
ClauseBody cb)
Assure that all elements of
constraintSet are included in
superSet without duplication. |
boolean |
checkProposedVal(java.lang.Boolean boolObj,
Argument arg)
Check the constraints on mathVar that makes sense for a Boolean
to see if this Boolean is a conforming value.
|
boolean |
checkProposedVal(java.lang.Class clazz,
java.lang.Object obj,
Argument arg,
java.util.TreeMap bindings,
java.util.ArrayList<java.lang.Object> starBindings,
ConstraintObj constraints)
This method merely dispatches calls to the other, type-specific, forms of
this method.
|
boolean |
checkProposedVal(java.lang.Float floatObj,
Argument arg)
Check all the constraints on MathVariable arg to see if this float is a conforming value.
|
boolean |
checkProposedVal(Individual indObj,
Argument arg,
java.util.TreeMap bindings,
java.util.ArrayList<java.lang.Object> starBindings,
ConstraintObj constraints)
Check both constraints on mathVar that makes sense for an Individual
to see if this Individual is a conforming value.
|
boolean |
checkProposedVal(java.lang.Integer intObj,
Argument arg)
Check all the constraints on MathVariable arg to see if this integer is a conforming value.
|
boolean |
checkProposedVal(java.lang.String stringObj,
Argument arg)
Check all the constraints on MathVariable arg to see if this String is a
conforming value.
|
int |
compareTo(java.lang.Object other) |
void |
delete()
Delete this Individual.
|
void |
exportGEDCOM(java.io.PrintWriter out,
boolean realData,
java.lang.String includeAux,
java.util.ArrayList<java.lang.Object> nonTerms,
java.lang.String adoptNote)
Write out one Individual record in GEDCOM 5.5 format.
|
ParserGEDCOM.GEDCOMitem |
findBirthFamInGEDCOM() |
boolean |
findConformingValue(java.lang.String starPropName,
Argument arg,
java.util.ArrayList<java.lang.Object> starBindings,
java.util.TreeMap bindings,
ConstraintObj constraints,
java.lang.String queryOrCommit,
ClauseBody cb)
By "find a conforming value" we mean choose or accept a value of the correct type (or from among the permissible values)
which does not violate any of the constraints contained on the
Argument or duplicate a (failed) priorValue. |
java.util.ArrayList<ParserGEDCOM.GEDCOMitem> |
findMarriagesInGEDCOM() |
java.util.ArrayList<java.lang.Object> |
generateCandidateValues(java.lang.Class requiredClass,
Argument arg,
java.util.TreeMap bindings,
java.util.ArrayList<java.lang.Object> starBindings,
ConstraintObj constraints,
UserDefinedProperty udp)
Generate a list of potential values of the designated type (class).
|
java.lang.String |
getBirthDD() |
java.lang.String |
getBirthMM() |
java.lang.String |
getBirthYr() |
java.lang.String |
getDateOfBirth() |
java.lang.String |
getDateOfDeath() |
java.lang.String |
getDeathDD() |
java.lang.String |
getDeathMM() |
java.lang.String |
getDeathYr() |
int |
getGEDCOMSerial(java.lang.String ref) |
java.lang.String |
getHomeChart() |
int |
getSerialNmbr() |
java.lang.String |
getYYYYMMOfBirth() |
boolean |
hasChildren() |
boolean |
hasDoB() |
boolean |
hasDoD() |
boolean |
hasNoDoB() |
boolean |
hasNoDoD() |
java.util.TreeMap |
makeNewUDPTreeMap(java.util.TreeMap ctxtUDPTreeMap)
A 'shorthand' version of
makeNewUDPTreeMap with useDefaults = true |
java.util.TreeMap |
makeNewUDPTreeMap(java.util.TreeMap ctxtUDPTreeMap,
boolean useDefaults)
Make a new TreeMap to serve as the userDefinedProperties (UDP) TreeMap for a newly-created
Individual.
|
int |
marriageWith(Individual partner)
Return serial# of Family for marriage of this Individual with
partner , or -1 if none found. |
boolean |
meetsConstraintsStrictly(Variable personVar,
ConstraintObj constraints,
java.util.TreeMap bindings,
java.util.ArrayList<java.lang.Object> starBindings)
Assure that this person meets all the constraints found on the
ConstraintObj 'constraints'. |
Individual |
oppSexKin() |
void |
setBirthDD(java.lang.String day) |
void |
setBirthMM(java.lang.String month) |
void |
setDateOfBirth(java.lang.String dob) |
void |
setDateOfDeath(java.lang.String dod) |
void |
setDeathDD(java.lang.String day) |
void |
setDeathMM(java.lang.String month) |
java.lang.String |
toSILKString()
This method builds a string that represents an Individual in a SILKin data (_.silk) file.
|
java.lang.String |
toString()
Create a String with summary information about this Individual.
|
void |
updateFrom(Individual newRec)
Update data for this Individual from later information.
|
void |
yoke(MathVariable mathVar,
Variable vari,
Constant konstant,
Argument personArg,
UserDefinedProperty udp,
java.lang.String bindingMade,
java.util.TreeMap bindings,
java.util.ArrayList<java.lang.Object> starBindings) |
addMarriage, bounds, delMarriage, delPerson, drawLabel, drawSymbol, drawSymbol, findPerson, getLocation, getLocationX, getLocationY, getMarriages, getParents, getSize, hasEnded, marryTo, personsToXML, personToXML, readXML, setLocation, setLocation, setLocationX, setLocationY, setMarriages, setParents, setSize
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
bounds, getLocation, getLocationX, getLocationY, setLocation, setLocation, setLocationX, setLocationY
public int serialNmbr
public int tempTreeLevel
public Family birthFamily
public java.util.ArrayList<java.lang.Object> marriages
public java.util.ArrayList<Link> links
public java.util.TreeMap userDefinedProperties
public java.util.ArrayList<java.lang.Object> starLinks
public static java.util.ArrayList<java.lang.String> specialItems
public Individual(java.lang.String name, java.lang.String sex, Family ofOrigin, java.lang.String birthdate)
name
- String to go in the FullName fieldsex
- 'M' or 'F' or '?' (neuter: doesn't matter or don't know)ofOrigin
- Family where this Individual is a child.birthdate
- Example: 'Jan 1, 1970'public Individual(java.lang.String name, java.lang.String sex, java.lang.String birthdate)
name
- String to go in the FullName fieldsex
- 'M' or 'F' or '?' (neuter: doesn't matter or don't know)birthdate
- Example: 'Jan 1, 1970'public Individual(Kind gend, java.awt.Point loc)
gend
- one of the 2 basic kinds: Male and Femaleloc
- A point with x- and y-coordinatespublic Individual(java.lang.String name, java.lang.String sex)
name
- String to go in the FullName fieldsex
- 'M' or 'F' or '?' (neuter: doesn't matter or don't know)public Individual(java.lang.String root)
root
- String which must = "root"public Individual(Context context, java.lang.String sex)
context
- Specific context in which this person must be created.sex
- 'M' or 'F' or '?' (neuter: doesn't matter or don't know)public Individual(Context context, java.lang.String sex, Family marriage)
context
- Specific context in which this person must be created.sex
- 'M' or 'F' or '?' (neuter: doesn't matter or don't know)marriage
- Family where this Individual is a spouse.public Individual(Context context, java.lang.String name, java.lang.String sex, Family birthFam)
context
- Specific context in which this person must be created.name
- String to go in the FullName fieldsex
- 'M' or 'F' or '?' (neuter: doesn't matter or don't know)birthFam
- Family where this Individual is a child.public Individual(java.lang.String name, java.lang.String sex, Family marriage)
name
- String to go in the FullName fieldsex
- 'M' or 'F' or '?' (neuter: doesn't matter or don't know)marriage
- Family where this Individual is a parent.public Individual()
public int getSerialNmbr()
getSerialNmbr
in interface Locatable
public java.lang.String getHomeChart()
getHomeChart
in interface Locatable
public int compareTo(java.lang.Object other) throws java.lang.ClassCastException
compareTo
in interface java.lang.Comparable
java.lang.ClassCastException
public java.lang.String getBirthMM()
public java.lang.String getBirthDD()
public java.lang.String getBirthYr()
public java.lang.String getDeathMM()
public java.lang.String getDeathDD()
public java.lang.String getDeathYr()
public java.lang.String getDateOfBirth()
public java.lang.String getYYYYMMOfBirth()
public java.lang.String getDateOfDeath()
public void setDateOfBirth(java.lang.String dob)
public void setBirthMM(java.lang.String month)
public void setBirthDD(java.lang.String day)
public void setDateOfDeath(java.lang.String dod)
public void setDeathMM(java.lang.String month)
public void setDeathDD(java.lang.String day)
public boolean hasDoB()
public boolean hasNoDoB()
public boolean hasDoD()
public boolean hasNoDoD()
public boolean hasChildren()
public void updateFrom(Individual newRec)
newRec
- an individual with later data.public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toSILKString() throws KSDateParseException
KSDateParseException
public void exportGEDCOM(java.io.PrintWriter out, boolean realData, java.lang.String includeAux, java.util.ArrayList<java.lang.Object> nonTerms, java.lang.String adoptNote)
Record will contain:
The purpose of a GEDCOM export is to display a chart of Example Individuals who illustrate the kinship terms from a particular domain theory. Therefore, the FullName field is filled with a list of all primary kinTerms and a list (in square brackets) of extended kinTerms that this Individual exemplifies.
out
- a PrintWriter to write to.realData
- true = this record is for a non-hypothetical personincludeAux
- "Include" = output auxiliariesnonTerms
- a list of predicates that are not kin termsadoptNote
- if non-null, a note about the adoptions recorded in the
original GEDCOM file.public void addNote(java.lang.String not)
not
to the 'comment' field for this Individual.not
- the String to be added.public java.util.ArrayList<ParserGEDCOM.GEDCOMitem> findMarriagesInGEDCOM()
public ParserGEDCOM.GEDCOMitem findBirthFamInGEDCOM()
public int getGEDCOMSerial(java.lang.String ref)
public void addMarriage(Family newfam)
newfam
to the 'marriages' field for this Individual.addMarriage
in class Person
newfam
- the marriage to be added.public void delete() throws KSInternalErrorException
KSInternalErrorException
public Individual oppSexKin()
public int marriageWith(Individual partner)
partner
, or -1 if none found.partner
- Individual alleged to be this person's spouse.public boolean findConformingValue(java.lang.String starPropName, Argument arg, java.util.ArrayList<java.lang.Object> starBindings, java.util.TreeMap bindings, ConstraintObj constraints, java.lang.String queryOrCommit, ClauseBody cb) throws KSBadHornClauseException, java.lang.ClassNotFoundException, KSConstraintInconsistency, KSInternalErrorException
Argument
or duplicate a (failed) priorValue.
For example, if a property takes a single int value, and a MathVariable has the constraint that its value must be lessThan {3, 6}
and also that its value must be greaterThan {0, 1} then only 2 is a "conforming value." If some other constraint prohibits 2, then
no conforming value will ever be possible and a KSBadHornClauseException is thrown (constraint conflict).
This is different from a situation where there are possible values, but candidate's value is not one of them
(candidate is not a good match).
If queryOrCommit
is "query" then we do not change any values on MathVariable or this Individual; we merely
return true if a conforming value is possible. If queryOrCommit
is "commit" then we make the changes.
starPropName
- the name of a user defined property (which must start with '*')arg
- the Argument whose constraints we must honor and whose value we may bindstarBindings
- the list (possibly empty) of bindings made to date. Add to it if we bind anything.queryOrCommit
- the string "query" or "commit" to signify whether we should change values or
just report on the feasibility of doing so.KSBadHornClauseException
- if the constraints on mathVar make it impossible for any value to be acceptedjava.lang.ClassNotFoundException
- if there are errors in the type information on a constraintKSConstraintInconsistency
KSInternalErrorException
public void yoke(MathVariable mathVar, Variable vari, Constant konstant, Argument personArg, UserDefinedProperty udp, java.lang.String bindingMade, java.util.TreeMap bindings, java.util.ArrayList<java.lang.Object> starBindings) throws KSInternalErrorException
KSInternalErrorException
public boolean checkProposedVal(java.lang.Class clazz, java.lang.Object obj, Argument arg, java.util.TreeMap bindings, java.util.ArrayList<java.lang.Object> starBindings, ConstraintObj constraints) throws KSConstraintInconsistency, KSInternalErrorException, java.lang.ClassNotFoundException
KSConstraintInconsistency
KSInternalErrorException
java.lang.ClassNotFoundException
public boolean checkProposedVal(java.lang.Integer intObj, Argument arg)
intObj
- the Integer object to be checked against these constraintsarg
- a MathVariable
containing constraints or a Constant
public boolean checkProposedVal(java.lang.Float floatObj, Argument arg)
floatObj
- the Float object to be checked against these constraintsarg
- a MathVariable
containing constraints or a Constant
public boolean checkProposedVal(java.lang.String stringObj, Argument arg)
stringObj
- the String object to be checked against these
constraintsarg
- a MathVariable
containing constraints or a
Constant
public boolean checkProposedVal(java.lang.Boolean boolObj, Argument arg)
boolObj
- the Boolean object to be checked against these constraintsarg
- a MathVariable
containing constraints or a Constant
public boolean checkProposedVal(Individual indObj, Argument arg, java.util.TreeMap bindings, java.util.ArrayList<java.lang.Object> starBindings, ConstraintObj constraints) throws KSConstraintInconsistency, KSInternalErrorException, java.lang.ClassNotFoundException
indObj
- the Individual object to be checked against these constraintsarg
- a MathVariable
containing constraints or a Variable
KSConstraintInconsistency
KSInternalErrorException
java.lang.ClassNotFoundException
public java.util.ArrayList<java.lang.Object> generateCandidateValues(java.lang.Class requiredClass, Argument arg, java.util.TreeMap bindings, java.util.ArrayList<java.lang.Object> starBindings, ConstraintObj constraints, UserDefinedProperty udp) throws KSBadHornClauseException, java.lang.ClassNotFoundException, KSConstraintInconsistency, KSInternalErrorException
requiredClass
- the designated type (class).KSBadHornClauseException
java.lang.ClassNotFoundException
KSConstraintInconsistency
KSInternalErrorException
public boolean meetsConstraintsStrictly(Variable personVar, ConstraintObj constraints, java.util.TreeMap bindings, java.util.ArrayList<java.lang.Object> starBindings) throws KSConstraintInconsistency, KSInternalErrorException, java.lang.ClassNotFoundException
ConstraintObj
'constraints'. By 'strictly'
we mean that if the constraint is 'dead', it is not sufficient for this person to have a null date of death;
they must have a specific date (we are sure they're dead).personVar
- the Variable name we are considering binding to this person.constraints
- the set of constraints this person must satisfy.bindings
- the list of variables that have already been bound, and their values.starBindings
- a cumulative list of all the values assigned to UDPsKSConstraintInconsistency
- if contradictory constraints are encountered.KSInternalErrorException
- if SILKin chokes on this data.java.lang.ClassNotFoundException
- if a class name is misspelled (should never happen).public void assureContains(MathVariable mathVarOrig, java.util.ArrayList<java.lang.Object> superSet, java.util.ArrayList<java.lang.Object> constraintSet, java.lang.String starPropName, java.util.ArrayList<java.lang.Object> starBindings, java.util.TreeMap bindings, java.lang.Class requiredClass, ConstraintObj constraints, ClauseBody cb) throws KSConstraintInconsistency, KSInternalErrorException, java.lang.ClassNotFoundException
constraintSet
are included in
superSet
without duplication. The elements of constraintSet
are either Variables (which bind to Individuals), MathVariables (which
bind to lists of property values), or Constants.mathVarOrig
- the Variable whose value is being setsuperSet
- the set which must contain all elements of
constraintSet's members' valuesconstraintSet
- the list of variables whose members' values are
required elementsstarPropName
- name of the UserDefinedProperty
(UDP)
involvedstarBindings
- a cumulative list of all the values assigned to UDPsbindings
- the list of variable bindings to daterequiredClass
- the mandatory type of any value for mathVarOrigconstraints
- all the constraints for this ClauseBodyKSConstraintInconsistency
- if there is a conflict between the
containment requirement and other constraints.KSInternalErrorException
java.lang.ClassNotFoundException
public void assureContainedBy(Argument arg, java.util.ArrayList<java.lang.Object> reqElements, java.util.ArrayList<java.lang.Object> constraintSet, java.lang.String starPropName, java.util.ArrayList<java.lang.Object> starBindings, java.util.TreeMap bindings, java.lang.Class requiredClass, ConstraintObj constraints, ClauseBody cb) throws KSConstraintInconsistency, KSInternalErrorException, java.lang.ClassNotFoundException
constraintSet
include in their values, without duplication,
all of the reqElements. The members of constraintSet are MathVariables.reqElements
- required elements that must be included in values of constraintSet membersconstraintSet
- the list of MathVariables whose values must contain the required elementsstarPropName
- name of the UserDefinedProperty
(UDP) involvedstarBindings
- a cumulative list of all the values assigned to UDPsbindings
- the list of variable bindings to daterequiredClass
- the mandatory type of any value for mathVarOrigconstraints
- all the constraints for this ClauseBodyKSConstraintInconsistency
- if there is a conflict beween the containment requirement and other constraints.KSInternalErrorException
java.lang.ClassNotFoundException
public void adjustLimitsToMathVarConstraints(float[] limits, MathVariable mathVar, java.util.ArrayList<java.lang.Object> unEqLst)
limits
- the starting lower & upper limits for this MathVar's legal valuemathVar
- the MathVar in questionunEqLst
- we generate a list of values that mathVar cannot equal, based on this analysis of
mathVar's notEqual list of other variables it cannot equal.public java.util.TreeMap makeNewUDPTreeMap(java.util.TreeMap ctxtUDPTreeMap, boolean useDefaults)
UserDefinedProperty
object
in the TreeMap we want to put a fresh (empty) ArrayListctxtUDPTreeMap
- the template TreeMap from the current ContextuseDefaults
- true = assign a default value, if one is defined.public java.util.TreeMap makeNewUDPTreeMap(java.util.TreeMap ctxtUDPTreeMap)
makeNewUDPTreeMap
with useDefaults = truectxtUDPTreeMap
- the template TreeMap from the current Context