
org.biojava.nbio.structure.domain.pdp.Domain Maven / Gradle / Ivy
/*
* BioJava development code
*
* This code may be freely distributed and modified under the
* terms of the GNU Lesser General Public Licence. This should
* be distributed with the code. If you do not have a copy,
* see:
*
* http://www.gnu.org/copyleft/lesser.html
*
* Copyright for this code is held jointly by the individual
* authors. These should be listed in @author doc comments.
*
* For more information on the BioJava project and its aims,
* or to join the biojava-l mailing list, visit the home page
* at:
*
* http://www.biojava.org/
*
*
* Author: Andreas Prlic
*
*/
package org.biojava.nbio.structure.domain.pdp;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@XmlRootElement(name = "Domain", namespace ="http://www.biojava.org")
@XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)
/** represents a Domain
* @since 3.0.2
*/
public class Domain implements Comparable, Serializable{
/**
*
*/
private static final long serialVersionUID = -1293994033102271366L;
String id;
int size;
int nseg;
double score;
Listsegments = new ArrayList();
public Domain(){
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
@Override
public String toString() {
return "Domain [size=" + size + ", nseg=" + nseg + ", score=" + score
+ "]";
}
public List getSegments() {
return segments;
}
public Segment getSegmentAtPos(int pos){
int size = segments.size();
while ( pos >= size){
segments.add(new Segment());
size++;
}
return segments.get(pos);
}
@Override
public int compareTo(Domain other) {
if ( this.getId() == null)
return 1;
if ( other.getId() == null)
return -1;
return this.getId().compareTo(other.getId());
}
public int getSize() {
return size;
}
public void setSize(int size) {
this.size = size;
}
public int getNseg() {
return nseg;
}
public void setNseg(int nseg) {
this.nseg = nseg;
}
public double getScore() {
return score;
}
public void setScore(double score) {
this.score = score;
}
public void setSegments(List segments) {
this.segments = segments;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy