edu.umd.cfar.lamp.viper.util
Interface ViperSubTree

All Superinterfaces:
ViperSelection
All Known Implementing Classes:
AbstractViperSubTree

public interface ViperSubTree
extends ViperSelection

Represents some selection of elements from a viper tree. This interface represents a looser interpretation of a viper tree as a DAG, with the Config and AttrConfig nodes being parallel to the Sourcefile node.


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.
 AttrConfig getFirstAttrConfig()
          Get all the first attribute schema node in the selection.
 Attribute getFirstAttribute()
          Get all the first attribute node in the selection.
 Config getFirstConfig()
          Get all the first descriptor schema node in the selection.
 Descriptor getFirstDescriptor()
          Get all the first descriptor node in the selection.
 Sourcefile getFirstSourcefile()
          Get all the first sourcefile node in the selection.
 ViperData getRoot()
          Gets the root these elements are selected from.
 java.util.Iterator getSelectedBy(java.lang.Class c)
          Gets the selections of the given viper node type.
 java.util.Iterator getSourcefiles()
          Get all the sourcefile nodes currently in the selection.
 boolean isFilteredBy(java.lang.Class type)
          Only nodes beneath some subset of the nodes of the specified type are selected.
 boolean isMultipleSelectionAllowedOn(java.lang.Class type)
          Determines if the given type is allowed to have more than one selection.
 
Methods inherited from interface edu.umd.cfar.lamp.viper.util.ViperSelection
addChangeListener, getChangeListeners, isEmpty, isSelected, removeChangeListener
 

Method Detail

getRoot

public ViperData getRoot()
Gets the root these elements are selected from.

Returns:
the root node

isFilteredBy

public boolean isFilteredBy(java.lang.Class type)
Only nodes beneath some subset of the nodes of the specified type are selected.

Parameters:
type - one of the viper.api interfaces, e.g. Sourcefile.class
Returns:
false if there is no filtering by the given type (i.e. all children of selected parents are selected)

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 if only one, all, or no elements may be selected from the given type

getSelectedBy

public java.util.Iterator getSelectedBy(java.lang.Class c)
Gets the selections of the given viper node type.

Parameters:
c - the node type, e.g. Sourcefile.class
Returns:
an iterator over all, if any, nodes are specifically selected in the tree of the given type

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

getFirstSourcefile

public Sourcefile getFirstSourcefile()
Get all the first sourcefile node in the selection.

Returns:
the first selected sourcefile node

getFirstConfig

public Config getFirstConfig()
Get all the first descriptor schema node in the selection.

Returns:
the first selected descriptor schema node

getFirstAttrConfig

public AttrConfig getFirstAttrConfig()
Get all the first attribute schema node in the selection.

Returns:
the first selected attribute schema node

getFirstDescriptor

public Descriptor getFirstDescriptor()
Get all the first descriptor node in the selection.

Returns:
the first selected descriptor node

getFirstAttribute

public Attribute getFirstAttribute()
Get all the first attribute node in the selection.

Returns:
the first selected attribute node