org.dishevelled.vocabulary.simple
Class SimpleDomain

java.lang.Object
  extended by org.dishevelled.vocabulary.simple.SimpleDomain
All Implemented Interfaces:
Domain

public class SimpleDomain
extends java.lang.Object
implements Domain

Simple implementation of the Domain interface.

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

Field Summary
private  Authority authority
          Authority.
private  java.util.Set<Concept> concepts
          Set of concepts.
private  java.util.Set<Mapping> inMappings
          Set of in mappings.
private  java.lang.String name
          Domain name.
private  java.util.Set<Mapping> outMappings
          Set of out mappings.
private  java.util.Set<Relation> relations
          Set of relations.
 
Constructor Summary
SimpleDomain(Authority authority, java.lang.String name)
          Create a new domain with the specified authority and name.
 
Method Summary
(package private)  void addConcept(SimpleConcept concept)
          Add the specified concept.
(package private)  void addInMapping(SimpleMapping mapping)
          Add the specified in mapping.
(package private)  void addOutMapping(SimpleMapping mapping)
          Add the specified out mapping.
(package private)  void addRelation(SimpleRelation relation)
          Add the specified relation.
 Concept createConcept(java.lang.String name, java.lang.String accession, java.lang.String definition)
          Create a new concept in this domain with the specified name, accession, and definition (optional operation).
 Relation createRelation(java.lang.String name, Concept source, Concept target)
          Create a new relation in this domain between concepts source and target with the specified name (optional operation).
 Authority getAuthority()
          Return the authority for this domain.
 java.util.Set<Concept> getConcepts()
          Return the set of all concepts in this domain.
 java.util.Set<Mapping> getMappings()
          Return the set of all mappings for this domain.
 java.lang.String getName()
          Return the name of this domain.
 java.util.Set<Relation> getRelations()
          Return the set of all relations in this domain.
 java.util.Set<Mapping> inMappings()
          Return the set of in mappings for this domain, that is those mappings that have this domain as the target.
 java.util.Set<Mapping> outMappings()
          Return the set of out mappings for this domain, that is those mappings that have this domain as the source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

private final java.lang.String name
Domain name.


concepts

private final java.util.Set<Concept> concepts
Set of concepts.


relations

private final java.util.Set<Relation> relations
Set of relations.


inMappings

private final java.util.Set<Mapping> inMappings
Set of in mappings.


outMappings

private final java.util.Set<Mapping> outMappings
Set of out mappings.


authority

private final Authority authority
Authority.

Constructor Detail

SimpleDomain

SimpleDomain(Authority authority,
             java.lang.String name)
Create a new domain with the specified authority and name. authority must not be null.

Parameters:
authority - authority
name - domain name
Method Detail

getName

public java.lang.String getName()
Description copied from interface: Domain
Return the name of this domain.

Specified by:
getName in interface Domain
Returns:
the name
See Also:
Domain

getConcepts

public java.util.Set<Concept> getConcepts()
Description copied from interface: Domain
Return the set of all concepts in this domain. The set must not be null, but may be empty.

Specified by:
getConcepts in interface Domain
Returns:
the set of all concepts
See Also:
Domain

getRelations

public java.util.Set<Relation> getRelations()
Description copied from interface: Domain
Return the set of all relations in this domain. The set must not be null, but may be empty.

Specified by:
getRelations in interface Domain
Returns:
the set of all relations
See Also:
Domain

inMappings

public java.util.Set<Mapping> inMappings()
Description copied from interface: Domain
Return the set of in mappings for this domain, that is those mappings that have this domain as the target. The set must not be null, but may be empty.

Specified by:
inMappings in interface Domain
Returns:
the set of in mappings
See Also:
Domain

outMappings

public java.util.Set<Mapping> outMappings()
Description copied from interface: Domain
Return the set of out mappings for this domain, that is those mappings that have this domain as the source. The set must not be null, but may be empty.

Specified by:
outMappings in interface Domain
Returns:
the set of out mappings
See Also:
Domain

getMappings

public java.util.Set<Mapping> getMappings()
Description copied from interface: Domain
Return the set of all mappings for this domain. The set must not be null, but may be empty.

Specified by:
getMappings in interface Domain
Returns:
the set of all mappings
See Also:
Domain

getAuthority

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

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

addConcept

void addConcept(SimpleConcept concept)
Add the specified concept.

Parameters:
concept - concept to add

addRelation

void addRelation(SimpleRelation relation)
Add the specified relation.

Parameters:
relation - relation to add

addInMapping

void addInMapping(SimpleMapping mapping)
Add the specified in mapping.

Parameters:
mapping - in mapping to add

addOutMapping

void addOutMapping(SimpleMapping mapping)
Add the specified out mapping.

Parameters:
mapping - out mapping to add

createConcept

public Concept createConcept(java.lang.String name,
                             java.lang.String accession,
                             java.lang.String definition)
Description copied from interface: Domain
Create a new concept in this domain with the specified name, accession, and definition (optional operation). The specified accession must be unique within this domain and may not be null.

Specified by:
createConcept in interface Domain
Parameters:
name - concept name
accession - concept accession
definition - concept definition
Returns:
new concept
See Also:
Domain

createRelation

public Relation createRelation(java.lang.String name,
                               Concept source,
                               Concept target)
Description copied from interface: Domain
Create a new relation in this domain between concepts source and target with the specified name (optional operation). Only one relation may exist between the same source and target with the same name within this domain. The source and target concepts must not be null.

Specified by:
createRelation in interface Domain
Parameters:
name - relation name
source - relation source concept
target - relation target concept
Returns:
new relation
See Also:
Domain


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