harpoon.Tools.PatMat
Class Spec.DetailWeight

java.lang.Object
  extended by harpoon.Tools.PatMat.Spec.Detail
      extended by harpoon.Tools.PatMat.Spec.DetailWeight
Enclosing class:
Spec

public static class Spec.DetailWeight
extends Spec.Detail

Extension of Spec.Detail that stores a (name,weight) pair. This weight can be used by the Instruction Generator to choose one pattern over another if it is attempting to optimize for the property (speed, size, etc) given in name.

syntax: %weight < ID , WEIGHT >


Field Summary
 String name
          Describes what metric value is measuring.
 double value
          The weight associated with name.
 
Constructor Summary
Spec.DetailWeight(String name, double value)
          Constructs a new Spec.DetailWeight.
 
Method Summary
 void accept(Spec.DetailVisitor v)
          Applies v's visit method to this.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

public final String name
Describes what metric value is measuring.


value

public final double value
The weight associated with name.

Constructor Detail

Spec.DetailWeight

public Spec.DetailWeight(String name,
                         double value)
Constructs a new Spec.DetailWeight.

Parameters:
name - Metric that value is measuring.
value - Weight associated with name.
Method Detail

accept

public void accept(Spec.DetailVisitor v)
Description copied from class: Spec.Detail
Applies v's visit method to this. This is effectively a gludge to emulate multiple dispatch. Must be reimplemented by all subclasses of Spec.Detail.
effects: Calls v.visit(this).

Specified by:
accept in class Spec.Detail
See Also:
"Design Patterns pgs. 331-344"

toString

public String toString()
Overrides:
toString in class Object