xdoclet.sdk.xgg.binding
Class Cardinality

java.lang.Object
  |
  +--xdoclet.sdk.xgg.binding.Cardinality

public class Cardinality
extends Object

Holder for the fine grained cardinality of a Child.

Version:
$Revision: 1.1 $
Author:
Laurent Etiemble

Field Summary
static int ONE
          Constant for ONE cardinality.
static int UNBOUNDED
          Constant for UNBOUNDED cardinality.
static int ZERO
          Constant for ZERO cardinality.
 
Constructor Summary
Cardinality(int min, int max)
          Constructor for the Cardinality object
 
Method Summary
 int getMax()
          Gets the maximum cardinality
 int getMin()
          Gets the minimum cardinality
 boolean isMany()
          Return whether or not the maximum cardinality is higher than ONE
 void normalize()
          Make sure the maximum cardinality is always greater or equal than the minimum cardinality
 void setMax(int max)
          Sets the maximum cardinality
 void setMin(int min)
          Sets the minimum cardinality
 String toString()
          Implementation of the toString method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ONE

public static final int ONE
Constant for ONE cardinality. Used for min and max cardinality.

See Also:
Constant Field Values

UNBOUNDED

public static final int UNBOUNDED
Constant for UNBOUNDED cardinality. Used for max cardinality.

See Also:
Constant Field Values

ZERO

public static final int ZERO
Constant for ZERO cardinality. Used for min cardinality.

See Also:
Constant Field Values
Constructor Detail

Cardinality

public Cardinality(int min,
                   int max)
Constructor for the Cardinality object

Parameters:
min - Minimum cardinality
max - Maximum cardinality
Method Detail

getMax

public int getMax()
Gets the maximum cardinality

Returns:
The maximum cardinality

getMin

public int getMin()
Gets the minimum cardinality

Returns:
The minimum cardinality

isMany

public boolean isMany()
Return whether or not the maximum cardinality is higher than ONE

Returns:
True if the maximum cardinality is higher than ONE

normalize

public void normalize()
Make sure the maximum cardinality is always greater or equal than the minimum cardinality


setMax

public void setMax(int max)
Sets the maximum cardinality

Parameters:
max - The maximum cardinality

setMin

public void setMin(int min)
Sets the minimum cardinality

Parameters:
min - The minimum cardinality

toString

public String toString()
Implementation of the toString method

Overrides:
toString in class Object
Returns:
String representation


Copyright © 2000-2003 XDoclet Team. All Rights Reserved.