edu.umd.cfar.lamp.viper.util
Class AbstractSingleViperSubTree

java.lang.Object
  extended byedu.umd.cfar.lamp.viper.util.AbstractViperSelection
      extended byedu.umd.cfar.lamp.viper.util.AbstractViperSubTree
          extended byedu.umd.cfar.lamp.viper.util.AbstractSingleViperSubTree
All Implemented Interfaces:
ViperSelection, ViperSubTree
Direct Known Subclasses:
AttributeSelection, DefaultSingleViperSubTree

public abstract class AbstractSingleViperSubTree
extends AbstractViperSubTree

A simple, chain-type subtree. It implements the iterator methods using the getFirst methods.


Field Summary
 
Fields inherited from class edu.umd.cfar.lamp.viper.util.AbstractViperSelection
notifyingListeners
 
Constructor Summary
AbstractSingleViperSubTree()
           
 
Method Summary
 java.util.Iterator getAttrConfigs()
          Get all the attribute configuration nodes currently in the selection.
 java.util.Iterator getAttributes()
          Get all the attribute nodes currently in the selection.
 java.util.Iterator getConfigs()
          Get all the descriptor configuration nodes currently in the selection.
 java.util.Iterator getDescriptors()
          Get all the descriptor nodes currently in the selection.
 java.util.Iterator getSourcefiles()
          Get all the sourcefile nodes currently in the selection.
 boolean isMultipleSelectionAllowedOn(java.lang.Class type)
          Determines if the given type is allowed to have more than one selection.
 boolean isSelected(Node n)
          Tests to see if the given node is selected.
 
Methods inherited from class edu.umd.cfar.lamp.viper.util.AbstractViperSubTree
fireChangeEvent, fireSelectionChanged, getSelectedBy, isEmpty, isFilteredBy, toString
 
Methods inherited from class edu.umd.cfar.lamp.viper.util.AbstractViperSelection
addChangeListener, getChangeListeners, removeChangeListener, writeLock, writeUnlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.umd.cfar.lamp.viper.util.ViperSubTree
getFirstAttrConfig, getFirstAttribute, getFirstConfig, getFirstDescriptor, getFirstSourcefile, getRoot
 
Methods inherited from interface edu.umd.cfar.lamp.viper.util.ViperSelection
addChangeListener, getChangeListeners, removeChangeListener
 

Constructor Detail

AbstractSingleViperSubTree

public AbstractSingleViperSubTree()
Method Detail

isMultipleSelectionAllowedOn

public boolean isMultipleSelectionAllowedOn(java.lang.Class type)
Determines if the given type is allowed to have more than one selection.

Parameters:
type - one of the viper.api interfaces, e.g. Sourcefile.class
Returns:
false, as only one is ever allowed

getSourcefiles

public java.util.Iterator getSourcefiles()
Get all the sourcefile nodes currently in the selection.

Returns:
the selected sourcefile nodes

getConfigs

public java.util.Iterator getConfigs()
Get all the descriptor configuration nodes currently in the selection.

Returns:
the selected descriptor configuration nodes

getAttrConfigs

public java.util.Iterator getAttrConfigs()
Get all the attribute configuration nodes currently in the selection.

Returns:
the selected attribute configuration nodes

getDescriptors

public java.util.Iterator getDescriptors()
Get all the descriptor nodes currently in the selection.

Returns:
the selected descriptor nodes

getAttributes

public java.util.Iterator getAttributes()
Get all the attribute nodes currently in the selection.

Returns:
the selected attribute nodes

isSelected

public boolean isSelected(Node n)
Tests to see if the given node is selected.

Parameters:
n - the viper data node to test
Returns:
true iff the node is selected