|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.electric.tool.ncc.strategy.Strategy
public abstract class Strategy
Strategy is the superclass for all strategies. The Strategy classes implement a doFor method for each level of the EquivRecord tree: Integer doFor(NetObject) Each of these does a call-back to the apply(Strategy) method of its class which actually computes the appropriate answer, perhaps by doFor calls, for each of its children, accumulating the answers. Strategy keeps track of the depth in the tree, giving reports when depth == 0. Because of that, calls to Strategy.doFor(Record) produce a single combined report, but calls to Record.apply(Strategy) produce multiple reports.
Field Summary | |
---|---|
static java.lang.Integer |
CODE_ERROR
|
static java.lang.Integer |
CODE_NO_CHANGE
|
protected int |
depth
|
NccGlobals |
globals
|
Constructor Summary | |
---|---|
protected |
Strategy(NccGlobals globals)
Simple stratgies may pass in null for globals. |
Method Summary | |
---|---|
java.util.HashMap<java.lang.Integer,java.util.List<NetObject>> |
doFor(Circuit c)
Method doFor(Circuit) process a single Circuit, dividing the circuit according to this strategy, and placing the NetObjects of the Circuit into new Circuits mapped in the return according to the separation Integer. |
LeafList |
doFor(EquivRecord rr)
Method doFor(EquivRecord) processes a single EquivRecord. |
LeafList |
doFor(java.util.Iterator<EquivRecord> it)
|
java.lang.Integer |
doFor(NetObject n)
doFor(NetObject) tests the NetObject to decide its catagory. |
LeafList |
doFor(RecordList r)
Apply this Strategy to a list of leaf and internal records. |
protected long |
elapsedTime()
|
void |
error(boolean pred,
java.lang.String msg)
Die if error occurs |
protected int |
getDepth()
|
protected java.lang.String |
offspringStats(LeafList el)
|
protected void |
startTime(java.lang.String strat,
java.lang.String target)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.Integer CODE_ERROR
public static final java.lang.Integer CODE_NO_CHANGE
protected int depth
public NccGlobals globals
Constructor Detail |
---|
protected Strategy(NccGlobals globals)
Method Detail |
---|
protected int getDepth()
public void error(boolean pred, java.lang.String msg)
pred
- true if error occursmsg
- message to print if error occurspublic LeafList doFor(RecordList r)
r
- a RecordList of EquivRecords to process
public LeafList doFor(java.util.Iterator<EquivRecord> it)
public LeafList doFor(EquivRecord rr)
rr
- the EquivRecord to process
public java.util.HashMap<java.lang.Integer,java.util.List<NetObject>> doFor(Circuit c)
c
- the Circuit to process.
public java.lang.Integer doFor(NetObject n)
n
- the NetObject to catagorize
protected java.lang.String offspringStats(LeafList el)
protected void startTime(java.lang.String strat, java.lang.String target)
protected long elapsedTime()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |