|
Cytoscape 2.8.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcytoscape.command.CyCommandResult
public class CyCommandResult
CyCommandResult returns the results from the execution of a
command. Generally, a command would create a CyCommandResult
object at the beginning of the execute() method. A command should never
return a null to indicate failure, and should throw CyCommandException
instead. This will avoid a lot of redundant checking for null returns.
Constructor Summary | |
---|---|
CyCommandResult()
Create a new empty CyCommandResult. |
|
CyCommandResult(String message,
Map<String,Object> results)
Create a new CyCommandResult with an initial message and execution results. |
Method Summary | |
---|---|
void |
addError(String message)
Add an error message to the list of errors for this execution. |
void |
addMessage(String message)
Add a message to the list of messages that results from this execution. |
void |
addResult(Object value)
Add the result for this execution. |
void |
addResult(String key,
Object value)
Add a result to the result set for this execution. |
List<String> |
getErrors()
Return all of the erros from an execution. |
List<String> |
getMessages()
Return all of the messages from an execution. |
Object |
getResult()
Return the result from an execution. |
Object |
getResult(String key)
Return a particular result from an execution. |
Map<String,Object> |
getResults()
Return all of the results from an execution as a map indexed by the result name. |
String |
getStringResult()
Return the result from an execution, as a string. |
String |
getStringResult(String key)
Return a particular result from an execution as a String. |
void |
setResults(Map<String,Object> results)
Set all of the results for this execution. |
boolean |
successful()
Return true if the execution was successful, false if it failed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CyCommandResult()
public CyCommandResult(String message, Map<String,Object> results)
message
- a message to include in the result. Note that more messages
may be added later.results
- a map of the results from the execution.Method Detail |
---|
public void addMessage(String message)
message
- the message to addpublic void addError(String message)
message
- the error message to addpublic void addResult(Object value)
value
- the result value itselfpublic void addResult(String key, Object value)
key
- the result whose value we're settingvalue
- the result value itselfpublic boolean successful()
public void setResults(Map<String,Object> results)
results
- the map of key, value pairspublic String getStringResult(String key)
key
- the result value we're interested in
public String getStringResult()
public Object getResult(String key)
key
- the result value we're interested in
public Object getResult()
public Map<String,Object> getResults()
public List<String> getMessages()
public List<String> getErrors()
|
Cytoscape 2.8.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |