Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.biojava3.genome.parsers.gff;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


/**
Expand All @@ -17,7 +19,7 @@ public class Feature implements FeatureI {
private double mScore; //or . if none
private int mFrame; //0,1,2
private String mAttributes; //any trailing stuff
private HashMap<String, Object> mUserMap;
private HashMap<String, String> mUserMap;

/**
* Get the sequence name. (GFF field 1). Note that feature objects have
Expand Down Expand Up @@ -129,7 +131,7 @@ public Feature(Feature feature) {
mFrame = feature.mFrame;
mAttributes = feature.mAttributes;
initAttributeHashMap();
mUserMap = new HashMap<String, Object>(feature.mUserMap);
mUserMap = new HashMap<String, String>(feature.mUserMap);
}

/**
Expand All @@ -153,7 +155,7 @@ public Feature(String seqname, String source, String type, Location location, Do
mFrame = frame;
mAttributes = attributes;
initAttributeHashMap();
mUserMap = new HashMap<String, Object>();
mUserMap = new HashMap<String, String>();

}

Expand All @@ -170,11 +172,11 @@ public Feature(String seqname, String source, String type, Location location, Do
*
* @return The user HashMap.
*/
public HashMap<String, Object> userData() {
public HashMap<String, String> userData() {
return mUserMap;
}

HashMap<String,String> attributeHashMap = new HashMap<String,String>();
HashMap<String,String> attributeHashMap = new HashMap<String,String>();

private void initAttributeHashMap(){
String[] values = mAttributes.split(";");
Expand All @@ -193,7 +195,6 @@ private void initAttributeHashMap(){
}
attributeHashMap.put(data[0].trim(), value);
}

}

/**
Expand Down Expand Up @@ -304,4 +305,10 @@ public static void main(String args[])
// assert f.getAttribute( "transcript").equals( "gene_id fantom2" );
//Log.log( "passed test." );
}

@Override
public HashMap<String, String> getAttributes() {

return attributeHashMap;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ public interface FeatureI
*
* @return The user HashMap.
*/
public HashMap<String, Object> userData();
public HashMap<String, String> userData();

public HashMap<String, String> getAttributes();

}
Loading