/* Copyright (c) 2011 Peter Troshin * * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0 * * This library is free software; you can redistribute it and/or modify it under the terms of the * Apache License version 2 as published by the Apache Software Foundation * * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache * License for more details. * * A copy of the license is in apache_license.txt. It is also available here: * @see: http://www.apache.org/licenses/LICENSE-2.0.txt * * Any republication or derived work distributed in source code form * must include this copyright and license notice. */ package compbio.pipeline._jpred; public class PScore { String name; String otherName; double score; @Override public boolean equals(Object obj) { if(obj==null) { return false; } if(!(obj instanceof PScore)) { return false; } PScore pscore = (PScore)obj; if(Double.compare(score, pscore.score)!=0) { return false; } if(!this.name.equalsIgnoreCase(pscore.name)) { return false; } if(!this.otherName.equalsIgnoreCase(pscore.otherName)) { return false; } return true; } @Override public int hashCode() { return new Double((name.hashCode() * otherName.hashCode()*45)/score).intValue(); } @Override public String toString() { String value = "Name: " + name + "\n"; value += "OtherName: " + otherName+ "\n"; value += "Score: " + score+ "\n"; return value; } }