Uploaded image for project: 'OpenTrafficSim'
  1. OpenTrafficSim
  2. OTS-297

Implement static createSI method for scalars (and possibly vectors and matrices)

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Done
    • Priority: Medium
    • Resolution: Unresolved
    • Labels:
      None
    • Sprint:
      Sprint 9 (Version 0.14)
    • Organization:
      Generic
    • Java Project:
      djunits

      Description

      Instead of:

            Length len = new Length(5.0, LengthUnit.SI);
            Acceleration acc = new Acceleration(1.5, AccelerationUnit.SI);
      

      we could write:

            Length len = Length.createSI(5.0);
            Acceleration acc = Acceleration.createSI(1.5);
      

      This is a shorter and avoids a lot of typing. It is probably also more clear in code.

      We have to see if it is necessary to provide the same function for vectors and matrices.

        Attachments

          Activity

            People

            • Assignee:
              averbraeck Alexander Verbraeck
              Reporter:
              averbraeck Alexander Verbraeck
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:

                Time Tracking

                Estimated:
                Original Estimate - 30 minutes
                30m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 30 minutes
                30m