org.dishevelled.codegen
Class Association

java.lang.Object
  extended by org.dishevelled.codegen.Association

public final class Association
extends Object

An association between a class or interface description and a target class or interface description. An association has a role, a cardinality, and if the cardinality is Cardinality.ZeroToMany or Cardinality.OneToMany, a collection description.

Version:
$Revision: 972 $ $Date: 2011-01-04 21:34:39 -0600 (Tue, 04 Jan 2011) $
Author:
Michael Heuer

Constructor Summary
Association(ClassDescription cd, String roleName, Cardinality cardinality)
          Create a new association with the specified class description, role name, and cardinality.
Association(ClassDescription cd, String roleName, Cardinality cardinality, boolean bound)
          Create a new association with the specified class description, role name, cardinality, and bound flag.
Association(ClassDescription cd, String roleName, Cardinality cardinality, boolean indexed, boolean unique, boolean ordered, boolean sorted)
          Create a new association with the specified class description, role name, and cardinality and choose a collection description that satisfies the specified boolean parameters.
Association(ClassDescription cd, String roleName, Cardinality cardinality, boolean bound, boolean indexed, boolean unique, boolean ordered, boolean sorted)
          Create a new association with the specified class description, role name, cardinality, and bound flag and choose a collection description that satisfies the specified boolean parameters.
Association(InterfaceDescription id, String roleName, Cardinality cardinality)
          Create a new association with the specified interface description, role name, and cardinality.
Association(InterfaceDescription id, String roleName, Cardinality cardinality, boolean bound)
          Create a new association with the specified interface description, role name, and cardinality.
Association(InterfaceDescription id, String roleName, Cardinality cardinality, boolean indexed, boolean unique, boolean ordered, boolean sorted)
          Create a new association with the specified interface description, role name, and cardinality and choose a collection description that satisfies the specified boolean parameters.
Association(InterfaceDescription id, String roleName, Cardinality cardinality, boolean bound, boolean indexed, boolean unique, boolean ordered, boolean sorted)
          Create a new association with the specified interface description, role name, and cardinality and choose a collection description that satisfies the specified boolean parameters.
Association(String lower, String mixed, String upper, String description, Role role, Cardinality cardinality, CollectionDescription collectionDescription)
          Create a new association from the specified parameters.
Association(String lower, String mixed, String upper, String description, Role role, Cardinality cardinality, CollectionDescription collectionDescription, boolean bound)
          Create a new association from the specified parameters.
 
Method Summary
 Cardinality getCardinality()
          Return the cardinality for this association.
 CollectionDescription getCollectionDescription()
          Return the collection description for this association.
 String getDescription()
          Return the description for this association.
 String getLower()
          Return the lowercase name for this association.
 String getMixed()
          Return the mixed-case name for this association.
 String getPackageName()
          Return the package name for this association.
 Role getRole()
          Return the role for this association.
 String getUpper()
          Return the uppercase name for this association.
 boolean isBound()
          Return true if this is a "bound" association.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Association

public Association(ClassDescription cd,
                   String roleName,
                   Cardinality cardinality)
Create a new association with the specified class description, role name, and cardinality. The cardinality must be one of Cardinality.ZeroToOne or Cardinality.StrictlyOne.

Parameters:
cd - class description, must not be null
roleName - role name
cardinality - cardinality, must not be null and must be one of Cardinality.ZeroToOne or Cardinality.StrictlyOne

Association

public Association(ClassDescription cd,
                   String roleName,
                   Cardinality cardinality,
                   boolean bound)
Create a new association with the specified class description, role name, cardinality, and bound flag. The cardinality must be one of Cardinality.ZeroToOne or Cardinality.StrictlyOne.

Parameters:
cd - class description, must not be null
roleName - role name
cardinality - cardinality, must not be null and must be one of Cardinality.ZeroToOne or Cardinality.StrictlyOne
bound - true if this is a "bound" association

Association

public Association(ClassDescription cd,
                   String roleName,
                   Cardinality cardinality,
                   boolean indexed,
                   boolean unique,
                   boolean ordered,
                   boolean sorted)
Create a new association with the specified class description, role name, and cardinality and choose a collection description that satisfies the specified boolean parameters.

Parameters:
cd - class description, must not be null
roleName - role name
cardinality - cardinality, must not be null
indexed - true if the collection should be indexed
unique - true if the collection should not allow duplicate elements
ordered - true if the collection should iterate over elements in insertion-order
sorted - true if the collection should iterate over elements in ascending element order, sorted according to the natural ordering of its elements (see Comparable), or by a Comparator provided at creation time

Association

public Association(ClassDescription cd,
                   String roleName,
                   Cardinality cardinality,
                   boolean bound,
                   boolean indexed,
                   boolean unique,
                   boolean ordered,
                   boolean sorted)
Create a new association with the specified class description, role name, cardinality, and bound flag and choose a collection description that satisfies the specified boolean parameters.

