Uploaded image for project: 'Commons Numbers'
  1. Commons Numbers
  2. NUMBERS-3

Make "RootsOfUnity" immutable

    XMLWordPrintableJSON

Details

    Description

      The computation could be performed in the constructor, allowing
      all fields to be made "final".
      Synchronized methods would become unnecessary to ensure thread-safety, and numerous checks (to guard against a non-initialized instance) could be dropped.

      Overall the code can be simplified at the cost of dropping the "clockwise" store (see current version).

      An accessor method to get the each of the roots as a Complex should be provided, to replace the current separate retrieval of its real and imaginary parts.

      Also this class should not be Serializable.

      Attachments

        Activity

          People

            erans Gilles Sadowski
            erans Gilles Sadowski
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: