edu.neu.ccs.demeter.aplib.sg
Class StrategyGraph

java.lang.Object
  |
  +--edu.neu.ccs.demeter.aplib.sg.Strategy
        |
        +--edu.neu.ccs.demeter.aplib.sg.SimpleStrategy
              |
              +--edu.neu.ccs.demeter.aplib.sg.StrategyGraph
All Implemented Interfaces:
ConstraintMapI, SimpleStrategyI, StrategyGraphI, StrategyI

public class StrategyGraph
extends SimpleStrategy
implements SimpleStrategyI, StrategyGraphI, ConstraintMapI


Field Summary
protected  edu.neu.ccs.demeter.aplib.sg.SGEdge_SList edges
           
 
Fields inherited from class edu.neu.ccs.demeter.aplib.sg.SimpleStrategy
parsedNameMap
 
Constructor Summary
StrategyGraph()
           
StrategyGraph(edu.neu.ccs.demeter.aplib.sg.NameMap parsedNameMap, edu.neu.ccs.demeter.aplib.sg.SGEdge_SList edges)
           
 
Method Summary
 void addEdge(edu.neu.ccs.demeter.aplib.sg.SGEdge edge)
           
 edu.neu.ccs.demeter.aplib.sg.SGEdge_SList get_edges()
           
 ConstraintMapI getConstraintMap()
          The constraint map B.
 Object getEdgeSource(int i)
          The source node of edge number i.
 Object getEdgeTarget(int i)
          The target node of edge number i.
 Collection getIncomingEdges(Object v)
          A Collection of indices (Integer objects) of edges coming into node v.
 Collection getNames(Object v)
          The set N(v), a collection of symbolic names (strings) corresponding to node v in the strategy graph S.
 Collection getNodes()
          A Collection of nodes in the strategy graph.
 Collection getOutgoingEdges(Object v)
          A Collection of indices (Integer objects) of edges going out of node v.
 Collection getSources()
          The source set s, a collection of nodes in the strategy graph S.
 StrategyGraphI getStrategyGraph()
          The strategy graph S.
 Collection getTargets()
          The target set t, a collection of nodes in the strategy graph S.
 boolean meetsConstraint(int i, EdgeI e, NameMapI N)
          Is the element predicate for the ith edge in the strategy graph true for the class graph edge e, using name map N?
 boolean meetsConstraint(int i, Object v, NameMapI N)
          Is the element predicate for the ith edge in the strategy graph true for the class graph node v, using name map N?
 boolean meetsConstraint(Object a, EdgeI e, NameMapI N)
          Is the element predicate for the node a in the strategy graph true for the class graph edge e, using name map N?
 boolean meetsConstraint(Object a, Object v, NameMapI N)
          Is the element predicate for the node a in the strategy graph true for the class graph node v, using name map N?
 int numEdges()
          The number of edges in the strategy graph.
static StrategyGraph parse(InputStream in)
           
static StrategyGraph parse(Reader in)
           
static StrategyGraph parse(String s)
           
 void set_edges(edu.neu.ccs.demeter.aplib.sg.SGEdge_SList new_edges)
           
 SimpleStrategyI toSimpleStrategy()
           
 String toString()
           
 
Methods inherited from class edu.neu.ccs.demeter.aplib.sg.SimpleStrategy
get_parsedNameMap, getAllNames, getSourceNames, getTargetNames, isSimpleStrategy, set_parsedNameMap
 
Methods inherited from class edu.neu.ccs.demeter.aplib.sg.Strategy
__trav_attachEnv, clone, fromString, fromString, isStrategyCombination, readFrom, readFrom, readFrom, readFrom, toStrategyCombination
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.neu.ccs.demeter.aplib.StrategyI
isSimpleStrategy, isStrategyCombination, toStrategyCombination
 

Field Detail

edges

protected edu.neu.ccs.demeter.aplib.sg.SGEdge_SList edges
Constructor Detail

StrategyGraph

public StrategyGraph(edu.neu.ccs.demeter.aplib.sg.NameMap parsedNameMap,
                     edu.neu.ccs.demeter.aplib.sg.SGEdge_SList edges)

StrategyGraph

public StrategyGraph()
Method Detail

get_edges

public edu.neu.ccs.demeter.aplib.sg.SGEdge_SList get_edges()

set_edges

