/*
* lookup from lower-case form of a name to its canonical (standardised) form
*/
- private static Map<String, String> canonicalSourceNameLookup = new HashMap<String, String>();
+ private static Map<String, String> canonicalSourceNameLookup = new HashMap<>();
- private static Map<String, String> dasCoordinateSystemsLookup = new HashMap<String, String>();
+ private static Map<String, String> dasCoordinateSystemsLookup = new HashMap<>();
static
{
canonicalSourceNameLookup.put("ensembl-tr", DBRefSource.ENSEMBL);
canonicalSourceNameLookup.put("ensembl-gn", DBRefSource.ENSEMBL);
+ canonicalSourceNameLookup.put("pfam", DBRefSource.PFAM);
+
// Make sure we have lowercase entries for all canonical string lookups
Set<String> keys = canonicalSourceNameLookup.keySet();
for (String k : keys)
{
return dbrefs;
}
- HashSet<String> srcs = new HashSet<String>();
+ HashSet<String> srcs = new HashSet<>();
for (String src : sources)
{
srcs.add(src.toUpperCase());
}
- List<DBRefEntry> res = new ArrayList<DBRefEntry>();
+ List<DBRefEntry> res = new ArrayList<>();
for (DBRefEntry dbr : dbrefs)
{
String source = getCanonicalName(dbr.getSource());
static List<DBRefEntry> searchRefs(DBRefEntry[] refs, DBRefEntry entry,
DbRefComp comparator)
{
- List<DBRefEntry> rfs = new ArrayList<DBRefEntry>();
+ List<DBRefEntry> rfs = new ArrayList<>();
if (refs == null || entry == null)
{
return rfs;
public static List<DBRefEntry> searchRefsForSource(DBRefEntry[] dbRefs,
String source)
{
- List<DBRefEntry> matches = new ArrayList<DBRefEntry>();
+ List<DBRefEntry> matches = new ArrayList<>();
if (dbRefs != null && source != null)
{
for (DBRefEntry dbref : dbRefs)
// nothing to do
return;
}
- List<DBRefEntry> selfs = new ArrayList<DBRefEntry>();
+ List<DBRefEntry> selfs = new ArrayList<>();
{
DBRefEntry[] selfArray = selectDbRefs(!sequence.isProtein(),
sequence.getDBRefs());
selfs.remove(p);
}
}
- List<DBRefEntry> toPromote = new ArrayList<DBRefEntry>();
+ List<DBRefEntry> toPromote = new ArrayList<>();
for (DBRefEntry p : pr)
{
- List<String> promType = new ArrayList<String>();
+ List<String> promType = new ArrayList<>();
if (sequence.isProtein())
{
switch (getCanonicalName(p.getSource()))