SandMark version 2.0


sandmark
Class Algorithm

java.lang.Object
  |
  +--sandmark.Algorithm
Direct Known Subclasses:
GeneralObfuscator, GeneralWatermarker

public abstract class Algorithm
extends java.lang.Object

The Algorithm class encapsulates common characteristics of all Sandmark algorithms. Most of this information is about the description of the algorithm, while some of the information is about the algorithm's interaction with other Sandmark algorithms (dependencies and interferrence).

Author:
Kelly Heffner (kheffner@cs.arizona.edu)

Constructor Summary
Algorithm()
           
 
Method Summary
abstract  java.lang.String getAlgHTML()
          Gives a description of what the algorithm does.
abstract  java.lang.String getAlgURL()
          Specifies the URL of where the user can find more information about the algorithm.
 java.lang.String getAuthor()
          Specifies the author of the algorithm.
 java.lang.String getAuthorEmail()
          Specifies the email address author of the algorithm.
abstract  ConfigProperties getConfigProperties()
          Gets the ConfigProperties object which specifies the parameters for this run of the algorithm.
 java.lang.String getDescription()
          Specifies what this algorithm does, briefly.
abstract  java.lang.String getLongName()
          Specifies this algorithm's long name.
 ModificationProperty[] getMutations()
          Specifies the types of modifications that the algorithm makes.
 RequisiteProperty[] getPostprohibited()
          Specifies a list of properties of algorithms that cannot be run on the target code after this algorithm is run.
 RequisiteProperty[] getPostrequisites()
          Specifies a list of properties of algorithms that must be run on the target code after this algorithm is run.
 RequisiteProperty[] getPostsuggestions()
          Specifies a list of properties of algorithms that should be run on the target code after this algorithm is run, but are not necessary.
 RequisiteProperty[] getPreprohibited()
          Specifies a list of properties of algorithms that cannot be run on the target code before this algorithm is run.
 RequisiteProperty[] getPrerequisites()
          Specifies a list of properties of algorithms that must be run on the target code before this algorithm is run.
 RequisiteProperty[] getPresuggestions()
          Specifies a list of properties of algorithms that should be run on the target code before this algorithm is run, but are not necessary.
 java.lang.String[] getReferences()
          Specifies any references that discuss the ideas in this algorithm.
abstract  java.lang.String getShortName()
          Specifies this algorithm's short name.
abstract  void setConfigProperties(ConfigProperties props)
          Sets the ConfigProperties object which specifies the parameters for this run of the algorithm.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Algorithm

public Algorithm()
Method Detail

getShortName

public abstract java.lang.String getShortName()
Specifies this algorithm's short name. A short name should be no longer than 20 characters, and contain capitalized space delimited words (i.e. title case). For example, an obfuscation that sets all of the fields in a jar file to public scoping should have a short name like "Set Fields Public".

Returns:
the short name for this algorithm

getLongName

public abstract java.lang.String getLongName()
Specifies this algorithm's long name. There is no limit on the size of the long name, but it should be in title case.

Returns:
the long name for this algorithm

getAlgHTML

public abstract java.lang.String getAlgHTML()
Gives a description of what the algorithm does. This should not be a long description of what your code does, rather a brief description as to what effect it has on the program. For example, a good algorithm description would be "Set Fields Public changes the scope of all static and non-static fields to public."; a bad algorithm description would be "Set Fields Public creates a BCEL object for each class and makes modifications to it, then stores it back into the jar file."

Returns:
an HTML formatted description of what the algorithm does.

getAlgURL

public abstract java.lang.String getAlgURL()
Specifies the URL of where the user can find more information about the algorithm. This URL should point to the help.html file in the doc directory where the algorithm resides, starting from the sandmark directory. For example, the URL for the static_template watermarking sample would be sandmark/watermark/static_template/doc/help.html

Returns:
a URL to the help.html file for the algorithm

getConfigProperties

public abstract ConfigProperties getConfigProperties()
Gets the ConfigProperties object which specifies the parameters for this run of the algorithm.

Returns:
the parameters for this run of the algorithm

setConfigProperties

public abstract void setConfigProperties(ConfigProperties props)
Sets the ConfigProperties object which specifies the parameters for this run of the algorithm.

Parameters:
props - the parameters for this run of the algorithm

getAuthor

public java.lang.String getAuthor()
Specifies the author of the algorithm.

Returns:
the name of the author of the algorithm

getAuthorEmail

public java.lang.String getAuthorEmail()
Specifies the email address author of the algorithm.

Returns:
the email address of the author of the algorithm

getDescription

public java.lang.String getDescription()
Specifies what this algorithm does, briefly. This description is displayed to the user in the log of execution in Sandmark.

Returns:
a brief description of the algorithm

getReferences

public java.lang.String[] getReferences()
Specifies any references that discuss the ideas in this algorithm.

Returns:
a list of references

getMutations

public ModificationProperty[] getMutations()
Specifies the types of modifications that the algorithm makes. For more information see ModificationProperty. NOTE: This method will be tagged abstract as of 06/05/2002; at that time, all Sandmark algorithms should provide their own implementation.

Returns:
a list of mutations that this algorithm may do on the code

getPrerequisites

public RequisiteProperty[] getPrerequisites()
Specifies a list of properties of algorithms that must be run on the target code before this algorithm is run. See RequisiteProperty for more details. This method should only be overridden if the algorithm has prerequisites.

Returns:
a list of prerequisites for this algorithm

getPostrequisites

public RequisiteProperty[] getPostrequisites()
Specifies a list of properties of algorithms that must be run on the target code after this algorithm is run. See RequisiteProperty for more details. This method should only be overridden if the algorithm has postrequisites.

Returns:
a list of postrequisites for this algorithm

getPresuggestions

public RequisiteProperty[] getPresuggestions()
Specifies a list of properties of algorithms that should be run on the target code before this algorithm is run, but are not necessary. See RequisiteProperty for more details. This method should only be overridden if the algorithm has a nonempty set of pre-suggestions.

Returns:
a list of suggested algorithm properties to run before this algorithm.

getPostsuggestions

public RequisiteProperty[] getPostsuggestions()
Specifies a list of properties of algorithms that should be run on the target code after this algorithm is run, but are not necessary. See RequisiteProperty for more details. This method should only be overridden if the algorithm has a nonempty set of post-suggestions.

Returns:
a list of suggested algorithm properties to run after this algorithm.

getPreprohibited

public RequisiteProperty[] getPreprohibited()
Specifies a list of properties of algorithms that cannot be run on the target code before this algorithm is run. See RequisiteProperty for more details. This method should only be overridden if there is a nonempty set of prohibited algorithms.

Returns:
a list of prohibited algorithms to run before this algorithm

getPostprohibited

public RequisiteProperty[] getPostprohibited()
Specifies a list of properties of algorithms that cannot be run on the target code after this algorithm is run. See RequisiteProperty for more details. This method should only be overridden if there is a nonempty set of prohibited algorithms.

Returns:
a list of prohibited algorithms to run after this algorithm

SandMark version 2.0

Mon Jun 17 12:30:47 MST 2002