harpoon.Analysis.Transformation
Class MethodSplitter.Token

java.lang.Object
  extended by harpoon.Analysis.Transformation.MethodSplitter.Token
All Implemented Interfaces:
Serializable
Enclosing class:
MethodSplitter

protected abstract static class MethodSplitter.Token
extends Object
implements Serializable

Subclasses of MethodSplitter refer to "versions" of the underlying method which may be named by creating static instances of this MethodSplitter.Token class. The argument to the constructor specifies a default suffix for the newly-split method's name. Don't forget to extend MethodSplitter.isValidToken() to include your new MethodSplitter.Token subclasses.

A typical subclass of MethodSplitter will include the following code fragment:

  public class FooBlah extends MethodSplitter {
    /** Token for the foo-blah version of a method. */
    public static final Token FOOBLAH = new Token("fooblah") {
      /** This ensures that FOOBLAH is a singleton object. */
      public Object readResolve() { return FOOBLAH; }
    };
    /** Checks the token types handled by this 
     *  MethodSplitter subclass. */
    protected boolean isValidToken(Token which) {
      return which==FOOBLAH || super.isValidToken(which);
    };
  };
  

See Also:
Serialized Form

Constructor Summary
protected MethodSplitter.Token(String suggestedSuffix)
          Create a token, specifying the suggested method suffix.
 
Method Summary
protected abstract  Object readResolve()
          This method must be overridden to ensure that Tokens are still singletons after deserialization.
 String toString()
          Returns a human-readable representation of this token.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MethodSplitter.Token

protected MethodSplitter.Token(String suggestedSuffix)
Create a token, specifying the suggested method suffix.

Method Detail

readResolve

protected abstract Object readResolve()
This method must be overridden to ensure that Tokens are still singletons after deserialization. See the template in the class description above.


toString

public String toString()
Returns a human-readable representation of this token.

Overrides:
toString in class Object