pl.edu.agh.cast.model.visual.backward
Class NodeIndexer

java.lang.Object
  extended by pl.edu.agh.cast.model.visual.backward.NodeIndexer

public class NodeIndexer
extends Object

Class for indexing Nodes based on the specified attribute. The type of nodes to index may be specified. If the indexing attribute is equal to NodeAttributeManager.PERMANENT_ID then the existing index of supplied VisualModelCachingFactory is used.

Author:
AGH CAST Team

Constructor Summary
NodeIndexer(VisualModelCachingFactory visualModelFactory)
          Creates node indexer with index built based on NodeAttributeManager.PERMANENT_ID attribute.
NodeIndexer(VisualModelCachingFactory visualModelFactory, String attribute)
          Creates node indexer with index built based on attribute attribute.All types of nodes are indexed.
NodeIndexer(VisualModelCachingFactory visualModelFactory, String attribute, String type)
          Creates node indexer with index built based on attribute attribute.
NodeIndexer(VisualModelCachingFactory visualModelFactory, String attribute, String type, org.eclipse.core.runtime.IProgressMonitor monitor)
          Creates node indexer with index built based on attribute attribute.
 
Method Summary
 List<Node> lookup(Object value)
          Returns list of nodes that have the indexing attribute value equal to value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeIndexer

public NodeIndexer(VisualModelCachingFactory visualModelFactory)
Creates node indexer with index built based on NodeAttributeManager.PERMANENT_ID attribute. All types of nodes are indexed.

Parameters:
visualModelFactory - VisualModelCachingFactory that provides nodes

NodeIndexer

public NodeIndexer(VisualModelCachingFactory visualModelFactory,
                   String attribute)
Creates node indexer with index built based on attribute attribute.All types of nodes are indexed.

Parameters:
visualModelFactory - VisualModelCachingFactory that provides nodes
attribute - name of the attribute to be used for indexing

NodeIndexer

public NodeIndexer(VisualModelCachingFactory visualModelFactory,
                   String attribute,
                   String type)
Creates node indexer with index built based on attribute attribute. Only nodes of type type are indexed.

Parameters:
visualModelFactory - VisualModelCachingFactory that provides nodes
attribute - name of the attribute to be used for indexing
type - type of nodes to index - if null then all types are considered

NodeIndexer

public NodeIndexer(VisualModelCachingFactory visualModelFactory,
                   String attribute,
                   String type,
                   org.eclipse.core.runtime.IProgressMonitor monitor)
Creates node indexer with index built based on attribute attribute. Only nodes of type type are indexed.

Parameters:
visualModelFactory - VisualModelCachingFactory that provides nodes
attribute - name of the attribute to be used for indexing
type - type of nodes to index - if null then all types are considered
monitor - operation progress monitor
Method Detail

lookup

public List<Node> lookup(Object value)
Returns list of nodes that have the indexing attribute value equal to value. WARNING: in order to preserve performance, no validation on value type is performed

Parameters:
value - lookup value
Returns:
list of matching nodes


Copyright © 2007-2009 IISG AGH-UST Krakow, Poland. All Rights Reserved.