emma

{
  public static final String ATTRIBUTE_CODE = "Code";
  public static final String ATTRIBUTE_CONSTANT_VALUE = "ConstantValue";
  public static final String ATTRIBUTE_LINE_NUMBER_TABLE = "LineNumberTable";
  public static final String ATTRIBUTE_EXCEPTIONS = "Exceptions";
  public static final String ATTRIBUTE_SYNTHETIC = "Synthetic";
  public static final String ATTRIBUTE_BRIDGE = "Bridge";
  public static final String ATTRIBUTE_SOURCEFILE = "SourceFile";
  public static final String ATTRIBUTE_INNERCLASSES = "InnerClasses";
  public int m_name_index;
  protected long m_attribute_length;
  
  public String getName(ClassDef cls)
  {
    return getConstantsgetm_name_index)).m_value;
  }
  
  public abstract long length();
  
  public abstract void accept(IAttributeVisitor paramIAttributeVisitor, Object paramObject);
  
  public abstract String toString();
  
  public static Attribute_info new_Attribute_info(IConstantCollection constants, UDataInputStream bytes)
    throws IOException
  {
    int attribute_name_index = bytes.readU2();
    long attribute_length = bytes.readU4();
    
    CONSTANT_Utf8_info attribute_name = (CONSTANT_Utf8_info)constants.get(attribute_name_index);
    String name = m_value;
    if ("Code".equals(name)) {
      return new CodeAttribute_info(constants, attribute_name_index, attribute_length, bytes);
    }
    if ("ConstantValue".equals(name)) {
      return new ConstantValueAttribute_info(attribute_name_index, attribute_length, bytes);
    }
    if ("Exceptions".equals(name)) {
      return new ExceptionsAttribute_info(attribute_name_index, attribute_length, bytes);
    }
    if ("InnerClasses".equals(name)) {
      return new InnerClassesAttribute_info(attribute_name_index, attribute_length, bytes);
    }
    if ("Synthetic".equals(name)) {
      return new SyntheticAttribute_info(attribute_name_index, attribute_length);
    }
    if ("Bridge".equals(name)) {
      return new BridgeAttribute_info(attribute_name_index, attribute_length);
    }
    if ("LineNumberTable".equals(name)) {
      return new LineNumberTableAttribute_info(attribute_name_index, attribute_length, bytes);
    }
    if ("SourceFile".equals(name)) {
      return new SourceFileAttribute_info(attribute_name_index, attribute_length, bytes);
    }
    return new GenericAttribute_info(attribute_name_index, attribute_length, bytes);
  }
  
  public Object clone()
  {
    try
    {
      return super.clone();
    }
    catch (CloneNotSupportedException e)
    {
      throw new InternalError(e.toString());
    }
  }
  
  public void writeInClassFormat(UDataOutputStream out)
    throws IOException
  {
    out.writeU2(m_name_index);
    out.writeU4(length() - 6L);
  }
  
  protected Attribute_info(int attribute_name_index, long attribute_length)
  {
    m_name_index = attribute_name_index;
    m_attribute_length = attribute_length;
  }
}

