org.LexGrid.LexBIG.Impl.pagedgraph
Class UnionGraph

java.lang.Object
  extended by org.LexGrid.LexBIG.Impl.pagedgraph.AbstractCodedNodeGraph
      extended by org.LexGrid.LexBIG.Impl.pagedgraph.AbstractMultiGraph
          extended by org.LexGrid.LexBIG.Impl.pagedgraph.UnionGraph
All Implemented Interfaces:
java.io.Serializable, CodedNodeGraph

public class UnionGraph
extends AbstractMultiGraph

The Class UnionGraph.

Author:
Kevin Peterson
See Also:
Serialized Form

Constructor Summary
UnionGraph()
           
UnionGraph(CodedNodeGraph graph1, CodedNodeGraph graph2)
          Instantiates a new union graph.
 
Method Summary
 java.lang.Boolean areCodesRelated(NameAndValue association, ConceptReference sourceCode, ConceptReference targetCode, boolean directOnly)
          Determine whether there is an directed edge (or transitive closure of an edge) from the source code to the target code in this graph.
 ResolvedConceptReferenceList doResolveAsList(ConceptReference graphFocus, boolean resolveForward, boolean resolveBackward, int resolveCodedEntryDepth, int resolveAssociationDepth, LocalNameList propertyNames, CodedNodeSet.PropertyType[] propertyTypes, SortOptionList sortOptions, LocalNameList filterOptions, int maxToReturn, boolean keepLastAssociationLevelUnresolved)
          Do resolve as list.
 java.util.List<java.lang.String> listCodeRelationships(ConceptReference sourceCode, ConceptReference targetCode, boolean directOnly)
          Return a list of all of the associations in the graph that have the supplied source and target codes or, if directOnly is false, all associations whose transitive closure has the supplied associations.
 CodedNodeSet toNodeList(ConceptReference graphFocus, boolean resolveForward, boolean resolveBackward, int resolveAssociationDepth, int maxToReturn)
          Transform the graph into a simple of list of code references, removing all association information.
protected  ResolvedConceptReferenceList unionReferenceList(boolean nullFocus, ResolvedConceptReferenceList list1, ResolvedConceptReferenceList list2)
           
 
Methods inherited from class org.LexGrid.LexBIG.Impl.pagedgraph.AbstractMultiGraph
getGraph1, getGraph2, restrictToAnonymous, restrictToAssociations, restrictToCodes, restrictToCodeSystem, restrictToDirectionalNames, restrictToEntityTypes, restrictToSourceCodes, restrictToSourceCodeSystem, restrictToTargetCodes, restrictToTargetCodeSystem, setGraph1, setGraph2
 
Methods inherited from class org.LexGrid.LexBIG.Impl.pagedgraph.AbstractCodedNodeGraph
getLogger, intersect, isCodeInGraph, listCodeRelationships, resolveAsList, resolveAsList, resolveAsList, union
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnionGraph

public UnionGraph()

UnionGraph

public UnionGraph(CodedNodeGraph graph1,
                  CodedNodeGraph graph2)
Instantiates a new union graph.

Parameters:
graph1 - the graph1
graph2 - the graph2
Method Detail

listCodeRelationships

public java.util.List<java.lang.String> listCodeRelationships(ConceptReference sourceCode,
                                                              ConceptReference targetCode,
                                                              boolean directOnly)
                                                       throws LBInvocationException,
                                                              LBParameterException
Description copied from interface: CodedNodeGraph
Return a list of all of the associations in the graph that have the supplied source and target codes or, if directOnly is false, all associations whose transitive closure has the supplied associations.

Parameters:
sourceCode - Source end of the association. If null, all sources for the specified target are included.
targetCode - Target end of the association. If null, all targets for the specified source are included.
directOnly - True means only direct associations are tested. False means that the transitive closure of transitive (and undefined) associations are tested for membership.

Note that while the class of the returned value appears to imply concepts only, each contained reference inherits from the more general CodedNodeReference and is capable of representing any type of node contained by the graph.

Returns:
The list of matching associations.
Throws:
LBInvocationException
LBParameterException

areCodesRelated

public java.lang.Boolean areCodesRelated(NameAndValue association,
                                         ConceptReference sourceCode,
                                         ConceptReference targetCode,
                                         boolean directOnly)
                                  throws LBInvocationException,
                                         LBParameterException
Description copied from interface: CodedNodeGraph
Determine whether there is an directed edge (or transitive closure of an edge) from the source code to the target code in this graph. The last parameter determines whether only direct associations are considered or whether the transitive closure of the edge is used.

Parameters:
association - Identifies the association to be tested. The name and value will be compared against the id and URI of supported associations for participating coding schemes.
sourceCode - Source code system/code to be tested.
targetCode - Target code system/code to be tested.
directOnly - True means only asserted association instances are tested. False means that, if the association is defined as transitive, the transitive closure of the association instances are tested.
Returns:
True if a directed edge exists; otherwise False.
Throws:
LBInvocationException
LBParameterException

doResolveAsList

public ResolvedConceptReferenceList doResolveAsList(ConceptReference graphFocus,
                                                    boolean resolveForward,
                                                    boolean resolveBackward,
                                                    int resolveCodedEntryDepth,
                                                    int resolveAssociationDepth,
                                                    LocalNameList propertyNames,
                                                    CodedNodeSet.PropertyType[] propertyTypes,
                                                    SortOptionList sortOptions,
                                                    LocalNameList filterOptions,
                                                    int maxToReturn,
                                                    boolean keepLastAssociationLevelUnresolved)
                                             throws LBInvocationException,
                                                    LBParameterException
Description copied from class: AbstractCodedNodeGraph
Do resolve as list.

Specified by:
doResolveAsList in class AbstractCodedNodeGraph
Parameters:
graphFocus - the graph focus
resolveForward - the resolve forward
resolveBackward - the resolve backward
resolveCodedEntryDepth - the resolve coded entry depth
resolveAssociationDepth - the resolve association depth
propertyNames - the property names
propertyTypes - the property types
sortOptions - the sort options
filterOptions - the filter options
maxToReturn - the max to return
keepLastAssociationLevelUnresolved - the keep last association level unresolved
Returns:
the resolved concept reference list
Throws:
LBInvocationException - the LB invocation exception
LBParameterException - the LB parameter exception

toNodeList

public CodedNodeSet toNodeList(ConceptReference graphFocus,
                               boolean resolveForward,
                               boolean resolveBackward,
                               int resolveAssociationDepth,
                               int maxToReturn)
                        throws LBInvocationException,
                               LBParameterException
Description copied from interface: CodedNodeGraph
Transform the graph into a simple of list of code references, removing all association information.

Parameters:
graphFocus - Set the top or "focus" node of the graph. If present, only the nodes that are reachable via this node will be returned. If null, nodes with no incoming or outgoing associations are used as starting points for navigation of forward and reverse relationships, respectively.
resolveForward - True means include all "forward" (source->target) associations.
resolveBackward - True means render all "reverse" (target->source) associations
resolveAssociationDepth - Number of hops to resolve associations. 0 means leave all associations unresolved, 1 means immediate neighbors, etc. -1 means follow the entire closure of the graph.
maxToReturn - Maximum number of entries to return; a value less than 1 indicates to return unlimited entries (to the limit specified in the runtime configuration file).
Returns:
A set with matching items, up to the maximum number specified. Note that in the event that a maximum number 'n' is specified and exactly 'n' items are returned, there is currently no flag or notification provided to indicate whether all available items were returned.
Throws:
LBInvocationException
LBParameterException

unionReferenceList

protected ResolvedConceptReferenceList unionReferenceList(boolean nullFocus,
                                                          ResolvedConceptReferenceList list1,
                                                          ResolvedConceptReferenceList list2)

Copyright: (c) 2004-2006 Mayo Foundation for Medical Education and Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the triple-shield Mayo logo are trademarks and service marks of MFMER.