Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Allow the creation of Xref objects from search output
  • Loading branch information
egonw committed Feb 16, 2012
1 parent 56245bc commit a904095
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
Expand Up @@ -147,6 +147,17 @@ private Set<String> extractIdentifierStrings(Set<Xref> dests) {
return results;
}

public Xref xref(String sourcedIdentifier) throws BioclipseException {
int index = sourcedIdentifier.indexOf(':');
if (index < 0) throw new BioclipseException("Unexpected format. Use something like \"Wi:Aspirin\".");

String identifier = sourcedIdentifier.substring(index + 1);
String source = sourcedIdentifier.substring(0, index);
System.out.println(identifier);
System.out.println(source);
return new Xref(identifier, getSource(source));
}

public Xref xref(String identifier, String source) throws BioclipseException {
return new Xref(identifier, getSource(source));
}
Expand Down
Expand Up @@ -99,11 +99,19 @@ public interface IBridgedbManager extends IBioclipseManager {
@Recorded
@PublishedMethod(
methodSummary="Creates a BridgeBD Xref object from the given identifier and source. Use listAllSources() to" +
" get a list of source codes.",
" get a list of source codes. An example is [\"3643\", \"L\"].",
params="String identifier, String source"
)
public Xref xref(String identifier, String source);

@Recorded
@PublishedMethod(
methodSummary="Creates a BridgeBD Xref object from the given identifier and source. An example " +
"is \"Wi:Aspirin\".",
params="String sourcedIdentifier"
)
public Xref xref(String sourcedIdentifier);

@Recorded
@PublishedMethod(
methodSummary="Loads a BridgeDB Rdb database from a file location.",
Expand Down

0 comments on commit a904095

Please sign in to comment.