-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathage_constraint.go
50 lines (40 loc) · 1.51 KB
/
age_constraint.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package gedcom
// AgeConstraint is used to describe if the individual was living during the
// calculated age.
//
// See the AgeConstraint constants for more information.
type AgeConstraint int
const (
// The constraint is not known. This is the case if none of the other
// options can be determined to be true.
AgeConstraintUnknown AgeConstraint = iota
// The age represents a time before the known birth. This would be
// represented as a negative age.
AgeConstraintBeforeBirth
// The age represents the number of years since the known birth of the
// individual. Even if the age is an approximation or a wide range it can
// still be considered as fully or partly within their lifetime.
AgeConstraintLiving
// The age is after the known death of the individual. Like the "before
// birth" constraint it can be sometimes useful to know the age of the
// individual if they were still living or subtract their death age to see
// how many years after their death the event may have occurred.
//
// You can use IndividualNode.Age() to fetch the maximum living age of a now
// deceased individual.
AgeConstraintAfterDeath
)
// Strings returns a human-readable form of the constant, like "After Death".
func (ac AgeConstraint) String() string {
switch ac {
case AgeConstraintUnknown:
// Do nothing, fall through to the final return.
case AgeConstraintBeforeBirth:
return "Before Birth"
case AgeConstraintLiving:
return "Living"
case AgeConstraintAfterDeath:
return "After Death"
}
return "Unknown"
}