uk.ac.leeds.ccg.andyt.projects.genesis.society.demography
Class GENESIS_AgeBound

java.lang.Object
  extended by uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.common.AgeBound
      extended by uk.ac.leeds.ccg.andyt.projects.genesis.society.demography.GENESIS_AgeBound
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable

public final class GENESIS_AgeBound
extends uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.common.AgeBound
implements java.lang.Comparable, java.io.Serializable

A class for age limits. The ageMin and ageMax are stored as relative times. If ageMax is null then the age limit is open ended in that any age older than ageMin belongs to the bound. The ageMax is used in an exclusive bound, while ageMin is used as an inclusive bound. Such bounding allows ageMax to be stored more neatly in the expected general usage. It also allows time to be extended to store sub second values in a potential future refactoring without perhaps so many major changes being required.

See Also:
Serialized Form

Field Summary
protected  uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.common.Time ageMaxBound
          For storing the maximum outer bound of an age.
protected  uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.common.Time ageMinBound
          For storing the minimum outer bound of an age.
 
Fields inherited from class uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.common.AgeBound
ageMax, ageMin
 
Constructor Summary
GENESIS_AgeBound()
           
GENESIS_AgeBound(uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.common.AgeBound aAgeBound)
           
GENESIS_AgeBound(uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.common.AgeBound aAgeBound, GENESIS_Environment _GENESIS_Environment)
           
GENESIS_AgeBound(GENESIS_AgeBound aGENESIS_AgeBound)
           
GENESIS_AgeBound(java.lang.Long ageInYears)
          ageInYears is an age in years.
GENESIS_AgeBound(java.lang.Long ageInYearsMin, java.lang.Long ageInYearsMax)
          this.ageMin = new GENESIS_Time(CommonFactory.newTime(ageInYearsMin)); this.ageMax = new GENESIS_Time(CommonFactory.newTime(ageInYearsMax + 1L));
 
Method Summary
 int compareTo(java.lang.Object o)
          Two GENESIS_AgeBounds are equivalent if all their fields are.
 boolean equals(java.lang.Object o)
          Overrides equals in Object.
 uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.common.Time getAgeMaxBound()
           
 uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.common.Time getAgeMinBound()
           
static GENESIS_AgeBound getContainingAgeBound(GENESIS_AgeBound ageBound, java.util.TreeMap<GENESIS_AgeBound,?> map)
          Returns a copy of the broader GENESIS_AgeBound into which ageBound fits.
 int hashCode()
           
 void setAgeMaxBound(uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.common.Time ageMaxBound)
           
 void setAgeMinBound(uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.common.Time ageMinBound)
           
 java.lang.String toString()
           
 
Methods inherited from class uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.common.AgeBound
getAgeMax, getAgeMin, setAgeMax, setAgeMin
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ageMinBound

protected uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.common.Time ageMinBound
For storing the minimum outer bound of an age. For example, suppose an age is in the range 0 to 5 years old: furthermore, suppose that initially the age is assigned an individual year of age group from 1 to 2 years old, then ageMinBound is for storing the minimum outer bound for the age i.e. 0.


ageMaxBound

protected uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.common.Time ageMaxBound
For storing the maximum outer bound of an age. For example, suppose an age is in the range 0 to 5 years old: furthermore, suppose that initially the age is assigned an individual year of age group from 1 to 2 years old, then ageMaxBound is for storing the maximum outer bound for the age i.e. 5.

Constructor Detail

GENESIS_AgeBound

public GENESIS_AgeBound()

GENESIS_AgeBound

public GENESIS_AgeBound(GENESIS_AgeBound aGENESIS_AgeBound)

GENESIS_AgeBound

public GENESIS_AgeBound(uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.common.AgeBound aAgeBound)

GENESIS_AgeBound

public GENESIS_AgeBound(uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.common.AgeBound aAgeBound,
                        GENESIS_Environment _GENESIS_Environment)

GENESIS_AgeBound

public GENESIS_AgeBound(java.lang.Long ageInYears)
ageInYears is an age in years. this.ageMin = new GENESIS_Time(CommonFactory.newTime(ageInYears)); this.ageMax = new GENESIS_Time(CommonFactory.newTime(ageInYears + 1));

Parameters:
ageInYears -

GENESIS_AgeBound

public GENESIS_AgeBound(java.lang.Long ageInYearsMin,
                        java.lang.Long ageInYearsMax)
this.ageMin = new GENESIS_Time(CommonFactory.newTime(ageInYearsMin)); this.ageMax = new GENESIS_Time(CommonFactory.newTime(ageInYearsMax + 1L));

Parameters:
ageInYearsMin -
ageInYearsMax -
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getAgeMinBound

public uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.common.Time getAgeMinBound()

setAgeMinBound

public void setAgeMinBound(uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.common.Time ageMinBound)

getAgeMaxBound

public uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.common.Time getAgeMaxBound()

setAgeMaxBound

public void setAgeMaxBound(uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.common.Time ageMaxBound)

getContainingAgeBound

public static GENESIS_AgeBound getContainingAgeBound(GENESIS_AgeBound ageBound,
                                                     java.util.TreeMap<GENESIS_AgeBound,?> map)
Returns a copy of the broader GENESIS_AgeBound into which ageBound fits. Th method assumes (map is non-empty and) that ageBound will fit within an GENESIS_AgeBound in map.

Parameters:
ageBound -
map -
Returns:

compareTo

public int compareTo(java.lang.Object o)
Two GENESIS_AgeBounds are equivalent if all their fields are. Order is based primarily on ageMin. If this ageMin is higher than that of o then the result is 1. If ageMin are the same, then the order is based on ageMax. If ageMax are the same, the order is based on ageMinBound. If ageMinBound are still the same, the order is based on ageMaxBound. If ageMaxBound are the same the result is 0.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o -
Returns:

equals

public boolean equals(java.lang.Object o)
Overrides equals in Object. Two GENESIS_AgeBounds are equal if both ageMin and ageMax are the same.

Overrides:
equals in class java.lang.Object
Parameters:
o -
Returns:

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object