|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--upidiff.merge.LineOffset
This class represents the management of an Line/Char Offset
Field Summary | |
private Vector |
offset
The container for the LineElements |
Constructor Summary | |
LineOffset()
Constructs a new object of this class |
Method Summary | |
void |
addLine(LineElement line)
Adds the given LineElement to the end of the Vector |
void |
addStringInLine(int line,
int length)
Adds the Offset of an inserted String to the LineElement of the line it was added to. |
void |
connectWithNextLine(int linenumber)
This method connects the LineElement in the given line with the the one in the next line |
void |
deleteLine(int line)
Deletes a line from the Offset |
void |
deleteLineRange(int start,
int end)
This method deletes the given range of lines |
void |
deleteStringInLine(int line,
int length)
Decreases the offset of the given line about the given length |
int |
getLength()
Queries the number of lines in the document |
LineElement |
getLineByChange(Change change)
Queries the LineElement that contains the given change |
LineElement |
getLineByNumber(int number)
Queries the lineinformation by its number |
int |
getLinenumberByChange(Change change)
Queries the linenumber that contains the given change |
int |
getLineNumberByTotalChar(int thisPos)
Queries the LineElement that contains the given total position in the Text |
void |
insertLine(int line,
LineElement lineElement)
Inserts a LineElement at the given line |
void |
recalculateCharOffset(int startLine)
Recalculates the offset after a char-change |
private void |
recalculateLineNumberOffset(int linenumber)
|
void |
recalculateLineOffset(int startLine)
Recalculates the offset after a line-change |
void |
setStringInLine(int line,
int length)
Sets the number of Chars in Line |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private Vector offset
Constructor Detail |
public LineOffset()
Method Detail |
public LineElement getLineByChange(Change change)
change
- The Change-Object to querie for
public int getLinenumberByChange(Change change)
change
- The Change-Object to querie for
public int getLineNumberByTotalChar(int thisPos)
thisPos
- The total position in the Text
public int getLength()
public LineElement getLineByNumber(int number)
number
- The number of the queried line
public void addLine(LineElement line)
line
- The LineElement with the information
about the linepublic void setStringInLine(int line, int length)
line
- The line to set the numberlength
- the number of Charspublic void addStringInLine(int line, int length)
line
- Number of the linelength
- The length of the inserted Stringpublic void deleteLine(int line)
line
- The number of the line to be deletedpublic void deleteLineRange(int start, int end)
start
- The first line to be deletedend
- The last line to be deletedpublic void deleteStringInLine(int line, int length)
line
- The line to be decreasedlength
- The length to decrease the line aboutpublic void insertLine(int line, LineElement lineElement)
line
- The new position of the given LineElementlineElement
- The LineElement to be insertedpublic void recalculateCharOffset(int startLine)
startLine
- The line to start the recalculation with. Use the
the linenumber the change took place in.public void recalculateLineOffset(int startLine)
startLine
- The line to start the recalculation with. Use the
the linenumber the change took place in.private void recalculateLineNumberOffset(int linenumber)
public void connectWithNextLine(int linenumber)
linenumber
- The linenumber of the LinenElement to connect
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |