All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sourceforge.plantuml.json.Location Maven / Gradle / Ivy

There is a newer version: 1.2024.8
Show newest version
// THIS FILE HAS BEEN GENERATED BY A PREPROCESSOR.
package net.sourceforge.plantuml.json;

/**
 * An immutable object that represents a location in the parsed text.
 */
public class Location {

	/**
	 * The absolute character index, starting at 0.
	 */
	public final int offset;

	/**
	 * The line number, starting at 1.
	 */
	public final int line;

	/**
	 * The column number, starting at 1.
	 */
	public final int column;

	Location(int offset, int line, int column) {
		this.offset = offset;
		this.column = column;
		this.line = line;
	}

	@Override
	public String toString() {
		return line + ":" + column;
	}

	@Override
	public int hashCode() {
		return offset;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (getClass() != obj.getClass()) {
			return false;
		}
		Location other = (Location) obj;
		return offset == other.offset && column == other.column && line == other.line;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy