org.dishevelled.vocabulary.simple
Class SimpleMapping

java.lang.Object
  extended by org.dishevelled.vocabulary.simple.SimpleMapping
All Implemented Interfaces:
Mapping

public class SimpleMapping
extends java.lang.Object
implements Mapping

Simple implementation of the Mapping interface.

Version:
$Revision$ $Date$
Author:
Michael Heuer

Field Summary
private  Authority authority
          Authority.
private  java.util.Set<Projection> projections
          Set of projections.
private  Domain source
          Source domain.
private  Domain target
          Target domain.
 
Constructor Summary
SimpleMapping(Authority authority, SimpleDomain source, SimpleDomain target)
          Create a new mapping with the specified authority, source domain, and target domain.
 
Method Summary
(package private)  void addProjection(SimpleProjection projection)
          Add the specified projection.
 Projection createProjection(java.lang.String name, Concept source, Concept target, java.util.Set<Evidence> evidence)
          Create a new projection in this mapping between concepts source and target with the specified name (optional operation).
 Authority getAuthority()
          Return the authority for this mapping.
 java.util.Set<Projection> getProjections()
          Return the set of all projections in this mapping.
 Domain getSource()
          Return the source domain of this mapping.
 Domain getTarget()
          Return the target domain of this mapping.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

source

private final Domain source
Source domain.


target

private final Domain target
Target domain.


projections

private final java.util.Set<Projection> projections
Set of projections.


authority

private final Authority authority
Authority.

Constructor Detail

SimpleMapping

SimpleMapping(Authority authority,
              SimpleDomain source,
              SimpleDomain target)
Create a new mapping with the specified authority, source domain, and target domain. All of authority, source, and target must not be null.

Parameters:
authority - authority
source - source domain
target - target domain
Method Detail

getSource

public Domain getSource()
Description copied from interface: Mapping
Return the source domain of this mapping. The source domain must not be null.

Specified by:
getSource in interface Mapping
Returns:
the source domain
See Also:
Mapping

getTarget

public Domain getTarget()
Description copied from interface: Mapping
Return the target domain of this mapping. The target domain must not be null.

Specified by:
getTarget in interface Mapping
Returns:
the target domain
See Also:
Mapping

getProjections

public java.util.Set<Projection> getProjections()
Description copied from interface: Mapping
Return the set of all projections in this mapping. The set must not be null, but may be empty.

Specified by:
getProjections in interface Mapping
Returns:
the set of all projections
See Also:
Mapping

getAuthority

public Authority getAuthority()
Description copied from interface: Mapping
Return the authority for this mapping. The authority must not be null.

Specified by:
getAuthority in interface Mapping
Returns:
the authority
See Also:
Mapping

addProjection

void addProjection(SimpleProjection projection)
Add the specified projection.

Parameters:
projection - projection to add

createProjection

public Projection createProjection(java.lang.String name,
                                   Concept source,
                                   Concept target,
                                   java.util.Set<Evidence> evidence)
Description copied from interface: Mapping
Create a new projection in this mapping between concepts source and target with the specified name (optional operation). The source concept must be within the source domain of this mapping, and the target domain must be within the target domain of this mapping. Only one projection may exist between the same source and target with the same name within this mapping. The source and target concepts must not be null.

Specified by:
createProjection in interface Mapping
Parameters:
name - projection name
source - projection source concept
target - projection target concept
evidence - set of evidence
Returns:
new projection
See Also:
Mapping


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