org.dishevelled.vocabulary.simple
Class SimpleAuthority

java.lang.Object
  extended by org.dishevelled.vocabulary.simple.SimpleAuthority
All Implemented Interfaces:
Authority

public class SimpleAuthority
extends java.lang.Object
implements Authority

Simple implementation of the Authority interface.

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

Field Summary
private  java.util.Set<Assignment> assignments
          Set of assignments.
private  java.util.Set<Domain> domains
          Set of domains.
private  java.util.Set<Mapping> mappings
          Set of mappings.
private  java.lang.String name
          Authority name.
 
Constructor Summary
SimpleAuthority(java.lang.String name)
          Create a new authority with the specified name.
 
Method Summary
(package private)  void addAssignment(SimpleAssignment assignment)
          Add the specified assignment.
(package private)  void addDomain(SimpleDomain domain)
          Add the specified domain.
(package private)  void addMapping(SimpleMapping mapping)
          Add the specified mapping.
 Assignment createAssignment(Concept concept, Assignable assignable, java.util.Set<Evidence> evidence)
          Create a new assignment maintained by this authority of concept to assignable, supported by evidence (optional operation).
 Domain createDomain(java.lang.String name)
          Create a new domain maintained by this authority with the specified name (optional operation).
 Mapping createMapping(Domain source, Domain target)
          Create a new mapping maintained by this authority between the specified domains (optional operation).
 java.util.Set<Assignment> getAssignments()
          Return the set of assignments maintained by this authority.
 java.util.Set<Domain> getDomains()
          Return the set of domains maintained by this authority.
 java.util.Set<Mapping> getMappings()
          Return the set of mappings between domains maintained by this authority.
 java.lang.String getName()
          Return the name of this authority.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

private final java.lang.String name
Authority name.


domains

private java.util.Set<Domain> domains
Set of domains.


mappings

private java.util.Set<Mapping> mappings
Set of mappings.


assignments

private java.util.Set<Assignment> assignments
Set of assignments.

Constructor Detail

SimpleAuthority

public SimpleAuthority(java.lang.String name)
Create a new authority with the specified name.

Parameters:
name - authority name
Method Detail

getName

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

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

getDomains

public java.util.Set<Domain> getDomains()
Description copied from interface: Authority
Return the set of domains maintained by this authority. The set must not be null, but may be empty.

Specified by:
getDomains in interface Authority
Returns:
the set of domains
See Also:
Authority

getMappings

public java.util.Set<Mapping> getMappings()
Description copied from interface: Authority
Return the set of mappings between domains maintained by this authority. The set must not be null, but may be empty.

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

getAssignments

public java.util.Set<Assignment> getAssignments()
Description copied from interface: Authority
Return the set of assignments maintained by this authority. The set must not be null, but may be empty.

Specified by:
getAssignments in interface Authority
Returns:
the set of assignments
See Also:
Authority

addDomain

void addDomain(SimpleDomain domain)
Add the specified domain.

Parameters:
domain - domain to add

addMapping

void addMapping(SimpleMapping mapping)
Add the specified mapping.

Parameters:
mapping - mapping to add

addAssignment

void addAssignment(SimpleAssignment assignment)
Add the specified assignment.

Parameters:
assignment - assignment to add

createDomain

public Domain createDomain(java.lang.String name)
Description copied from interface: Authority
Create a new domain maintained by this authority with the specified name (optional operation). The specified name must be unique within this authority and may not be null.

Specified by:
createDomain in interface Authority
Parameters:
name - domain name
Returns:
new domain
See Also:
Authority

createMapping

public Mapping createMapping(Domain source,
                             Domain target)
Description copied from interface: Authority
Create a new mapping maintained by this authority between the specified domains (optional operation). The specified domains must not be null.

Specified by:
createMapping in interface Authority
Parameters:
source - mapping source domain
target - mapping target domain
Returns:
new mapping
See Also:
Authority

createAssignment

public Assignment createAssignment(Concept concept,
                                   Assignable assignable,
                                   java.util.Set<Evidence> evidence)
Description copied from interface: Authority
Create a new assignment maintained by this authority of concept to assignable, supported by evidence (optional operation). The specified concept and assignable must not be null.

Specified by:
createAssignment in interface Authority
Parameters:
concept - assignment source concept
assignable - assignment target assignable
evidence - set of evidence
Returns:
new assignment
See Also:
Authority

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object


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