Class Position
java.lang.Object
org.variantsync.boosting.position.Position
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
FilePosition
,LinePosition
,RootPosition
,UnspecifiedPosition
Represents a position in a file, line, or root.
This abstract class provides methods for creating a Position object from a
serialized string,
as well as methods for getting the hash code, checking equality, serializing
the position,
getting the file path, line number, and column number.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract int
Returns the column number of the Position object.abstract boolean
Checks if the Position object is equal to another object.abstract Path
filePath()
Returns the file path of the Position object.static Position
fromSerializedPosition
(String[] serializedPosition) Creates a Position object from a serialized string.abstract int
hashCode()
Returns the hash code of the Position object.abstract int
Returns the line number of the Position object.abstract String[]
Serializes the Position object into an array of strings.
-
Constructor Details
-
Position
public Position()
-
-
Method Details
-
fromSerializedPosition
Creates a Position object from a serialized string.- Parameters:
serializedPosition
- an array of strings representing the serialized position- Returns:
- a Position object based on the serialized string
- Throws:
IllegalArgumentException
- if the type in the serialized string is not recognized
-
hashCode
public abstract int hashCode()Returns the hash code of the Position object. Must be implemented by subclass. -
equals
Checks if the Position object is equal to another object. Must be implemented by subclass. -
serializedPosition
Serializes the Position object into an array of strings.- Returns:
- an array of strings representing the serialized position
-
filePath
Returns the file path of the Position object.- Returns:
- the file path of the Position object
-
lineNumber
public abstract int lineNumber()Returns the line number of the Position object.- Returns:
- the line number of the Position object
-
columnNumber
public abstract int columnNumber()Returns the column number of the Position object.- Returns:
- the column number of the Position object
-