blob: 3128769195007af995125bc3d845abbbea25cead [file] [log] [blame]
/**
* Copyright (c) 2008 - 2010 OptXware Research and Development LLC.
* 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:
* Daniel Varro - Initial API and implementation
*/
package org.eclipse.viatra2.lpgparser.typechecker;
public class StringTriple {
protected String name;
protected String firstArg;
protected String secondArg;
public StringTriple(String name, String firstArg, String secondArg) {
this.name = name;
this.firstArg = firstArg;
this.secondArg = secondArg;
}
public String getName() {
return name;
}
public String getFirstArg() {
return firstArg;
}
public String getSecondArg() {
return secondArg;
}
@Override
public int hashCode() {
final int prime = 7919;
int result = 1;
result = prime * result
+ ((firstArg == null) ? 0 : firstArg.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result
+ ((secondArg == null) ? 0 : secondArg.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (obj == null){
return false;
}
else if (this == obj) {
return true;
}
else if (obj instanceof StringTriple) {
StringTriple strTriple = (StringTriple) obj;
if (strTriple.getName().equals(name) &&
strTriple.getFirstArg().equals(firstArg) &&
strTriple.getSecondArg().equals(secondArg)) {
return true;
}
}
return false;
}
}