package sds.assemble;

import sds.classfile.attributes.LineNumberTable;
import sds.classfile.bytecode.OpcodeInfo;
import sds.classfile.bytecode.Opcodes;

/**
 *
 * @author inagaki
 */
public class LineInstructions {
	private LineNumberTable.LNTable table;
	private Opcodes opcodes;

	public LineInstructions(LineNumberTable.LNTable table) {
		this.table = table;
		this.opcodes = new Opcodes();
	}

	public void addOpcode(OpcodeInfo opcode) {
		opcodes.add(opcode.getPc(), opcode);
	}

	public LineNumberTable.LNTable getTable() {
		return table;
	}

	public Opcodes getOpcodes() {
		return opcodes;
	}

	public boolean isInPcRange(int pc) {
		return table.getStartPc() <= pc && pc <= table.getEndPc();
	}
}
@@ -153,16 +153,68 @@
 %0A%0A/**%0A *
+ This class is for instructions of a line of method.
 %0A * @aut
@@ -328,16 +328,79 @@
 codes;%0A%0A
+%09/**%0A%09 * constructor.%0A%09 * @param table line number table %0A%09 */%0A
 %09public 
@@ -503,24 +503,77 @@
 odes();%0A%09%7D%0A%0A
+%09/**%0A%09 * adds opcode.%0A%09 * @param opcode opcode %0A%09 */%0A
 %09public void
@@ -652,221 +652,424 @@
 %7D%0A%0A%09
-public LineNumberTable.LNTable getTable() %7B%0A%09%09return table;%0A%09%7D%0A%0A%09public Opcodes getOpcodes() %7B%0A%09%09return opcodes;%0A%09%7D%0A%0A%09public boolean isInPcRange(int pc) %7B%0A%09%09return table.getStartPc() %3C= pc && pc %3C= table.getEndPc(
+/**%0A%09 * returns line number table.%0A%09 * @return line number table%0A%09 */%0A%09public LineNumberTable.LNTable getTable() %7B%0A%09%09return table;%0A%09%7D%0A%0A%09/**%0A%09 * returns opcodes of this line.%0A%09 * @return opcodes%0A%09 */%0A%09public Opcodes getOpcodes() %7B%0A%09%09return opcodes;%0A%09%7D%0A%0A%09/**%0A%09 * returns opcode from specified pc.%0A%09 * @param pc index into the code array.%0A%09 * @return opcode%0A%09 */%0A%09public OpcodeInfo get(int pc) %7B%0A%09%09return opcodes.get(pc
 );%0A%09

add comment for javadoc and method to be able to get from index into the code array.