org.kit.furia.fragment.asm
Class AbstractFunction

java.lang.Object
  extended by org.kit.furia.fragment.asm.AbstractFunction
All Implemented Interfaces:
FValue, org.objectweb.asm.tree.analysis.Value
Direct Known Subclasses:
FunctionValue, PhiFunctionValue

public abstract class AbstractFunction
extends java.lang.Object
implements FValue

AbstractFunction holds common logic for representing functions.

Author:
Arnoldo Jose Muller Molina

Field Summary
protected  java.util.List<org.objectweb.asm.tree.analysis.Value> params
           
protected  java.util.Set<org.objectweb.asm.tree.analysis.Value> paramSet
           
 
Constructor Summary
protected AbstractFunction()
           
 
Method Summary
 void addParam(org.objectweb.asm.tree.analysis.Value param)
          Adds a new parameter to this function.
protected abstract  boolean equalFunctions(org.objectweb.asm.tree.analysis.Value x)
          Returns true if the function identifiers are equal.
 int getSize()
           
protected abstract  int hashCodeFunctionName()
          Generate the hash code for the function name.
protected abstract  java.lang.String printFunctionName()
          Returns the string representation of the function name.
 void toFragment(java.lang.StringBuilder result, java.util.Set visited, IntegerHolder count, int max)
          Prints the fragment into the given result.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

params

protected java.util.List<org.objectweb.asm.tree.analysis.Value> params

paramSet

protected java.util.Set<org.objectweb.asm.tree.analysis.Value> paramSet
Constructor Detail

AbstractFunction

protected AbstractFunction()
Method Detail

addParam

public void addParam(org.objectweb.asm.tree.analysis.Value param)
Adds a new parameter to this function.

Parameters:
param - the new parameter.

getSize

public int getSize()
Specified by:
getSize in interface org.objectweb.asm.tree.analysis.Value

printFunctionName

protected abstract java.lang.String printFunctionName()
Returns the string representation of the function name.

Returns:
string representation of the function name.

equalFunctions

protected abstract boolean equalFunctions(org.objectweb.asm.tree.analysis.Value x)
Returns true if the function identifiers are equal.

Parameters:
x -
Returns:

hashCodeFunctionName

protected abstract int hashCodeFunctionName()
Generate the hash code for the function name.


toFragment

public void toFragment(java.lang.StringBuilder result,
                       java.util.Set visited,
                       IntegerHolder count,
                       int max)
                throws HugeFragmentException
Prints the fragment into the given result.

Specified by:
toFragment in interface FValue
Parameters:
result - The resulting string representation of the given expression.
visited - A set used to control recursive references.
count - The number of "expansions" that have been executed.
max - The maximum number of expansions that will be executed.
Throws:
HugeFragmentException


Copyright © 2008 Arnoldo Jose Muller Molina. All Rights Reserved.