|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.github.croesch.micro_debug.gui.debug.LineNumberMapper
public class LineNumberMapper
Abstraction layer to be able to have a special line numbering available but can this internal handle with normal line
numbers. When constructed the real line numbers and the line numbers available for the user are the same.
The method setNewLines(int...) allows you to add your own scheme of line numbers. These numbers are the
numbers available for the user and will be mapped to the real line numbers.
The methods getLineForNumber(int) and getNumberForLine(int) let you get the other representation of
the line number you have.
line: the line number for the user (may be 2,4,8,10,11,..)
number: the real line number, zero-based: 0,1,2,3,..
| Constructor Summary | |
|---|---|
LineNumberMapper()
|
|
| Method Summary | |
|---|---|
int |
getLineForNumber(int number)
Returns the representation for the user of the given real line number. |
int |
getNumberForLine(int line)
Returns the internal representation for the given line number (users view). |
void |
setNewLines(int... lines)
Set the new scheme of line numbers. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LineNumberMapper()
| Method Detail |
|---|
public final void setNewLines(int... lines)
null-array or an empty array means to reset the line numbers scheme to the default behavior - lines
(representation for the user: e.g. 2,6,7,8,10,..) and numbers (real line number: 0,1,2,3,...) are the same.
lines - the lines available for the user, note: may NOT contain duplicate entries!public final int getLineForNumber(int number)
number - the internal line number: 0,1,2,3,..
public final int getNumberForLine(int line)
line - the line number visible to the user, e.g. 4,5,7,12,..
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||