Class PageData
java.lang.Object
_global.tri.oxidationstates.webapi.PageData
This class contains all of the data that is needed to render a response to a request
on the oxidation state app.
-
Constructor Summary
ConstructorsConstructorDescriptionPageData(String composition, LikelihoodCalculator calculator) Construct object containing data for this pagePageData(String composition, TableRow[] rows, LikelihoodCalculator calculator) Construct object containing data for this page -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMessage(String messageString, boolean isErrorMessage) This method can be used to set a message to be returned to the user, such as an error or warning encountered when generating the table.Returns the composition of the material for which the oxidation states were generated.doubleReturns the maximum of boundary values for all possible ion types in terms of the mapped potentialMessage[]Returns a list of messages (e.g.doubleReturns the minimum of boundary values for all possible ion types in terms of the mapped potentialReturns the information needed to generate the oxidation state ranges for the ions used in this table.Returns a class that can transform the potentials used internally by the oxidation analyzer to and from mapped potentialsReturns the table data for this page.boolean[]Returns an array of booleans, set to true if the corresponding messages returned bygetMessages()contains an error that should be highlighted for the user, false otherwise.voidsetTableData(TableRow[] rows) Sets the table data to a new object containing the given rowstoJSON()Returns a JSON-formatted string containing all of the information on this page.toString()
-
Constructor Details
-
PageData
Construct object containing data for this page- Parameters:
composition- The composition for which this page was generated.rows- The rows to be included in the table on this page.calculator- The calculator used to generate this page. Oxidation state ranges will be read from this calculator.
-
PageData
Construct object containing data for this page- Parameters:
composition- The composition for which this page was generated.calculator- The calculator used to generate this page. Oxidation state ranges will be read from this calculator.
-
-
Method Details
-
getComposition
Returns the composition of the material for which the oxidation states were generated.- Returns:
- the composition of the material for which the oxidation states were generated.
-
getOxidationStateRangeData
Returns the information needed to generate the oxidation state ranges for the ions used in this table.- Returns:
- the information needed to generate the oxidation state ranges for the ions used in this table.
-
getMessages
Returns a list of messages (e.g. error) to be passed to the user- Returns:
- a list of messages to be passed to the user
-
isErrorMessage
public boolean[] isErrorMessage()Returns an array of booleans, set to true if the corresponding messages returned bygetMessages()contains an error that should be highlighted for the user, false otherwise.- Returns:
- an array of booleans, set to true if the corresponding messages returned by
getMessages()contains an error that should be highlighted for the user, false otherwise.
-
getMinBoundaryValue
public double getMinBoundaryValue()Returns the minimum of boundary values for all possible ion types in terms of the mapped potential- Returns:
- the minimum of boundary values for all possible ion types in terms of the mapped potential
-
getMaxBoundaryValue
public double getMaxBoundaryValue()Returns the maximum of boundary values for all possible ion types in terms of the mapped potential- Returns:
- the maximum of boundary values for all possible ion types in terms of the mapped potential
-
addMessage
This method can be used to set a message to be returned to the user, such as an error or warning encountered when generating the table.- Parameters:
messageString- A message (e.g. an error message) to be returned to the user. Returnns null if there is no message.isErrorMessage- True if the message contains an error that should be highlighted for the user.
-
setTableData
Sets the table data to a new object containing the given rows- Parameters:
rows- The rows to be included in the table
-
getTableData
Returns the table data for this page.- Returns:
- the table data for this page.
-
getPotentialMapper
Returns a class that can transform the potentials used internally by the oxidation analyzer to and from mapped potentials- Returns:
- A class that can transform the potentials used internally by the oxidation analyzer to and from mapped potentials
-
toJSON
Returns a JSON-formatted string containing all of the information on this page.- Returns:
- a JSON-formatted string containing all of the information on this page.
-
toString
-