be.ac.vub.cocompose.lang.datatypes
Class Multiplicity

java.lang.Object
  extended bybe.ac.vub.cocompose.lang.datatypes.Multiplicity
All Implemented Interfaces:
VisitedElement

public class Multiplicity
extends Object
implements VisitedElement

Multiplicity constraint interface.

Since:
0.2.0
Version:
0.2.0
Author:
Dennis Wagelaar

Field Summary
static int MANY
          Represents many elements.
 
Constructor Summary
Multiplicity()
          Creates a Multiplicity.
Multiplicity(Multiplicity source)
          Creates a Multiplicity from the given source.
 
Method Summary
 void accept(ModelVisitor modelVisitor)
          Accepts a visitor.
 void acceptSuper(ModelVisitor modelVisitor)
          Invokes superclass accept().
 int getLower()
          Gets the lower bound.
 int getUpper()
          Gets the upper bound.
 void setLower(int lower)
          Sets the lower bound.
 void setUpper(int upper)
          Sets the upper bound.
 String toString()
          Returns [lowerbound..upperbound].
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MANY

public static final int MANY
Represents many elements.

See Also:
Constant Field Values
Constructor Detail

Multiplicity

public Multiplicity()
Creates a Multiplicity.


Multiplicity

public Multiplicity(Multiplicity source)
Creates a Multiplicity from the given source.

Parameters:
source - - the source multiplicity to copy the values from.
Method Detail

getLower

public int getLower()
Gets the lower bound.

Returns:
the lower bound.

setLower

public void setLower(int lower)
Sets the lower bound.

Parameters:
lower - - the lower bound.

getUpper

public int getUpper()
Gets the upper bound.

Returns:
the upper bound.

setUpper

public void setUpper(int upper)
Sets the upper bound.

Parameters:
upper - - the upper bound.

accept

public void accept(ModelVisitor modelVisitor)
            throws ModelElementException
Accepts a visitor.

Specified by:
accept in interface VisitedElement
Parameters:
modelVisitor - The visitor to accept.
Throws:
ModelElementException

acceptSuper

public void acceptSuper(ModelVisitor modelVisitor)
                 throws ModelElementException
Invokes superclass accept().

Parameters:
modelVisitor - The visitor to accept.
Throws:
ModelElementException
See Also:
accept(ModelVisitor)

toString

public String toString()
Returns [lowerbound..upperbound].

See Also:
Object.toString()