Parameters:
cd - class description, must not be null
roleName - role name
cardinality - cardinality, must not be null
bound - true if this is a "bound" association
indexed - true if the collection should be indexed
unique - true if the collection should not allow duplicate elements
ordered - true if the collection should iterate over elements in insertion-order
sorted - true if the collection should iterate over elements in ascending element order, sorted according to the natural ordering of its elements (see Comparable), or by a Comparator provided at creation time

Association

public Association(InterfaceDescription id,
                   String roleName,
                   Cardinality cardinality)
Create a new association with the specified interface description, role name, and cardinality. The cardinality must be one of Cardinality.ZeroToOne or Cardinality.StrictlyOne.

Parameters:
id - interface description, must not be null
roleName - role name
cardinality - cardinality, must not be null and must be one of Cardinality.ZeroToOne or Cardinality.StrictlyOne

Association

public Association(InterfaceDescription id,
                   String roleName,
                   Cardinality cardinality,
                   boolean bound)
Create a new association with the specified interface description, role name, and cardinality. The cardinality must be one of Cardinality.ZeroToOne or Cardinality.StrictlyOne.

Parameters:
id - interface description, must not be null
roleName - role name
cardinality - cardinality, must not be null and must be one of Cardinality.ZeroToOne or Cardinality.StrictlyOne
bound - true if this is a "bound" association

Association

public Association(InterfaceDescription id,
                   String roleName,
                   Cardinality cardinality,
                   boolean indexed,
                   boolean unique,
                   boolean ordered,
                   boolean sorted)
Create a new association with the specified interface description, role name, and cardinality and choose a collection description that satisfies the specified boolean parameters.

Parameters:
id - interface description, must not be null
roleName - role name
cardinality - cardinality, must not be null
indexed - true if the collection should be indexed
unique - true if the collection should not allow duplicate elements
ordered - true if the collection should iterate over elements in insertion-order
sorted - true if the collection should iterate over elements in ascending element order, sorted according to the natural ordering of its elements (see Comparable), or by a Comparator provided at creation time

Association

public Association(InterfaceDescription id,
                   String roleName,
                   Cardinality cardinality,
                   boolean bound,
                   boolean indexed,
                   boolean unique,
                   boolean ordered,
                   boolean sorted)
Create a new association with the specified interface description, role name, and cardinality and choose a collection description that satisfies the specified boolean parameters.

Parameters:
id - interface description, must not be null
roleName - role name
cardinality - cardinality, must not be null
bound - true if this is a "bound" association
indexed - true if the collection should be indexed
unique - true if the collection should not allow duplicate elements
ordered - true if the collection should iterate over elements in insertion-order
sorted - true if the collection should iterate over elements in ascending element order, sorted according to the natural ordering of its elements (see Comparable), or by a Comparator provided at creation time

Association

public Association(String lower,
                   String mixed,
                   String upper,
                   String description,
                   Role role,
                   Cardinality cardinality,
                   CollectionDescription collectionDescription)
Create a new association from the specified parameters.

Parameters:
lower - lowercase name for this association
mixed - mixed-case name for this association
upper - uppercase name for this association
description - description for this association
role - role for this association, must not be null
cardinality - cardinality for this association, must not be null
collectionDescription - collection description for this association

Association

public Association(String lower,
                   String mixed,
                   String upper,
                   String description,
                   Role role,
                   Cardinality cardinality,
                   CollectionDescription collectionDescription,
                   boolean bound)
Create a new association from the specified parameters.

Parameters:
lower - lowercase name for this association
mixed - mixed-case name for this association
upper - uppercase name for this association
description - description for this association
role - role for this association, must not be null
cardinality - cardinality for this association, must not be null
collectionDescription - collection description for this association
bound - true if this is a "bound" association
Method Detail

getLower

public String getLower()
Return the lowercase name for this association.

Returns:
the lowercase name for this association

getMixed

public String getMixed()
Return the mixed-case name for this association.

Returns:
the mixed-case name for this association

getUpper

public String getUpper()
Return the uppercase name for this association.

Returns:
the uppercase name for this association

getDescription

public String getDescription()
Return the description for this association.

Returns:
the description for this association

getPackageName

public String getPackageName()
Return the package name for this association.

Returns:
the package name for this association

getRole

public Role getRole()
Return the role for this association. The role will not be null.

Returns:
the role for this association

getCardinality

public Cardinality getCardinality()
Return the cardinality for this association. The cardinality will not be null.

Returns:
the cardinality for this association

getCollectionDescription

public CollectionDescription getCollectionDescription()
Return the collection description for this association. The collection description may be null.

Returns:
the collection description for this association

isBound

public boolean isBound()
Return true if this is a "bound" association.

Returns:
true if this is a "bound" association


Copyright (c) 2004-2011 held jointly by the individual authors. Licensed under the GNU Lesser General Public License (LGPL).