/* Location:
 * Qualified Name:     com.vladium.jcd.cls.attribute.Attribute_info
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.cls.attribute;

import com.vladium.jcd.lib.UDataOutputStream;
import java.io.IOException;

public final class BridgeAttribute_info
  extends Attribute_info
{
  public BridgeAttribute_info(int attribute_name_index)
  {
    super(attribute_name_index, 0L);
  }
  
  public long length()
  {
    return 6L;
  }
  
  public void accept(IAttributeVisitor visitor, Object ctx)
  {
    visitor.visit(this, ctx);
  }
  
  public String toString()
  {
    return "BridgeAttribute_info: [attribute_name_index = " + m_name_index + ", attribute_length = " + m_attribute_length + ']';
  }
  
  public Object clone()
  {
    return super.clone();
  }
  
  public void writeInClassFormat(UDataOutputStream out)
    throws IOException
  {
    super.writeInClassFormat(out);
  }
  
  BridgeAttribute_info(int attribute_name_index, long attribute_length)
  {
    super(attribute_name_index, attribute_length);
  }
}

/* Location:
 * Qualified Name:     com.vladium.jcd.cls.attribute.BridgeAttribute_info
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.cls.attribute;

import com.vladium.jcd.cls.ElementFactory;
import com.vladium.jcd.cls.IAttributeCollection;
import com.vladium.jcd.cls.IConstantCollection;
import com.vladium.jcd.lib.UDataInputStream;
import com.vladium.jcd.lib.UDataOutputStream;
import java.io.IOException;

public final class CodeAttribute_info
  extends Attribute_info
{
  public static final byte[] EMPTY_BYTE_ARRAY = new byte[0];
  public int m_max_stack;
  public int m_max_locals;
  private byte[] m_code;
  private int m_codeSize;
  private IExceptionHandlerTable m_exceptionHandlerTable;
  private IAttributeCollection m_attributes;
  private static final boolean DEBUG = false;
  
  public CodeAttribute_info(int attribute_name_index, int max_stack, int max_locals, byte[] code, IExceptionHandlerTable exceptionHandlerTable, IAttributeCollection attributes)
  {
    super(attribute_name_index, 8 + (code != null ? code.length : 0) + exceptionHandlerTable.length() + attributes.length());
    
    m_max_stack = max_stack;
    m_max_locals = max_locals;
    
    m_code = (code != null ? code : EMPTY_BYTE_ARRAY);
    m_codeSize = m_code.length;
    
    m_exceptionHandlerTable = exceptionHandlerTable;
    m_attributes = attributes;
  }
  
  public final byte[] getCode()
  {
    return m_code;
  }
  
  public final int getCodeSize()
  {
    return m_codeSize;
  }
  
  public IAttributeCollection getAttributes()
  {
    return m_attributes;
  }
  
  public IExceptionHandlerTable getExceptionTable()
  {
    return m_exceptionHandlerTable;
  }
  
  public long length()
  {
    return 14 + m_codeSize + m_exceptionHandlerTable.length() + m_attributes.length();
  }
  
  public void accept(IAttributeVisitor visitor, Object ctx)
  {
    visitor.visit(this, ctx);
  }
  
  public String toString()
  {
    String eol = System.getProperty("line.separator");
    
    StringBuffer s = new StringBuffer();
    
    s.append("CodeAttribute_info: [attribute_name_index = " + m_name_index + ", attribute_length = " + m_attribute_length + "]" + eol);
    s.append("    max_stack/max_locals = " + m_max_stack + '/' + m_max_locals + eol);
    s.append("    code [length " + m_codeSize + "]" + eol);
    for (int a = 0; a < m_attributes.size(); a++) {
      s.append("         " + m_attributes.get(a) + eol);
    }
    return s.toString();
  }
  
  public Object clone()
  {
    CodeAttribute_info _clone = (CodeAttribute_info)super.clone();
    
    m_code = (m_codeSize == 0 ? EMPTY_BYTE_ARRAY : (byte[])m_code.clone());
    m_exceptionHandlerTable = ((IExceptionHandlerTable)m_exceptionHandlerTable.clone());
    m_attributes = ((IAttributeCollection)m_attributes.clone());
    
    return _clone;
  }
  
  public void writeInClassFormat(UDataOutputStream out)
    throws IOException
  {
    super.writeInClassFormat(out);
    
    out.writeU2(m_max_stack);
    out.writeU2(m_max_locals);
    
    out.writeU4(m_codeSize);
    out.write(m_code, 0, m_codeSize);
    
    m_exceptionHandlerTable.writeInClassFormat(out);
    m_attributes.writeInClassFormat(out);
  }
  
  public void setCode(byte[] code, int codeSize)
  {
    m_code = code;
    m_codeSize = codeSize;
  }
  
  CodeAttribute_info(IConstantCollection constants, int attribute_name_index, long attribute_length, UDataInputStream bytes)
    throws IOException
  {
    super(attribute_name_index, attribute_length);
    
    m_max_stack = bytes.readU2();
    m_max_locals = bytes.readU2();
    
    long code_length = bytes.readU4();
    
    m_code = new byte[(int)code_length];
    bytes.readFully(m_code);
    m_codeSize = ((int)code_length);
    
    int exception_table_length = bytes.readU2();
    m_exceptionHandlerTable = AttributeElementFactory.newExceptionHandlerTable(exception_table_length);
    for (int i = 0; i < exception_table_length; i++)
    {
      Exception_info exception_info = new Exception_info(bytes);
      
      m_exceptionHandlerTable.add(exception_info);
    }
    int attributes_count = bytes.readU2();
    m_attributes = ElementFactory.newAttributeCollection(attributes_count);
    for (int i = 0; i < attributes_count; i++)
    {
      Attribute_info attribute_info = Attribute_info.new_Attribute_info(constants, bytes);
      
      m_attributes.add(attribute_info);
    }
  }
}

/* Location:
 * Qualified Name:     com.vladium.jcd.cls.attribute.CodeAttribute_info
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.cls.attribute;

import com.vladium.jcd.cls.ClassDef;
import com.vladium.jcd.cls.IConstantCollection;
import com.vladium.jcd.cls.constant.CONSTANT_literal_info;
import com.vladium.jcd.lib.UDataInputStream;
import com.vladium.jcd.lib.UDataOutputStream;
import java.io.IOException;

public final class ConstantValueAttribute_info
  extends Attribute_info
{
  public int m_value_index;
  private static final boolean DEBUG = false;
  
  public ConstantValueAttribute_info(int attribute_name_index, int value_index)
  {
    super(attribute_name_index, 2L);
    
    m_value_index = value_index;
  }
  
  public CONSTANT_literal_info getValue(ClassDef cls)
  {
    return (CONSTANT_literal_info)cls.getConstants().get(m_value_index);
  }
  
  public long length()
  {
    return 8L;
  }
  
  public void accept(IAttributeVisitor visitor, Object ctx)
  {
    visitor.visit(this, ctx);
  }
  
  public String toString()
  {
    return "ConstantValueAttribute_info: [attribute_name_index = " + m_name_index + ", attribute_length = " + m_attribute_length + ']';
  }
  
  public Object clone()
  {
    return super.clone();
  }
  
  public void writeInClassFormat(UDataOutputStream out)
    throws IOException
  {
    super.writeInClassFormat(out);
    
    out.writeU2(m_value_index);
  }
  
  ConstantValueAttribute_info(int attribute_name_index, long attribute_length, UDataInputStream bytes)
    throws IOException
  {
    super(attribute_name_index, attribute_length);
    
    m_value_index = bytes.readU2();
  }
}

/* Location:
 * Qualified Name:     com.vladium.jcd.cls.attribute.ConstantValueAttribute_info
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.cls.attribute;

import com.vladium.jcd.lib.UDataOutputStream;
import com.vladium.util.IntVector;
import java.io.IOException;

final class DeclaredExceptionTable
  implements IDeclaredExceptionTable
{
  private IntVector m_exceptions;
  
  public int get(int offset)
  {
    return m_exceptions.get(offset);
  }
  
  public int size()
  {
    return m_exceptions.size();
  }
  
  public long length()
  {
    return 1 + m_exceptions.size() << 1;
  }
  
  public Object clone()
  {
    try
    {
      DeclaredExceptionTable _clone = (DeclaredExceptionTable)super.clone();
      
      m_exceptions = ((IntVector)m_exceptions.clone());
      
      return _clone;
    }
    catch (CloneNotSupportedException e)
    {
      throw new InternalError(e.toString());
    }
  }
  
  public void writeInClassFormat(UDataOutputStream out)
    throws IOException
  {
    int number_of_exceptions = m_exceptions.size();
    out.writeU2(number_of_exceptions);
    for (int i = 0; i < number_of_exceptions; i++) {
      out.writeU2(get(i));
    }
  }
  
  public int add(int exception_index)
  {
    int newoffset = m_exceptions.size();
    m_exceptions.add(exception_index);
    
    return newoffset;
  }
  
  public int set(int offset, int exception_index)
  {
    return m_exceptions.set(offset, exception_index);
  }
  
  DeclaredExceptionTable(int capacity)
  {
    m_exceptions = (capacity < 0 ? new IntVector() : new IntVector(capacity));
  }
}

/* Location:
 * Qualified Name:     com.vladium.jcd.cls.attribute.DeclaredExceptionTable
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.cls.attribute;

import com.vladium.jcd.lib.UDataOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

final class ExceptionHandlerTable
  implements IExceptionHandlerTable
{
  private List m_exceptions;
  
  public Exception_info get(int offset)
  {
    return (Exception_info)m_exceptions.get(offset);
  }
  
  public int size()
  {
    return m_exceptions.size();
  }
  
  public long length()
  {
    return 2 + (m_exceptions.size() << 3);
  }
  
  public Object clone()
  {
    try
    {
      ExceptionHandlerTable _clone = (ExceptionHandlerTable)super.clone();
      
      int exceptions_count = m_exceptions.size();
      m_exceptions = new ArrayList(exceptions_count);
      for (int e = 0; e < exceptions_count; e++) {
        m_exceptions.add(((Exception_info)m_exceptions.get(e)).clone());
      }
      return _clone;
    }
    catch (CloneNotSupportedException e)
    {
      throw new InternalError(e.toString());
    }
  }
  
  public void writeInClassFormat(UDataOutputStream out)
    throws IOException
  {
    int exception_table_length = m_exceptions.size();
    out.writeU2(exception_table_length);
    for (int i = 0; i < exception_table_length; i++) {
      get(i).writeInClassFormat(out);
    }
  }
  
  public int add(Exception_info exception)
  {
    int newoffset = m_exceptions.size();
    m_exceptions.add(exception);
    
    return newoffset;
  }
  
  public Exception_info set(int offset, Exception_info exception)
  {
    return (Exception_info)m_exceptions.set(offset, exception);
  }
  
  ExceptionHandlerTable(int capacity)
  {
    m_exceptions = (capacity < 0 ? new ArrayList() : new ArrayList(capacity));
  }
}

/* Location:
 * Qualified Name:     com.vladium.jcd.cls.attribute.ExceptionHandlerTable
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.cls.attribute;

import com.vladium.jcd.compiler.IClassFormatOutput;
import com.vladium.jcd.lib.UDataInputStream;
import com.vladium.jcd.lib.UDataOutputStream;
import java.io.IOException;

public final class Exception_info
  implements Cloneable, IClassFormatOutput
{
  public int m_start_pc;
  public int m_end_pc;
  public int m_handler_pc;
  public int m_catch_type;
  
  public Exception_info(int start_pc, int end_pc, int handler_pc, int catch_type)
  {
    m_start_pc = start_pc;
    m_end_pc = end_pc;
    m_handler_pc = handler_pc;
    m_catch_type = catch_type;
  }
  
  public String toString()
  {
    return "exception_info: [start_pc/end_pc = " + m_start_pc + '/' + m_end_pc + ", handler_pc = " + m_handler_pc + ", catch_type = " + m_catch_type + ']';
  }
  
  public Object clone()
  {
    try
    {
      return super.clone();
    }
    catch (CloneNotSupportedException e)
    {
      throw new InternalError(e.toString());
    }
  }
  
  public void writeInClassFormat(UDataOutputStream out)
    throws IOException
  {
    out.writeU2(m_start_pc);
    out.writeU2(m_end_pc);
    out.writeU2(m_handler_pc);
    out.writeU2(m_catch_type);
  }
  
  Exception_info(UDataInputStream bytes)
    throws IOException
  {
    m_start_pc = bytes.readU2();
    m_end_pc = bytes.readU2();
    m_handler_pc = bytes.readU2();
    m_catch_type = bytes.readU2();
  }
}

/* Location:
 * Qualified Name:     com.vladium.jcd.cls.attribute.Exception_info
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.cls.attribute;

import com.vladium.jcd.lib.UDataInputStream;
import com.vladium.jcd.lib.UDataOutputStream;
import java.io.IOException;

public final class ExceptionsAttribute_info
  extends Attribute_info
{
  private IDeclaredExceptionTable m_exceptions;
  
  public ExceptionsAttribute_info(int attribute_name_index, IDeclaredExceptionTable exceptions)
  {
    super(attribute_name_index, exceptions.length());
    
    m_exceptions = exceptions;
  }
  
  public IDeclaredExceptionTable getDeclaredExceptions()
  {
    return m_exceptions;
  }
  
  public long length()
  {
    return 6L + m_exceptions.length();
  }
  
  public void accept(IAttributeVisitor visitor, Object ctx)
  {
    visitor.visit(this, ctx);
  }
  
  public String toString()
  {
    return "ExceptionsAttribute_info: [attribute_name_index = " + m_name_index + ", attribute_length = " + m_attribute_length + ']';
  }
  
  public Object clone()
  {
    ExceptionsAttribute_info _clone = (ExceptionsAttribute_info)super.clone();
    
    m_exceptions = ((IDeclaredExceptionTable)m_exceptions.clone());
    
    return _clone;
  }
  
  public void writeInClassFormat(UDataOutputStream out)
    throws IOException
  {
    super.writeInClassFormat(out);
    
    m_exceptions.writeInClassFormat(out);
  }
  
  ExceptionsAttribute_info(int attribute_name_index, long attribute_length, UDataInputStream bytes)
    throws IOException
  {
    super(attribute_name_index, attribute_length);
    
    int number_of_exceptions = bytes.readU2();
    m_exceptions = new DeclaredExceptionTable(number_of_exceptions);
    for (int i = 0; i < number_of_exceptions; i++)
    {
      int exception_index = bytes.readU2();
      
      m_exceptions.add(exception_index);
    }
  }
}

/* Location:
 * Qualified Name:     com.vladium.jcd.cls.attribute.ExceptionsAttribute_info
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.cls.attribute;

import com.vladium.jcd.lib.UDataInputStream;
import com.vladium.jcd.lib.UDataOutputStream;
import java.io.IOException;

public final class GenericAttribute_info
  extends Attribute_info
{
  public byte[] m_info;
  
  public GenericAttribute_info(int attribute_name_index, byte[] info)
  {
    super(attribute_name_index, info != null ? info.length : 0);
    
    m_info = (info != null ? info : EMPTY_BYTE_ARRAY);
  }
  
  public long length()
  {
    return 6 + m_info.length;
  }
  
  public void accept(IAttributeVisitor visitor, Object ctx)
  {
    visitor.visit(this, ctx);
  }
  
  public String toString()
  {
    return "generic attribute_info: [attribute_name_index = " + m_name_index + ", attribute_length = " + m_attribute_length + ']';
  }
  
  public Object clone()
  {
    GenericAttribute_info _clone = (GenericAttribute_info)super.clone();
    
    m_info = (m_info.length == 0 ? EMPTY_BYTE_ARRAY : (byte[])m_info.clone());
    
    return _clone;
  }
  
  public void writeInClassFormat(UDataOutputStream out)
    throws IOException
  {
    super.writeInClassFormat(out);
    
    out.write(m_info, 0, m_info.length);
  }
  
  GenericAttribute_info(int attribute_name_index, long attribute_length, UDataInputStream bytes)
    throws IOException
  {
    super(attribute_name_index, attribute_length);
    
    m_info = new byte[(int)m_attribute_length];
    bytes.readFully(m_info);
  }
  
  private static final byte[] EMPTY_BYTE_ARRAY = new byte[0];
}

/* Location:
 * Qualified Name:     com.vladium.jcd.cls.attribute.GenericAttribute_info
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.cls.attribute;

public abstract interface IAttributeVisitor
{
  public abstract Object visit(GenericAttribute_info paramGenericAttribute_info, Object paramObject);
  
  public abstract Object visit(CodeAttribute_info paramCodeAttribute_info, Object paramObject);
  
  public abstract Object visit(ConstantValueAttribute_info paramConstantValueAttribute_info, Object paramObject);
  
  public abstract Object visit(ExceptionsAttribute_info paramExceptionsAttribute_info, Object paramObject);
  
  public abstract Object visit(LineNumberTableAttribute_info paramLineNumberTableAttribute_info, Object paramObject);
  
  public abstract Object visit(SourceFileAttribute_info paramSourceFileAttribute_info, Object paramObject);
  
  public abstract Object visit(SyntheticAttribute_info paramSyntheticAttribute_info, Object paramObject);
  
  public abstract Object visit(BridgeAttribute_info paramBridgeAttribute_info, Object paramObject);
  
  public abstract Object visit(InnerClassesAttribute_info paramInnerClassesAttribute_info, Object paramObject);
}

/* Location:
 * Qualified Name:     com.vladium.jcd.cls.attribute.IAttributeVisitor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.cls.attribute;

import com.vladium.jcd.compiler.IClassFormatOutput;

public abstract interface IDeclaredExceptionTable
  extends Cloneable, IClassFormatOutput
{
  public abstract int get(int paramInt);
  
  public abstract int size();
  
  public abstract long length();
  
  public abstract Object clone();
  
  public abstract int add(int paramInt);
  
  public abstract int set(int paramInt1, int paramInt2);
}

/* Location:
 * Qualified Name:     com.vladium.jcd.cls.attribute.IDeclaredExceptionTable
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.cls.attribute;

import com.vladium.jcd.compiler.IClassFormatOutput;

public abstract interface IExceptionHandlerTable
  extends Cloneable, IClassFormatOutput
{
  public abstract Exception_info get(int paramInt);
  
  public abstract int size();
  
  public abstract long length();
  
  public abstract Object clone();
  
  public abstract int add(Exception_info paramException_info);
  
  public abstract Exception_info set(int paramInt, Exception_info paramException_info);
}

/* Location:
 * Qualified Name:     com.vladium.jcd.cls.attribute.IExceptionHandlerTable
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.cls.attribute;

import com.vladium.jcd.compiler.IClassFormatOutput;
import com.vladium.jcd.lib.UDataInputStream;
import com.vladium.jcd.lib.UDataOutputStream;
import java.io.IOException;

public final class InnerClass_info
  implements Cloneable, IClassFormatOutput
{
  public int m_outer_class_index;
  public int m_inner_class_index;
  public int m_inner_name_index;
  public int m_inner_access_flags;
  
  public InnerClass_info(int outer_class_index, int inner_class_index, int inner_name_index, int inner_access_flags)
  {
    m_outer_class_index = outer_class_index;
    m_inner_class_index = inner_class_index;
    m_inner_name_index = inner_name_index;
    m_inner_access_flags = inner_access_flags;
  }
  
  public String toString()
  {
    return "innerclass_info: [m_outer_class_index = " + m_outer_class_index + ", m_inner_class_index = " + m_inner_class_index + ", m_inner_name_index = " + m_inner_name_index + ", m_inner_access_flags = " + m_inner_access_flags + "]";
  }
  
  public Object clone()
  {
    try
    {
      return super.clone();
    }
    catch (CloneNotSupportedException e)
    {
      throw new InternalError(e.toString());
    }
  }
  
  public void writeInClassFormat(UDataOutputStream out)
    throws IOException
  {
    out.writeU2(m_inner_class_index);
    out.writeU2(m_outer_class_index);
    out.writeU2(m_inner_name_index);
    out.writeU2(m_inner_access_flags);
  }
  
  InnerClass_info(UDataInputStream bytes)
    throws IOException
  {
    m_inner_class_index = bytes.readU2();
    m_outer_class_index = bytes.readU2();
    m_inner_name_index = bytes.readU2();
    m_inner_access_flags = bytes.readU2();
  }
}

/* Location:
 * Qualified Name:     com.vladium.jcd.cls.attribute.InnerClass_info
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.cls.attribute;

import com.vladium.jcd.lib.UDataInputStream;
import com.vladium.jcd.lib.UDataOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public final class InnerClassesAttribute_info
  extends Attribute_info
{
  private List m_classes;
  
  public boolean makesClassNested(int class_index, int[] nestedAccessFlags)
  {
    if (class_index > 0)
    {
      int i = 0;
      for (int iLimit = size(); i < iLimit; i++)
      {
        InnerClass_info info = get(i);
        if (m_inner_class_index == class_index)
        {
          nestedAccessFlags[0] = m_inner_access_flags;
          return true;
        }
      }
    }
    return false;
  }
  
  public final InnerClass_info get(int offset)
  {
    return (InnerClass_info)m_classes.get(offset);
  }
  
  public final int size()
  {
    return m_classes.size();
  }
  
  public final long length()
  {
    return 8 + (m_classes.size() << 3);
  }
  
  public void accept(IAttributeVisitor visitor, Object ctx)
  {
    visitor.visit(this, ctx);
  }
  
  public String toString()
  {
    StringBuffer s = new StringBuffer("InnerClassesAttribute_info: [attribute_name_index = " + m_name_index + ", attribute_length = " + length() + "]\n");
    for (int l = 0; l < size(); l++)
    {
      s.append("            " + get(l));
      s.append("\n");
    }
    return s.toString();
  }
  
  public Object clone()
  {
    InnerClassesAttribute_info _clone = (InnerClassesAttribute_info)super.clone();
    
    List classes = m_classes;
    
    int class_count = classes.size();
    m_classes = new ArrayList(class_count);
    for (int e = 0; e < class_count; e++) {
      m_classes.add(((InnerClass_info)classes.get(e)).clone());
    }
    return _clone;
  }
  
  public void writeInClassFormat(UDataOutputStream out)
    throws IOException
  {
    super.writeInClassFormat(out);
    
    List classes = m_classes;
    
    int class_count = classes.size();
    out.writeU2(class_count);
    for (int l = 0; l < class_count; l++) {
      ((InnerClass_info)classes.get(l)).writeInClassFormat(out);
    }
  }
  
  InnerClassesAttribute_info(int attribute_name_index, long attribute_length, UDataInputStream bytes)
    throws IOException
  {
    super(attribute_name_index, attribute_length);
    
    int class_count = bytes.readU2();
    List classes = new ArrayList(class_count);
    for (int i = 0; i < class_count; i++) {
      classes.add(new InnerClass_info(bytes));
    }
    m_classes = classes;
  }
}

/* Location:
 * Qualified Name:     com.vladium.jcd.cls.attribute.InnerClassesAttribute_info
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.cls.attribute;

import com.vladium.jcd.lib.UDataInputStream;
import com.vladium.jcd.lib.UDataOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public final class LineNumberTableAttribute_info
  extends Attribute_info
{
  private List m_lines;
  
  public LineNumber_info get(int offset)
  {
    return (LineNumber_info)m_lines.get(offset);
  }
  
  public int size()
  {
    return m_lines.size();
  }
  
  public long length()
  {
    return 8 + (m_lines.size() << 2);
  }
  
  public void accept(IAttributeVisitor visitor, Object ctx)
  {
    visitor.visit(this, ctx);
  }
  
  public String toString()
  {
    StringBuffer s = new StringBuffer("LineNumberTableAttribute_info: [attribute_name_index = " + m_name_index + ", attribute_length = " + length() + "]\n");
    for (int l = 0; l < size(); l++)
    {
      s.append("            " + get(l));
      s.append("\n");
    }
    return s.toString();
  }
  
  public Object clone()
  {
    LineNumberTableAttribute_info _clone = (LineNumberTableAttribute_info)super.clone();
    
    int lines_count = m_lines.size();
    m_lines = new ArrayList(lines_count);
    for (int e = 0; e < lines_count; e++) {
      m_lines.add(((LineNumber_info)m_lines.get(e)).clone());
    }
    return _clone;
  }
  
  public void writeInClassFormat(UDataOutputStream out)
    throws IOException
  {
    super.writeInClassFormat(out);
    
    int lines_count = m_lines.size();
    out.writeU2(lines_count);
    for (int l = 0; l < lines_count; l++) {
      ((LineNumber_info)m_lines.get(l)).writeInClassFormat(out);
    }
  }
  
  LineNumberTableAttribute_info(int attribute_name_index, long attribute_length, UDataInputStream bytes)
    throws IOException
  {
    super(attribute_name_index, attribute_length);
    
    int lines_count = bytes.readU2();
    m_lines = new ArrayList(lines_count);
    for (int i = 0; i < lines_count; i++) {
      m_lines.add(new LineNumber_info(bytes));
    }
  }
}

/* Location:
 * Qualified Name:     com.vladium.jcd.cls.attribute.LineNumberTableAttribute_info
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.cls.attribute;

import com.vladium.jcd.compiler.IClassFormatOutput;
import com.vladium.jcd.lib.UDataInputStream;
import com.vladium.jcd.lib.UDataOutputStream;
import java.io.IOException;

public final class LineNumber_info
  implements Cloneable, IClassFormatOutput
{
  public int m_start_pc;
  public int m_line_number;
  
  public LineNumber_info(int start_pc, int line_number)
  {
    m_start_pc = start_pc;
    m_line_number = line_number;
  }
  
  public String toString()
  {
    return "line_number_info: [start_pc = " + m_start_pc + ", line_number = " + m_line_number + "]";
  }
  
  public Object clone()
  {
    try
    {
      return super.clone();
    }
    catch (CloneNotSupportedException e)
    {
      throw new InternalError(e.toString());
    }
  }
  
  public void writeInClassFormat(UDataOutputStream out)
    throws IOException
  {
    out.writeU2(m_start_pc);
    out.writeU2(m_line_number);
  }
  
  LineNumber_info(UDataInputStream bytes)
    throws IOException
  {
    m_start_pc = bytes.readU2();
    m_line_number = bytes.readU2();
  }
}

/* Location:
 * Qualified Name:     com.vladium.jcd.cls.attribute.LineNumber_info
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.cls.attribute;

import com.vladium.jcd.cls.ClassDef;
import com.vladium.jcd.cls.IConstantCollection;
import com.vladium.jcd.cls.constant.CONSTANT_Utf8_info;
import com.vladium.jcd.lib.UDataInputStream;
import com.vladium.jcd.lib.UDataOutputStream;
import java.io.IOException;

public final class SourceFileAttribute_info
  extends Attribute_info
{
  public int m_sourcefile_index;
  
  public SourceFileAttribute_info(int attribute_name_index)
  {
    super(attribute_name_index, 0L);
  }
  
  public long length()
  {
    return 8L;
  }
  
  public CONSTANT_Utf8_info getSourceFile(ClassDef cls)
  {
    return (CONSTANT_Utf8_info)cls.getConstants().get(m_sourcefile_index);
  }
  
  public void accept(IAttributeVisitor visitor, Object ctx)
  {
    visitor.visit(this, ctx);
  }
  
  public String toString()
  {
    return "SourceFileAttribute_info: [attribute_name_index = " + m_name_index + ", attribute_length = " + m_attribute_length + ']';
  }
  
  public Object clone()
  {
    return super.clone();
  }
  
  public void writeInClassFormat(UDataOutputStream out)
    throws IOException
  {
    super.writeInClassFormat(out);
    
    out.writeU2(m_sourcefile_index);
  }
  
  SourceFileAttribute_info(int attribute_name_index, long attribute_length, UDataInputStream bytes)
    throws IOException
  {
    super(attribute_name_index, attribute_length);
    
    m_sourcefile_index = bytes.readU2();
  }
}

/* Location:
 * Qualified Name:     com.vladium.jcd.cls.attribute.SourceFileAttribute_info
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.cls.attribute;

import com.vladium.jcd.lib.UDataOutputStream;
import java.io.IOException;

public final class SyntheticAttribute_info
  extends Attribute_info
{
  public SyntheticAttribute_info(int attribute_name_index)
  {
    super(attribute_name_index, 0L);
  }
  
  public long length()
  {
    return 6L;
  }
  
  public void accept(IAttributeVisitor visitor, Object ctx)
  {
    visitor.visit(this, ctx);
  }
  
  public String toString()
  {
    return "SyntheticValueAttribute_info: [attribute_name_index = " + m_name_index + ", attribute_length = " + m_attribute_length + ']';
  }
  
  public Object clone()
  {
    return super.clone();
  }
  
  public void writeInClassFormat(UDataOutputStream out)
    throws IOException
  {
    super.writeInClassFormat(out);
  }
  
  SyntheticAttribute_info(int attribute_name_index, long attribute_length)
  {
    super(attribute_name_index, attribute_length);
  }
}

/* Location:
 * Qualified Name:     com.vladium.jcd.cls.attribute.SyntheticAttribute_info
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.cls.constant;

import com.vladium.jcd.cls.ClassDef;
import com.vladium.jcd.cls.IConstantCollection;
import com.vladium.jcd.lib.UDataInputStream;
import com.vladium.jcd.lib.UDataOutputStream;
import java.io.IOException;

public final class CONSTANT_Class_info
  extends CONSTANT_info
{
  public static final byte TAG = 7;
  public int m_name_index;
  
  public CONSTANT_Class_info(int name_index)
  {
    m_name_index = name_index;
  }
  
  public final byte tag()
  {
    return 7;
  }
  
  public String getName(ClassDef cls)
  {
    return getConstantsgetm_name_index)).m_value;
  }
  
  public Object accept(ICONSTANTVisitor visitor, Object ctx)
  {
    return visitor.visit(this, ctx);
  }
  
  public String toString()
  {
    return "CONSTANT_Class: [name_index = " + m_name_index + ']';
  }
  
  public void writeInClassFormat(UDataOutputStream out)
    throws IOException
  {
    super.writeInClassFormat(out);
    
    out.writeU2(m_name_index);
  }
  
  protected CONSTANT_Class_info(UDataInputStream bytes)
    throws IOException
  {
    m_name_index = bytes.readU2();
  }
}

/* Location:
 * Qualified Name:     com.vladium.jcd.cls.constant.CONSTANT_Class_info
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.cls.constant;

import com.vladium.jcd.lib.UDataInputStream;
import com.vladium.jcd.lib.UDataOutputStream;
import java.io.IOException;

public final class CONSTANT_Double_info
  extends CONSTANT_literal_info
{
  public static final byte TAG = 6;
  public double m_value;
  
  public CONSTANT_Double_info(double value)
  {
    m_value = value;
  }
  
  public final byte tag()
  {
    return 6;
  }
  
  public Object accept(ICONSTANTVisitor visitor, Object ctx)
  {
    return visitor.visit(this, ctx);
  }
  
  public String toString()
  {
    return Double.toString(m_value);
  }
  
  public int width()
  {
    return 2;
  }
  
  public void writeInClassFormat(UDataOutputStream out)
    throws IOException
  {
    super.writeInClassFormat(out);
    
    out.writeDouble(m_value);
  }
  
  protected CONSTANT_Double_info(UDataInputStream bytes)
    throws IOException
  {
    m_value = bytes.readDouble();
  }
}

/* Location:
 * Qualified Name:     com.vladium.jcd.cls.constant.CONSTANT_Double_info
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.cls.constant;

import com.vladium.jcd.lib.UDataInputStream;
import java.io.IOException;

public final class CONSTANT_Fieldref_info
  extends CONSTANT_ref_info
{
  public static final byte TAG = 9;
  
  public CONSTANT_Fieldref_info(int class_index, int name_and_type_index)
  {
    super(class_index, name_and_type_index);
  }
  
  public final byte tag()
  {
    return 9;
  }
  
  public Object accept(ICONSTANTVisitor visitor, Object ctx)
  {
    return visitor.visit(this, ctx);
  }
  
  public String toString()
  {
    return "CONSTANT_Fieldref: [class_index = " + m_class_index + ", name_and_type_index = " + m_name_and_type_index + ']';
  }
  
  protected CONSTANT_Fieldref_info(UDataInputStream bytes)
    throws IOException
  {
    super(bytes);
  }
}

/* Location:
 * Qualified Name:     com.vladium.jcd.cls.constant.CONSTANT_Fieldref_info
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.cls.constant;

import com.vladium.jcd.lib.UDataInputStream;
import com.vladium.jcd.lib.UDataOutputStream;
import java.io.IOException;

public final class CONSTANT_Float_info
  extends CONSTANT_literal_info
{
  public static final byte TAG = 4;
  public float m_value;
  
  public CONSTANT_Float_info(float value)
  {
    m_value = value;
  }
  
  public final byte tag()
  {
    return 4;
  }
  
  public Object accept(ICONSTANTVisitor visitor, Object ctx)
  {
    return visitor.visit(this, ctx);
  }
  
  public String toString()
  {
    return Float.toString(m_value);
  }
  
  public void writeInClassFormat(UDataOutputStream out)
    throws IOException
  {
    super.writeInClassFormat(out);
    
    out.writeFloat(m_value);
  }
  
  protected CONSTANT_Float_info(UDataInputStream bytes)
    throws IOException
  {
    m_value = bytes.readFloat();
  }
}

/* Location:
 * Qualified Name:     com.vladium.jcd.cls.constant.CONSTANT_Float_info
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.cls.constant;

import com.vladium.jcd.lib.UDataInputStream;
import com.vladium.jcd.lib.UDataOutputStream;
import java.io.IOException;

public final class CONSTANT_Integer_info
  extends CONSTANT_literal_info
{
  public static final byte TAG = 3;
  public int m_value;
  
  public CONSTANT_Integer_info(int value)
  {
    m_value = value;
  }
  
  public final byte tag()
  {
    return 3;
  }
  
  public Object accept(ICONSTANTVisitor visitor, Object ctx)
  {
    return visitor.visit(this, ctx);
  }
  
  public String toString()
  {
    return Integer.toString(m_value);
  }
  
  public void writeInClassFormat(UDataOutputStream out)
    throws IOException
  {
    super.writeInClassFormat(out);
    
    out.writeInt(m_value);
  }
  
  protected CONSTANT_Integer_info(UDataInputStream bytes)
    throws IOException
  {
    m_value = bytes.readInt();
  }
}

/* Location:
 * Qualified Name:     com.vladium.jcd.cls.constant.CONSTANT_Integer_info
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.cls.constant;

import com.vladium.jcd.lib.UDataInputStream;
import java.io.IOException;

public final class CONSTANT_InterfaceMethodref_info
  extends CONSTANT_ref_info
{
  public static final byte TAG = 11;
  
  public CONSTANT_InterfaceMethodref_info(int class_index, int name_and_type_index)
  {
    super(class_index, name_and_type_index);
  }
  
  public final byte tag()
  {
    return 11;
  }
  
  public Object accept(ICONSTANTVisitor visitor, Object ctx)
  {
    return visitor.visit(this, ctx);
  }
  
  public String toString()
  {
    return "CONSTANT_InterfaceMethodref: [class_index = " + m_class_index + ", name_and_type_index = " + m_name_and_type_index + ']';
  }
  
  protected CONSTANT_InterfaceMethodref_info(UDataInputStream bytes)
    throws IOException
  {
    super(bytes);
  }
}

/* Location:
 * Qualified Name:     com.vladium.jcd.cls.constant.CONSTANT_InterfaceMethodref_info
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.cls.constant;

import com.vladium.jcd.lib.UDataInputStream;
import com.vladium.jcd.lib.UDataOutputStream;
import java.io.IOException;

public final class CONSTANT_Long_info
  extends CONSTANT_literal_info
{
  public static final byte TAG = 5;
  public long m_value;
  
  public CONSTANT_Long_info(long value)
  {
    m_value = value;
  }
  
  public final byte tag()
  {
    return 5;
  }
  
  public Object accept(ICONSTANTVisitor visitor, Object ctx)
  {
    return visitor.visit(this, ctx);
  }
  
  public String toString()
  {
    return Long.toString(m_value);
  }
  
  public int width()
  {
    return 2;
  }
  
  public void writeInClassFormat(UDataOutputStream out)
    throws IOException
  {
    super.writeInClassFormat(out);
    
    out.writeLong(m_value);
  }
  
  protected CONSTANT_Long_info(UDataInputStream bytes)
    throws IOException
  {
    m_value = bytes.readLong();
  }
}

/* Location:
 * Qualified Name:     com.vladium.jcd.cls.constant.CONSTANT_Long_info
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.cls.constant;

import com.vladium.jcd.lib.UDataInputStream;
import java.io.IOException;

public final class CONSTANT_Methodref_info
  extends CONSTANT_ref_info
{
  public static final byte TAG = 10;
  
  public CONSTANT_Methodref_info(int class_index, int name_and_type_index)
  {
    super(class_index, name_and_type_index);
  }
  
  public final byte tag()
  {
    return 10;
  }
  
  public Object accept(ICONSTANTVisitor visitor, Object ctx)
  {
    return visitor.visit(this, ctx);
  }
  
  public String toString()
  {
    return "CONSTANT_Methodref_info: [class_index
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd