i3.dragos.gm.core.schema
Class Cardinality

java.lang.Object
  extended by i3.dragos.gm.core.schema.Cardinality
All Implemented Interfaces:
java.io.Serializable

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

The cardinality of edge types, attributes etc.

Author:
Boris Boehlen <boehlen@cs.rwth-aachen.de>, Thorsten Hermes <thermes@i3.informatik.rwth-aachen.de>
See Also:
Serialized Form

Field Summary
static Cardinality OBL_SET
          Set contains [1:n] elements.
static Cardinality OBL_UNIQUE
          Set contains [1:1] elements.
static Cardinality OPT_SET
          Set contains [0:n] elements.
static Cardinality OPT_UNIQUE
          Set contains [0:1] elements.
 
Constructor Summary
Cardinality(int min, int max)
          Creates a new Cardinality instance.
 
Method Summary
 boolean applys(int value)
          Determines whether value is in the interval of this Cardinality.
 boolean equals(java.lang.Object o)
          
 int getMaximum()
          Returns the mininum for this Cardinality.
 int getMinimum()
          Returns the maxinum for this Cardinality.
 int hashCode()
          
 java.lang.String toString()
          Returns a String representation of this Cardinality.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

OPT_UNIQUE

public static final Cardinality OPT_UNIQUE
Set contains [0:1] elements.


OBL_UNIQUE

public static final Cardinality OBL_UNIQUE
Set contains [1:1] elements.


OPT_SET

public static final Cardinality OPT_SET
Set contains [0:n] elements.


OBL_SET

public static final Cardinality OBL_SET
Set contains [1:n] elements.

Constructor Detail

Cardinality

public Cardinality(int min,
                   int max)
Creates a new Cardinality instance.

Parameters:
min - The mininum for this Cardinality.
max - The maxinum for this Cardinality.
Method Detail

getMinimum

public int getMinimum()
Returns the maxinum for this Cardinality.

Returns:
The maxinum for this Cardinality

getMaximum

public int getMaximum()
Returns the mininum for this Cardinality.

Returns:
The mininum for this Cardinality

applys

public boolean applys(int value)
Determines whether value is in the interval of this Cardinality.

Parameters:
value - the value to check.
Returns:
true if the given value is contained in this interval, false otherwise.

toString

public java.lang.String toString()
Returns a String representation of this Cardinality.

Overrides:
toString in class java.lang.Object
Returns:
a String representation of this Cardinality.

equals

public boolean equals(java.lang.Object o)

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object


Copyright © 2002-2008 RWTH Aachen, Department of Computer Science 3 (Software Engineering). All Rights Reserved.