uk.ac.ebi.adfconverter.tools.checker
Class Cardinality

java.lang.Object
  extended byuk.ac.ebi.adfconverter.tools.checker.Cardinality

public class Cardinality
extends java.lang.Object

Class for checking item or field cardinality in a table. It define the number of possible occurences for an object (item or field)

Version:
1 28 July 2004
Author:
Pierre MARGUERITE

Constructor Summary
Cardinality(java.lang.String name, int lowerBound)
          Constructor of a cardinality Object with a given lower bound
Cardinality(java.lang.String name, int lowerBound, int upperBound)
          Constructor of a cardinality Object with a given lower bound
 
Method Summary
 boolean availableElement()
          Infocates if an element can still be add
 int getAvailableNumber()
          Retrieves the number of still available element
 int getElementNumber()
          Retrieves the number of already found element
 int getlowerBound()
          Retrieves the lower bound
 java.lang.String getName()
          Retrieves the name of the element
 int getupperBound()
          Retrieves the upper bound
 void init()
          init the cardinality.
 boolean minimumAchieve()
          indicates if the minimal number of the element has been achieved
 void newElement()
          To count when a new element has been bound and update for still available elements
 java.lang.String toString()
          Represents the cardinality as String
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Cardinality

public Cardinality(java.lang.String name,
                   int lowerBound)
Constructor of a cardinality Object with a given lower bound

Parameters:
name - the name of the element with the given cardinality
lowerBound - a specified lowerboud for cardinality

Cardinality

public Cardinality(java.lang.String name,
                   int lowerBound,
                   int upperBound)
Constructor of a cardinality Object with a given lower bound

Parameters:
name - the name of the element with the given cardinality
lowerBound - a specified lowerbound for cardinality
upperBound - a specified upperbound for cardinality
Method Detail

availableElement

public boolean availableElement()
Infocates if an element can still be add

Returns:
true if an element can be added. false otherwise

getAvailableNumber

public int getAvailableNumber()
Retrieves the number of still available element

Returns:
availble element numbers

getElementNumber

public int getElementNumber()
Retrieves the number of already found element

Returns:
the cardinality upper bound

getlowerBound

public int getlowerBound()
Retrieves the lower bound

Returns:
the cardinality lower bound

getName

public java.lang.String getName()
Retrieves the name of the element

Returns:
the name of the element

getupperBound

public int getupperBound()
Retrieves the upper bound

Returns:
the cardinality upper bound

init

public void init()
init the cardinality. Set the element numbers and available elementnumbers to the initial value: elementNumber to lowerBound; availableElementNumber to upperBound;


minimumAchieve

public boolean minimumAchieve()
indicates if the minimal number of the element has been achieved

Returns:
true if enough elements have been found. False otherwise

newElement

public void newElement()
To count when a new element has been bound and update for still available elements


toString

public java.lang.String toString()
Represents the cardinality as String

Returns:
the string representing the current cardinality


European Bioinformatics InstituteMicroarray Informatics Team