dpvis.datastructures
Interface Strategy

All Superinterfaces:
java.io.Serializable

public interface Strategy
extends java.io.Serializable

Class modelling a Strategy. The public variables indicate which strategies are supported.

Author:
Felix

Field Summary
static int ARBITRARY
           
static int CONTEXTSENSITIVE
           
static int INNERMOST
           
static int OUTERMOST
           
 
Method Summary
 void addRestriction(java.lang.String function, java.util.List<java.lang.Integer> poss)
          Adds a restriction to the replacement map.
 java.util.Map<java.lang.String,java.util.List<java.lang.Integer>> getReplacementMap()
          Gets the replacement map of the strategy.
 int getType()
          Gets the type of the strategies, possible types are Strategy.INNERMOST Strategy.OUTERMOST Strategy.CONTEXTSENSITIVE Strategy.ARBITRARY Note that the type of strategy is final, i.e. it cannot be changed after the Strategy has been initialized.
 void setReplacementMap(java.util.Map<java.lang.String,java.util.List<java.lang.Integer>> repMap)
          Sets the replacement map of the strategy.
 

Field Detail

INNERMOST

static final int INNERMOST
See Also:
Constant Field Values

OUTERMOST

static final int OUTERMOST
See Also:
Constant Field Values

CONTEXTSENSITIVE

static final int CONTEXTSENSITIVE
See Also:
Constant Field Values

ARBITRARY

static final int ARBITRARY
See Also:
Constant Field Values
Method Detail

setReplacementMap

void setReplacementMap(java.util.Map<java.lang.String,java.util.List<java.lang.Integer>> repMap)
Sets the replacement map of the strategy. Note that the replacement map is ignored unless the type of the strategy is context-sensitive.

Parameters:
repMap - The new replacement map.

getReplacementMap

java.util.Map<java.lang.String,java.util.List<java.lang.Integer>> getReplacementMap()
Gets the replacement map of the strategy. Note that the replacement map is ignored unless the type of the strategy is context-sensitive. return The replacement map.


addRestriction

void addRestriction(java.lang.String function,
                    java.util.List<java.lang.Integer> poss)
Adds a restriction to the replacement map. Calling this function only makes sense if the type of the strategy is CONTEXTSENSITIVE.

Parameters:
function - The function for which the restriction is added.
poss - The restriction, given by a list of integers specifying the allowed positions.

getType

int getType()
Gets the type of the strategies, possible types are Note that the type of strategy is final, i.e. it cannot be changed after the Strategy has been initialized.

Returns:
The type of the Strategy.