/* * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) * Copyright (C) $$Year-Rel$$ The Jalview Authors * * This file is part of Jalview. * * Jalview is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, either version 3 * of the License, or (at your option) any later version. * * Jalview 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 GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Jalview. If not, see . * The Jalview Authors are detailed in the 'AUTHORS' file. */ package jalview.datamodel.xdb.uniprot; import java.util.Vector; /** * A data model class for binding from Uniprot XML via uniprot_mapping.xml */ public class UniprotFeature { private String type; private String description = null; private String original = null; private Vector variation = null; private String status; private int begin; private int end; public String getType() { return type; } public void setType(String t) { this.type = t; } public String getDescription() { if (description == null && variation == null && original == null) { return null; } StringBuilder sb = new StringBuilder(); if (description != null) { sb.append(description); } if (variation != null && variation.size() > 0) { int i = 0; for (String var : variation) { if (i++ > 0) { sb.append(","); } if (sb.length() > 0) { sb.append(" "); } sb.append("Variation: '" + var + "'"); } } if (original != null) { if (sb.length() > 0) { sb.append(" "); } sb.append("Original: '" + original + "'"); } return sb.toString(); } public void setDescription(String d) { this.description = d; } public String getStatus() { return status; } public void setStatus(String s) { this.status = s; } public int getBegin() { return begin; } public void setBegin(int b) { this.begin = b; } public int getEnd() { return end; } public void setEnd(int e) { this.end = e; } public int getPosition() { return begin; } public void setPosition(int p) { this.begin = p; this.end = p; } public String getOriginal() { return original; } public void setOriginal(String original) { this.original = original; } public Vector getVariation() { return variation; } public void setVariation(Vector variant) { this.variation = variant; } }