|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--pop.model.Statics
Key static constants and methods used by many objects. Note: just one may exist at any time (a "singleton").
Field Summary | |
static int |
FEMALE
Identifies a female cohort. |
static int |
MALE
Identifies a male cohort. |
Constructor Summary | |
Statics()
Unavailable. |
|
Statics(Constants c)
Construct a Statics with a Constants object. |
|
Statics(int maximum_age,
int categories,
java.lang.String[] category_names,
int years,
int base_year,
java.lang.String model_title)
Basic constructor. |
Method Summary | |
static int |
base_year()
Returns base year of this model. |
static int |
categories()
Returns number of population categories in this model. |
static java.lang.String |
category_name(int number)
Returns copy of the indicated category name. |
static java.lang.String[] |
category_names()
Returns copy of whole array of population category names. |
static int |
category(java.lang.String category_name)
Returns category number of indicated category. |
Constants |
constants()
Returns a new Constants object with current model's maximum_age(), categories(), category_names(), years(), and base_year(). |
void |
destroy()
Only way to destroy an old model prior to creating a new one. |
void |
increment()
Increments current year of model. |
static int |
maximum_age()
Returns maximum age of cohorts in this model. |
static java.lang.String |
model_title()
Returns the model's title precondition: a Statics object is instantiated. |
void |
reset()
Resets the current year to base year; model to be rerun. |
void |
set_labels(Constants c)
Resets the labels (model title, base year, category names). |
static boolean |
valid_age(int age)
True if age is in valid range (0 to maximum age). |
static boolean |
valid_category(int number)
True if category number is in valid range (0 to number of categories - 1). |
static boolean |
valid_category(java.lang.String name)
True if category name is one of the valid names. |
static boolean |
valid_matrix(double[][] x)
True if the dimensions of the 2-dimensional array exactly match the model's parameters (i.e., full 2 by 1+maximum_age()). |
static boolean |
valid_matrix(int[][] x)
True if the dimensions of the 2-dimensional array exactly match the model's parameters (i.e., full 2 by 1+maximum_age()). |
static boolean |
valid_sex_constant(int sex)
True if sex is one of the valid constants. |
static int |
year()
Returns current year of the model. |
static int |
years()
Returns number of years the model is to be run. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int FEMALE
public static final int MALE
Constructor Detail |
public Statics(int maximum_age, int categories, java.lang.String[] category_names, int years, int base_year, java.lang.String model_title)
maximum_age
- - age corresponding to oldest cohorts
(e.g., 100 if final age segment is "100+").
The maximum age is immutable after construction,
and is considered identical for all Populations.categories
- - number of population categories.cagegory_names
- - strings to identify each category;
MUST be of length categories.years
- - number of years to execute model.base_year
- - year corresponding to base population.model_title
- - a title for display.public Statics(Constants c)
public Statics()
Method Detail |
public void increment()
public void reset()
public void destroy()
public void set_labels(Constants c)
public static int maximum_age()
public static int categories()
public static java.lang.String category_name(int number)
number
- - category number, in the range of
0 to categories()-1.public static java.lang.String[] category_names()
public static int category(java.lang.String category_name)
category_name
- - one of the valid strings.public static int years()
public static int base_year()
public static int year()
public static java.lang.String model_title()
public Constants constants()
public static boolean valid_age(int age)
public static boolean valid_category(int number)
public static boolean valid_category(java.lang.String name)
public static boolean valid_sex_constant(int sex)
public static boolean valid_matrix(int[][] x)
public static boolean valid_matrix(double[][] x)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |