Elexis: Das führende OpenSource-Arztpraxisprogamm
im deutschsprachigen Raum
Java doc für Elexis version 2.1.7.dev vom 01.09.2013

ch.unibe.iam.scg.archie.model
Class Cohort

java.lang.Object
  extended by ch.unibe.iam.scg.archie.model.Cohort
All Implemented Interfaces:
java.lang.Comparable<Cohort>

public class Cohort
extends java.lang.Object
implements java.lang.Comparable<Cohort>

A Cohort represents a certain age-group (e.g. all patients with ages from 10 to 20). lowerBound must always be smaller than upperBound

$Id$


Field Summary
static java.lang.String TITLE_DELIMITER
          Delimiter used for the title of a cohort.
 
Constructor Summary
Cohort(int lowerBound, int upperBound, java.lang.Object value)
          Public constructor.
 
Method Summary
 int compareTo(Cohort otherCohort)
          A Cohort is smaller than another if its lower bound is smaller.
 boolean equals(java.lang.Object object)
          Checks if another cohort is equal to this one.
 int getCohortSize()
          Returns the cohort size.
 int getLowerBound()
          Returns a cohort's lower bound.
 int getUpperBound()
          Returns a cohort's upper bound.
 java.lang.Object getValue()
          Returns a cohort's value.
 int hashCode()
          Returns the hash code for this cohort.
 void setLowerBound(int lowerBound)
          Sets a cohort's lower bound.
 void setUpperBound(int upperBound)
          Sets a cohort's upper bound.
 void setValue(java.lang.Object value)
          Sets a cohort's value.
 java.lang.String toString()
          To string representation of a cohort.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TITLE_DELIMITER

public static final java.lang.String TITLE_DELIMITER
Delimiter used for the title of a cohort.

See Also:
Constant Field Values
Constructor Detail

Cohort

public Cohort(int lowerBound,
              int upperBound,
              java.lang.Object value)
Public constructor.

Parameters:
lowerBound - Lower bound of a cohort.
upperBound - Upper bound of a cohort.
value - Value of the age group (cohort).
Method Detail

getCohortSize

public int getCohortSize()
Returns the cohort size. The size is always 1 larger than the real difference, since a cohort includes both the lower and upper Bound.

Returns:
Returns the cohort size.

setLowerBound

public void setLowerBound(int lowerBound)
Sets a cohort's lower bound.

Parameters:
lowerBound - the lowerBound to set

getLowerBound

public int getLowerBound()
Returns a cohort's lower bound.

Returns:
The lower bound of a cohort.

setUpperBound

public void setUpperBound(int upperBound)
Sets a cohort's upper bound.

Parameters:
upperBound - Upperbound value.

getUpperBound

public int getUpperBound()
Returns a cohort's upper bound.

Returns:
A cohort's upper bound.

setValue

public void setValue(java.lang.Object value)
Sets a cohort's value.

Parameters:
value - The cohort's value.

getValue

public java.lang.Object getValue()
Returns a cohort's value.

Returns:
Returns a cohort's value.

toString

public java.lang.String toString()
To string representation of a cohort. The lower and upper bound are connected by the TITLE_DELIMITER of the Cohort class.

Overrides:
toString in class java.lang.Object
Returns:
Title of this cohort (made up of lower- and upper bound).

compareTo

public int compareTo(Cohort otherCohort)
A Cohort is smaller than another if its lower bound is smaller. If the lower bound of two cohorts is equal, the cohort with the smaller cohort size is smaller.

Specified by:
compareTo in interface java.lang.Comparable<Cohort>
Parameters:
otherCohort -
Returns:
-1 if this cohort is smaller, 0 if equal, 1 is larger
See Also:
Comparable.compareTo(java.lang.Object)

equals

public boolean equals(java.lang.Object object)
Checks if another cohort is equal to this one.

Overrides:
equals in class java.lang.Object
Parameters:
object - An object.
Returns:
True if this given object is a cohort and is equal (same lower- and upperBound), false else.

hashCode

public int hashCode()
Returns the hash code for this cohort. The hash code is composed out of the name of a cohort.

Overrides:
hashCode in class java.lang.Object
Returns:
HashCode of the name of this Cohort.

Elexis: Das führende OpenSource-Arztpraxisprogamm
im deutschsprachigen Raum
Java doc für Elexis version 2.1.7.dev vom 01.09.2013