pop.model
Class Constants

java.lang.Object
  |
  +--pop.model.Constants

public class Constants
extends java.lang.Object
implements java.io.Serializable

A way to encapsulate the model's constants, especially for writing and reading as a whole.

See Also:
Serialized Form

Constructor Summary
Constants(Constants c)
          Construct a copy of the Constants object.
Constants(int maximum_age, int categories, java.lang.String[] category_names, int years, int base_year, java.lang.String model_title)
          Basic constructor.
 
Method Summary
 int base_year()
          Base year of the model (for display).
 int categories()
          Number of population categories.
 java.lang.String category_name(int number)
          Returns copy of the indicated category name.
 java.lang.String[] category_names()
          Category names.
 int maximum_age()
          Maximum cohort age.
 java.lang.String model_title()
          Title of the model (for display).
 boolean valid_category(int number)
          True if category number is in valid range (0 to number of categories - 1).
 int years()
          Number of years to run the model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Constants

public Constants(int maximum_age,
                 int categories,
                 java.lang.String[] category_names,
                 int years,
                 int base_year,
                 java.lang.String model_title)
Basic constructor.
Parameters:
maximum_age - - age corresponding to oldest cohorts (e.g., 100 if final age segment is "100+").
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.

Constants

public Constants(Constants c)
Construct a copy of the Constants object.
Method Detail

maximum_age

public int maximum_age()
Maximum cohort age.

categories

public int categories()
Number of population categories.

category_names

public java.lang.String[] category_names()
Category names. This is the order in which data and results will be tabulated, and the order in which file data are expected.

category_name

public java.lang.String category_name(int number)
Returns copy of the indicated category name.
Parameters:
number - - category number, in the range of 0 to categories()-1.

years

public int years()
Number of years to run the model.

base_year

public int base_year()
Base year of the model (for display). Considered year 0; a.k.a., initial year.

model_title

public java.lang.String model_title()
Title of the model (for display).

valid_category

public boolean valid_category(int number)
True if category number is in valid range (0 to number of categories - 1). precondition: a Statics object is instantiated.