[MOBY-guts] biomoby commit
Dmitry Repchevski
drepchevski at dev.open-bio.org
Mon Oct 26 12:23:08 UTC 2009
drepchevski
Mon Oct 26 08:23:07 EDT 2009
Update of /home/repository/moby/moby-live/Java/src/main/org/inb/biomoby/shared/registry
In directory dev.open-bio.org:/tmp/cvs-serv20780
Modified Files:
ObjectType.java
Log Message:
Added an auxiliary method to get a relationship list by type
moby-live/Java/src/main/org/inb/biomoby/shared/registry ObjectType.java,1.1,1.2
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/inb/biomoby/shared/registry/ObjectType.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Java/src/main/org/inb/biomoby/shared/registry/ObjectType.java 2009/09/09 19:47:49 1.1
+++ /home/repository/moby/moby-live/Java/src/main/org/inb/biomoby/shared/registry/ObjectType.java 2009/10/26 12:23:07 1.2
@@ -55,6 +55,25 @@
getRelationships().add(relationship);
}
+ /**
+ * Auxiliary method to find relationship by its type
+ *
+ * @param relationshipType a type of relationship to be found
+ * @return found relationship object or null
+ */
+ public Relationship<ObjectType> getRelationship(Relationship.RELATIONSHIP_TYPE relationshipType)
+ {
+ for (Relationship<ObjectType> relationship : getRelationships())
+ {
+ if (relationship.getRelationshipType() == relationshipType)
+ {
+ return relationship;
+ }
+ }
+
+ return null;
+ }
+
@XmlElement(name="relationship")
public List<Relationship<ObjectType>> getRelationships()
{
More information about the MOBY-guts
mailing list