Class DefaultLocalCreation


  • public class DefaultLocalCreation
    extends LocalCreation
    provides an easy interface to handle new var-names. New names are automatically added to the chain, and the provided locals are guaranteed to have a unique name.
    • Constructor Detail

      • DefaultLocalCreation

        public DefaultLocalCreation​(Collection<Local> locals)
        all actions are done on the given locals-chain. as prefix the DEFAULT-PREFIX will be used.
        Parameters:
        locals - the locals-chain of a Jimple-body
      • DefaultLocalCreation

        public DefaultLocalCreation​(Collection<Local> locals,
                                    String prefix)
        whenever newLocal(type) will be called, the given prefix is used.
        Parameters:
        locals - the locals-chain of a Jimple-body
        prefix - prefix overrides the DEFAULT-PREFIX
    • Method Detail

      • newLocal

        public Local newLocal​(Type type)
        Description copied from class: LocalCreation
        returns a new local with the prefix given to the constructor (or the default-prefix if none has been given) and the given type.
        The returned local will automatically added to the locals-chain.
        The local will be of the form: prefixX (where the last X is a number, so the local name is unique).
        Specified by:
        newLocal in class LocalCreation
        Parameters:
        type - the Type of the new local.
        Returns:
        a new local with a unique name and the given type.
      • newLocal

        public Local newLocal​(String prefix,
                              Type type)
        Description copied from class: LocalCreation
        returns a new local with the given prefix and the given type.
        the returned local will automatically added to the locals-chain. The local will be of the form: prefixX (where the last X is a number, so the localname is unique).
        Specified by:
        newLocal in class LocalCreation
        Parameters:
        prefix - the prefix for the now local.
        type - the Type of the now local.
        Returns:
        a local with the given prefix and the given type.