Clover icon

jalviewX

  1. Project Clover database Wed Oct 31 2018 15:13:58 GMT
  2. Package jalview.datamodel.features

File FeatureSource.java

 

Coverage histogram

../../../img/srcFileCovDistChart8.png
19% of files have more coverage

Code metrics

0
8
6
1
78
40
6
0.75
1.33
6
1

Classes

Class Line # Actions
FeatureSource 13 8 6 4
0.7142857371.4%
 

Contributing tests

No tests hitting this source file were found.

Source view

1    package jalview.datamodel.features;
2   
3    import java.util.HashMap;
4    import java.util.Map;
5   
6    /**
7    * A class to model one source of feature data, including metadata about
8    * attributes of features
9    *
10    * @author gmcarstairs
11    *
12    */
 
13    public class FeatureSource implements FeatureSourceI
14    {
15    private String name;
16   
17    private Map<String, String> attributeNames;
18   
19    private Map<String, FeatureAttributeType> attributeTypes;
20   
21    /**
22    * Constructor
23    *
24    * @param theName
25    */
 
26  4 toggle public FeatureSource(String theName)
27    {
28  4 this.name = theName;
29  4 attributeNames = new HashMap<>();
30  4 attributeTypes = new HashMap<>();
31    }
32   
33    /**
34    * {@inheritDoc}
35    */
 
36  0 toggle @Override
37    public String getName()
38    {
39  0 return name;
40    }
41   
42    /**
43    * {@inheritDoc}
44    */
 
45  133 toggle @Override
46    public String getAttributeName(String attributeId)
47    {
48  133 return attributeNames.get(attributeId);
49    }
50   
51    /**
52    * {@inheritDoc}
53    */
 
54  0 toggle @Override
55    public FeatureAttributeType getAttributeType(String attributeId)
56    {
57  0 return attributeTypes.get(attributeId);
58    }
59   
60    /**
61    * {@inheritDoc}
62    */
 
63  9 toggle @Override
64    public void setAttributeName(String id, String attName)
65    {
66  9 attributeNames.put(id, attName);
67    }
68   
69    /**
70    * {@inheritDoc}
71    */
 
72  9 toggle @Override
73    public void setAttributeType(String id, FeatureAttributeType type)
74    {
75  9 attributeTypes.put(id, type);
76    }
77   
78    }