Class PageData

java.lang.Object
_global.tri.oxidationstates.webapi.PageData

public class PageData extends Object
This class contains all of the data that is needed to render a response to a request on the oxidation state app.
  • Constructor Details

    • PageData

      public PageData(String composition, TableRow[] rows, LikelihoodCalculator calculator)
      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

      public PageData(String composition, LikelihoodCalculator calculator)
      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

      public String 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

      public RangeData[] 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

      public Message[] 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 by getMessages() 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

      public void addMessage(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.
      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

      public void setTableData(TableRow[] rows)
      Sets the table data to a new object containing the given rows
      Parameters:
      rows - The rows to be included in the table
    • getTableData

      public TableData getTableData()
      Returns the table data for this page.
      Returns:
      the table data for this page.
    • getPotentialMapper

      public PotentialMapper 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

      public String 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

      public String toString()
      Overrides:
      toString in class Object