jade.content.schema.facets
Class CardinalityFacet

java.lang.Object
  |
  +--jade.content.schema.facets.CardinalityFacet
All Implemented Interfaces:
Facet, Serializable, java.io.Serializable

public class CardinalityFacet
extends java.lang.Object
implements Facet

This facet forces an AbsAggregate to contain a number of elements that is comprised between a given min and a given max.

Author:
Giovanni Caire - TILAB
See Also:
Serialized Form

Constructor Summary
CardinalityFacet(int cardMin, int cardMax)
          Construct a CardinalityFacet that forces the number of elements in an AbsAggregate to be within a given range
 
Method Summary
 int getCardMax()
           
 int getCardMin()
           
 void validate(AbsObject value, Ontology onto)
          Check that the number of elements in an AbsAggregate is within a given range
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CardinalityFacet

public CardinalityFacet(int cardMin,
                        int cardMax)
Construct a CardinalityFacet that forces the number of elements in an AbsAggregate to be within a given range

Parameters:
cardMin - The range lower bound
cardMax - The range upper bound
Method Detail

getCardMin

public int getCardMin()

getCardMax

public int getCardMax()

validate

public void validate(AbsObject value,
                     Ontology onto)
              throws OntologyException
Check that the number of elements in an AbsAggregate is within a given range

Specified by:
validate in interface Facet
Parameters:
value - The value to be checked
Throws:
OntologyException - If the value is not valid


JADE