SandMark version 3.0


sandmark.watermark.util
Class MethodMarker

java.lang.Object
  |
  +--sandmark.watermark.util.MethodMarker
Direct Known Subclasses:
EveryBlockMarker

public abstract class MethodMarker
extends java.lang.Object

Subclasses of this class are used to encode integral values in methods.

See Also:
MethodCFG

Constructor Summary
MethodMarker()
           
 
Method Summary
abstract  void embed(MethodCFG m, de.fub.bytecode.generic.ClassGen cg, java.math.BigInteger value)
          Attempts to encode the given value in the given method.
 void embed(MethodCFG m, de.fub.bytecode.generic.ClassGen cg, long value)
          Attempts to encode the given value in the given method.
abstract  int getCapacity(MethodCFG m)
          Returns the number of bits that can be encoded into the given method.
abstract  java.util.Iterator recognize(MethodCFG m)
          Returns an Iterator over all values found to be embedded in the given method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodMarker

public MethodMarker()
Method Detail

embed

public abstract void embed(MethodCFG m,
                           de.fub.bytecode.generic.ClassGen cg,
                           java.math.BigInteger value)
Attempts to encode the given value in the given method. The method is modified in place. If the number of bits in the given value exceeds that of the value returned by getCapacity(), an IllegalArgumentException will be thrown.

Parameters:
m - method to encode data in
cg - class the method comes from
value - data to encode
Throws:
java.lang.IllegalArgumentException - if value has too many bits
See Also:
getCapacity(sandmark.util.controlflowgraph.MethodCFG)

embed

public final void embed(MethodCFG m,
                        de.fub.bytecode.generic.ClassGen cg,
                        long value)
Attempts to encode the given value in the given method. The method is modified in place. If the number of bits in the given value exceeds that of the value returned by getCapacity(), an IllegalArgumentException will be thrown.

This method is implemented with a call to embed(MethodCFG, ClassGen, BigInteger).

Parameters:
m - method to encode data in
cg - class the method comes from
value - data to encode
Throws:
java.lang.IllegalArgumentException - if value has too many bits
See Also:
getCapacity(sandmark.util.controlflowgraph.MethodCFG)

recognize

public abstract java.util.Iterator recognize(MethodCFG m)
Returns an Iterator over all values found to be embedded in the given method. Only values embedded using the marking scheme used by this marker will be reported.

Parameters:
m - method to search for marks in

getCapacity

public abstract int getCapacity(MethodCFG m)
Returns the number of bits that can be encoded into the given method.

Parameters:
m - method to report the bit capacity of
See Also:
embed(sandmark.util.controlflowgraph.MethodCFG, de.fub.bytecode.generic.ClassGen, java.math.BigInteger), embed(sandmark.util.controlflowgraph.MethodCFG, de.fub.bytecode.generic.ClassGen, long)

SandMark version 3.0

Wed Jan 29 10:30:05 MST 2003