public void set_edges(edu.neu.ccs.demeter.aplib.sg.SGEdge_SList new_edges)

parse

public static StrategyGraph parse(Reader in)
                           throws ParseException
ParseException

parse

public static StrategyGraph parse(InputStream in)
                           throws ParseException
ParseException

parse

public static StrategyGraph parse(String s)

addEdge

public void addEdge(edu.neu.ccs.demeter.aplib.sg.SGEdge edge)

toSimpleStrategy

public SimpleStrategyI toSimpleStrategy()
Specified by:
toSimpleStrategy in interface StrategyI
Overrides:
toSimpleStrategy in class Strategy

getStrategyGraph

public StrategyGraphI getStrategyGraph()
Description copied from interface: SimpleStrategyI
The strategy graph S.

Specified by:
getStrategyGraph in interface SimpleStrategyI

getSources

public Collection getSources()
Description copied from interface: SimpleStrategyI
The source set s, a collection of nodes in the strategy graph S.

Specified by:
getSources in interface SimpleStrategyI

getTargets

public Collection getTargets()
Description copied from interface: SimpleStrategyI
The target set t, a collection of nodes in the strategy graph S.

Specified by:
getTargets in interface SimpleStrategyI

getNames

public Collection getNames(Object v)
Description copied from interface: SimpleStrategyI
The set N(v), a collection of symbolic names (strings) corresponding to node v in the strategy graph S. Return null if v is a wildcard node, intended to map to all class graph nodes.

Specified by:
getNames in interface SimpleStrategyI

getConstraintMap

public ConstraintMapI getConstraintMap()
Description copied from interface: SimpleStrategyI
The constraint map B. Return null for Btrue, in which all predicates return true.

Specified by:
getConstraintMap in interface SimpleStrategyI

getNodes

public Collection getNodes()
Description copied from interface: StrategyGraphI
A Collection of nodes in the strategy graph.

Specified by:
getNodes in interface StrategyGraphI

getIncomingEdges

public Collection getIncomingEdges(Object v)
Description copied from interface: StrategyGraphI
A Collection of indices (Integer objects) of edges coming into node v. Return an empty list if there are no incoming edges, null if there is no such node.

Specified by:
getIncomingEdges in interface StrategyGraphI

getOutgoingEdges

public Collection getOutgoingEdges(Object v)
Description copied from interface: StrategyGraphI
A Collection of indices (Integer objects) of edges going out of node v. Return an empty list if there are no outgoing edges, null if there is no such node.

Specified by:
getOutgoingEdges in interface StrategyGraphI

numEdges

public int numEdges()
Description copied from interface: StrategyGraphI
The number of edges in the strategy graph.

Specified by:
numEdges in interface StrategyGraphI

getEdgeSource

public Object getEdgeSource(int i)
Description copied from interface: StrategyGraphI
The source node of edge number i.

Specified by:
getEdgeSource in interface StrategyGraphI

getEdgeTarget

public Object getEdgeTarget(int i)
Description copied from interface: StrategyGraphI
The target node of edge number i.

Specified by:
getEdgeTarget in interface StrategyGraphI

meetsConstraint

public boolean meetsConstraint(int i,
                               Object v,
                               NameMapI N)
Description copied from interface: ConstraintMapI
Is the element predicate for the ith edge in the strategy graph true for the class graph node v, using name map N?

Specified by:
meetsConstraint in interface ConstraintMapI

meetsConstraint

public boolean meetsConstraint(int i,
                               EdgeI e,
                               NameMapI N)
Description copied from interface: ConstraintMapI
Is the element predicate for the ith edge in the strategy graph true for the class graph edge e, using name map N?

Specified by:
meetsConstraint in interface ConstraintMapI

meetsConstraint

public boolean meetsConstraint(Object a,
                               Object v,
                               NameMapI N)
Description copied from interface: ConstraintMapI
Is the element predicate for the node a in the strategy graph true for the class graph node v, using name map N?

Specified by:
meetsConstraint in interface ConstraintMapI

meetsConstraint

public boolean meetsConstraint(Object a,
                               EdgeI e,
                               NameMapI N)
Description copied from interface: ConstraintMapI
Is the element predicate for the node a in the strategy graph true for the class graph edge e, using name map N?

Specified by:
meetsConstraint in interface ConstraintMapI

toString

public String toString()
Overrides:
toString in class Object