|
[HepData-svn] r1760 - trunk/hepdata-model/src/main/java/cedar/hepdata/modelblackhole at projects.hepforge.org blackhole at projects.hepforge.orgThu Mar 13 11:11:59 GMT 2014
Author: whalley Date: Thu Mar 13 11:11:59 2014 New Revision: 1760 Log: model additions of advanced plotting Modified: trunk/hepdata-model/src/main/java/cedar/hepdata/model/Property.java Modified: trunk/hepdata-model/src/main/java/cedar/hepdata/model/Property.java ============================================================================== --- trunk/hepdata-model/src/main/java/cedar/hepdata/model/Property.java Thu Mar 13 11:09:30 2014 (r1759) +++ trunk/hepdata-model/src/main/java/cedar/hepdata/model/Property.java Thu Mar 13 11:11:59 2014 (r1760) @@ -144,6 +144,44 @@ return this; } + /** make a sanitised String version. */ + public String getFull() { + // StringBuffer s = new StringBuffer(); + String tempstr = getName().toString(); + tempstr = tempstr.concat(" : "); + if (getFocus() != null){ + tempstr = tempstr.concat(getFocus().toString()); + } + if (getLowValue() != null && getHighValue() != null && + getLowValue().equals(getHighValue())) { + tempstr = tempstr.concat(getLowValue().toString()); + } else { + if(getFocus() != null) { tempstr = tempstr.concat(" ("); } + tempstr = tempstr.concat(getLowValue().toString()); + tempstr = tempstr.concat("-"); + tempstr = tempstr.concat(getHighValue().toString()); + if(getFocus() != null) { tempstr = tempstr.concat(")"); } + } + if (getUnit().toString().equals("") || !getUnit().isDimensionless()) { + tempstr = tempstr.concat(" "); + tempstr = tempstr.concat(getUnit().toString()); + } + if(tempstr.startsWith(". :")){ + tempstr = tempstr.substring(3); + } + +// s.append(tempstring); +// if(getLowValue().equals(getHighValue())){ +// s.append(" "+getFocus()); +// } +// else{ +// s.append(" "+getLowValue()+"-"+getHighValue()); +// } +// if(getUnit().toString().equals("")||!getUnit().isDimensionless()){ +// s.append(" "+getUnit().toString()); +// } + return tempstr; + } /////////////////////////////////////////////////////////////////// @@ -154,4 +192,4 @@ s.append("(" + getLowValue() + "-" + getHighValue() + ") " + getUnit().toString()); return s.toString(); } -} +}
More information about the HepData-svn mailing list |