/*
* Map where key is a Term and value is a (possibly empty) list of
- * all Terms to which the key has a direct 'isA' relationship
+ * all Terms to which the key has an 'isA' relationship, either
+ * directly or indirectly (A isA B isA C)
*/
private Map<Term, List<Term>> termIsA;
+ /**
+ * Returns singleton instance
+ *
+ * @return
+ */
public synchronized static SequenceOntology getInstance()
{
if (instance == null)
{
if (termIsA(parent, parentTerm))
{
+ /*
+ * add (great-)grandparents to parents list as they are discovered,
+ * for faster lookup next time
+ */
+ if (!parents.contains(parentTerm))
+ {
+ parents.add(parentTerm);
+ }
return true;
}
}