blob: b1e04e4e7fd6c59845787fbab3fa5d28cce9fb54 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2016 Florian Thienel and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Florian Thienel - initial API and implementation
*******************************************************************************/
package org.eclipse.vex.core.internal.boxes;
/**
* @author Florian Thienel
*/
public class GridPosition {
public final int row;
public final int column;
public GridPosition(final int row, final int column) {
this.row = row;
this.column = column;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + column;
result = prime * result + row;
return result;
}
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final GridPosition other = (GridPosition) obj;
if (column != other.column) {
return false;
}
if (row != other.row) {
return false;
}
return true;
}
@Override
public String toString() {
return "GridPosition [row=" + row + ", column=" + column + "]";
}
}