public class Position
extends java.lang.Object
Constructor and Description |
---|
Position()
Creates a new instance of Position.
|
Position(int column,
int line)
Creates a new instance of Position.
|
Modifier and Type | Method and Description |
---|---|
void |
adjustLimits(int maxLines,
int maxColumns)
Adjusts the position to be withing limits.
|
Position |
clone()
Returns a clone of this Position.
|
void |
decrementColumnm()
Decrements the column.
|
void |
decrementLine()
Decrements the line number.
|
int |
getColumn()
Returns the current column number.
|
int |
getLine()
Returns the number of current line.
|
void |
incrementColumn()
Increments the column.
|
void |
incrementLine()
Increments the line number.
|
void |
setColumn(int column)
Sets the current column.
|
void |
setColumn(int column,
int maxColumn)
Sets the current column.
|
void |
setLine(int line)
Sets the line of the position.
|
void |
setLine(int line,
int maxLine)
Sets the line of the position.
|
java.lang.String |
toString()
Returns a String representation of the position.
|
public Position()
public Position(int column, int line)
line
- The line this position points to.column
- The column this position points to.public void adjustLimits(int maxLines, int maxColumns)
maxLines
- maxColumns
- public void setLine(int line)
line
- The line to set.public void setLine(int line, int maxLine)
line
- The line to set.maxLine
- The maximul line that can be set.public int getLine()
public void setColumn(int column)
column
- The colum to set.public void setColumn(int column, int maxColumn)
column
- The colum to set.maxColumn
- the max column that can be set.public int getColumn()
public void incrementLine()
public void decrementLine()
public void incrementColumn()
public void decrementColumnm()
public Position clone()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2009-2012. All Rights Reserved.