Package fr.uga.pddl4j.parser
Class Location
java.lang.Object
fr.uga.pddl4j.parser.Location
- All Implemented Interfaces:
Serializable
This abstract class implements the common methods of all object produced by the parser.
- See Also:
- Serialized Form
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intThe default begin column value.static intThe default begin line value.static intThe default begin column value.static intThe default end line value. -
Constructor Summary
ConstructorsConstructorDescriptionLocation()Creates new location with the default line and column value.Location(int beginLine, int beginColumn, int endLine, int endColumn)Creates a new locatable object with a specified begin line and column and a specified end line and column.Location(AbstractParsedObject other)Creates a parser object from another.Creates a new location from another. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns if an object location is equal to the location.intReturns the begin column of the file where this object appear.intReturns the begin line of the file where this object appears.intReturns the end column of the file where this object appears.intReturns the end line of the file where this object appears.inthashCode()Returns the has code value of this location.voidsetBegin(fr.uga.pddl4j.parser.lexer.Token begin)Sets the begin line and column of the expression from a specified token.voidsetBeginColumn(int beginColumn)Sets the begin column of the file where this object appears.voidsetBeginLine(int beginLine)Sets the begin line of the file where this object appears.voidsetEnd(fr.uga.pddl4j.parser.lexer.Token end)Sets the end line and column of the expression from a specified token.voidsetEndColumn(int endColumn)Sets the end column of the file where this object appears.voidsetEndLine(int endLine)Sets the end line of the file where this object appears.toString()Returns a string representation of this location.
-
Field Details
-
DEFAULT_BEGIN_LINE
public static final int DEFAULT_BEGIN_LINEThe default begin line value.- See Also:
- Constant Field Values
-
DEFAULT_END_LINE
public static final int DEFAULT_END_LINEThe default end line value.- See Also:
- Constant Field Values
-
DEFAULT_BEGIN_COLUMN
public static final int DEFAULT_BEGIN_COLUMNThe default begin column value.- See Also:
- Constant Field Values
-
DEFAULT_END_COLUMN
public static final int DEFAULT_END_COLUMNThe default begin column value.- See Also:
- Constant Field Values
-
-
Constructor Details
-
Location
public Location()Creates new location with the default line and column value. -
Location
Creates a new location from another.- Parameters:
other- the othe location.
-
Location
public Location(int beginLine, int beginColumn, int endLine, int endColumn)Creates a new locatable object with a specified begin line and column and a specified end line and column.- Parameters:
beginLine- the begin line.beginColumn- the begin column.endLine- the end line.endColumn- the end column.
-
Location
Creates a parser object from another. This constructor creates a deep copy.- Parameters:
other- the other object to be copied.
-
-
Method Details
-
getBeginLine
public final int getBeginLine()Returns the begin line of the file where this object appears. The return valueDEFAULT_BEGIN_LINindicates that the attribute was not initialized.- Returns:
- the begin line of the file where this object appears or
DEFAULT_BEGIN_LINEif it was not initialized.
-
setBeginLine
public final void setBeginLine(int beginLine)Sets the begin line of the file where this object appears.- Parameters:
beginLine- the begin line of the object in the file.
-
getBeginColumn
public final int getBeginColumn()Returns the begin column of the file where this object appear. The return valueDEFAULT_BEGIN_COLUMNindicates that the attribute was not initialized.- Returns:
- the begin column of the file where this object appears or
DEFAULT_BEGIN_COLUMNif it was not initialized.
-
setBeginColumn
public final void setBeginColumn(int beginColumn)Sets the begin column of the file where this object appears.- Parameters:
beginColumn- the begin column of the file where this object appears.
-
getEndLine
public final int getEndLine()Returns the end line of the file where this object appears. The return valueDEFAULT_EN_LINEindicates that the attribute was not initialized.- Returns:
- the end line of the file where this object appears or
DEFAULT_EN_LINEif it was not initialized.
-
setEndLine
public final void setEndLine(int endLine)Sets the end line of the file where this object appears.- Parameters:
endLine- the end line of the file where this object appeasr.
-
getEndColumn
public final int getEndColumn()Returns the end column of the file where this object appears. The return valueDEFAULT_END_COLUMNindicates that the attribute was not initialized.- Returns:
- the end column of the file where this object appears or
DEFAULT_END_COLUMNif it was not initialized.
-
setEndColumn
public final void setEndColumn(int endColumn)Sets the end column of the file where this object appears.- Parameters:
endColumn- the end column of the file where this object appears.
-
setBegin
public final void setBegin(fr.uga.pddl4j.parser.lexer.Token begin)Sets the begin line and column of the expression from a specified token.- Parameters:
begin- the first token of the expression.
-
setEnd
public final void setEnd(fr.uga.pddl4j.parser.lexer.Token end)Sets the end line and column of the expression from a specified token.- Parameters:
end- the last token of the expression.
-
equals
Returns if an object location is equal to the location. -
hashCode
public int hashCode()Returns the has code value of this location.- Overrides:
hashCodein classObject- Returns:
- the has code value of this location.
- See Also:
Object.hashCode()
-
toString
Returns a string representation of this location.
-