- public int begin;
- public int end;
- public float score;
- public String type;
- public String description;
- public Hashtable otherDetails;
- public java.util.Vector links;
-
- // Feature group can be set from a features file
- // as a group of features between STARTGROUP and ENDGROUP markers
- public String featureGroup;
-
- public SequenceFeature()
- {}
- public SequenceFeature(SequenceFeature cpy) {
- if (cpy!=null) {
- begin = cpy.begin;
- end = cpy.end;
- score = cpy.score;
- type = new String(cpy.type);
- description = new String(cpy.description);
- featureGroup = new String(cpy.featureGroup);
- if (cpy.otherDetails!=null) {
- try {
- otherDetails = (Hashtable) cpy.otherDetails.clone();
- } catch (Exception e) {
- // Uncloneable objects in the otherDetails - don't complain
- }
- }
- if (cpy.links!=null && cpy.links.size()>0) {
- links=new Vector();
- for (int i=0,iSize=cpy.links.size(); i<iSize; i++) {
- links.setElementAt(cpy.links.elementAt(i), i);
- }
- }
- }
- }
- public SequenceFeature(String type,
- String desc,
- String status,
- int begin, int end,
- String featureGroup)
- {
- this.type = type;
- this.description = desc;
- setValue("status", status);
- this.begin = begin;
- this.end = end;
- this.featureGroup = featureGroup;
- }
-
- public SequenceFeature(String type,
- String desc,
- int begin, int end,
- float score,
- String featureGroup)
- {
- this.type = type;
- this.description = desc;
- this.begin = begin;
- this.end = end;
- this.score = score;
- this.featureGroup = featureGroup;
- }
-
- public boolean equals(SequenceFeature sf)
- {
- if (begin != sf.begin
- || end != sf.end
- || score != sf.score)
- return false;
-
- if(!(type+description+featureGroup).equals
- (sf.type+sf.description+sf.featureGroup))
- return false;
-
- return true;
- }
-
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public int getBegin()
- {
- return begin;
- }
-
- public void setBegin(int start)
- {
- this.begin = start;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public int getEnd()
- {
- return end;
- }
-
- public void setEnd(int end)
- {
- this.end = end;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public String getType()
- {
- return type;
- }
-
- public void setType(String type)
- {
- this.type = type;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public String getDescription()
+ public int begin;
+ public int end;
+ public float score;
+ public String type;
+ public String description;
+ public Hashtable otherDetails;
+ public java.util.Vector links;
+
+ // Feature group can be set from a features file
+ // as a group of features between STARTGROUP and ENDGROUP markers
+ public String featureGroup;
+
+ public SequenceFeature()
+ {}
+
+ /**
+ * Constructs a duplicate feature.
+ * Note: Uses clone on the otherDetails so only shallow copies are made
+ * of additional properties and method will silently fail if unclonable
+ * objects are found in the hash.
+ * @param cpy
+ */
+ public SequenceFeature(SequenceFeature cpy)
+ {
+ if (cpy != null)