org.jf.baksmali.Adaptors
Class RegisterFormatter

java.lang.Object
  extended by org.jf.baksmali.Adaptors.RegisterFormatter

public class RegisterFormatter
extends java.lang.Object

This class contains the logic used for formatting registers


Field Summary
 baksmaliOptions options
           
 int parameterRegisterCount
           
 int registerCount
           
 
Constructor Summary
RegisterFormatter(baksmaliOptions options, int registerCount, int parameterRegisterCount)
           
 
Method Summary
 void writeRegisterRange(org.jf.util.IndentingWriter writer, int startRegister, int lastRegister)
          Write out the register range value used by Format3rc.
 void writeTo(org.jf.util.IndentingWriter writer, int register)
          Writes a register with the appropriate format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

options

@Nonnull
public final baksmaliOptions options

registerCount

public final int registerCount

parameterRegisterCount

public final int parameterRegisterCount
Constructor Detail

RegisterFormatter

public RegisterFormatter(@Nonnull
                         baksmaliOptions options,
                         int registerCount,
                         int parameterRegisterCount)
Method Detail

writeRegisterRange

public void writeRegisterRange(org.jf.util.IndentingWriter writer,
                               int startRegister,
                               int lastRegister)
                        throws java.io.IOException
Write out the register range value used by Format3rc. If baksmali.noParameterRegisters is true, it will always output the registers in the v format. But if false, then it will check if *both* registers are parameter registers, and if so, use the p format for both. If only the last register is a parameter register, it will use the v format for both, otherwise it would be confusing to have something like {v20 .. p1}

Parameters:
writer - the IndentingWriter to write to
startRegister - the first register in the range
lastRegister - the last register in the range
Throws:
java.io.IOException

writeTo

public void writeTo(org.jf.util.IndentingWriter writer,
                    int register)
             throws java.io.IOException
Writes a register with the appropriate format. If baksmali.noParameterRegisters is true, then it will always output a register in the v format. If false, then it determines if the register is a parameter register, and if so, formats it in the p format instead.

Parameters:
writer - the IndentingWriter to write to
register - the register number
Throws:
java.io.IOException