Class Timesheet.TimesheetLine

    • Constructor Summary

      Constructors 
      Constructor Description
      TimesheetLine​(java.lang.String assignId, java.lang.String resId1, java.lang.String resId2)  
      TimesheetLine​(java.lang.String assignId, java.lang.String resId1, java.lang.String resId2, java.lang.String[] values1, java.lang.String[] values2, java.lang.String label1, java.lang.String label2)
      Construct an empty line between 2 resources
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addValue​(java.lang.String key, int indexField, java.lang.String val, double factor)
      Add value the the the period key
      void addValues​(java.lang.String key, java.lang.String[] val, double factor)
      Add values to the period key
      int compareTo​(Timesheet.TimesheetLine line)  
      void copyInputs​(Timesheet.TimesheetLine line, double factor, java.lang.String begin, java.lang.String end)
      Add the line inputs values between a given period
      java.lang.String[] getMinMaxInputKeys()
      Returns the period including not null inputs
      void refactor​(double factor, java.lang.String begin, java.lang.String end)
      Change the inputs charges in a given period
      void save​(java.util.List<java.lang.String[]> period, java.util.List<java.lang.String> msg)
      Save the line
      void setAssignPeriodKeys​(java.lang.String begin, java.lang.String end)
      Prepare keys with the assigned period
      boolean shift​(int offset)
      Move and resize the input charges in time
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • assignId

        public java.lang.String assignId
      • resourceId1

        public java.lang.String resourceId1
      • resourceLabel1

        public java.lang.String resourceLabel1
      • resourceValues1

        public java.lang.String[] resourceValues1
      • resourceId2

        public java.lang.String resourceId2
      • resourceLabel2

        public java.lang.String resourceLabel2
      • resourceValues2

        public java.lang.String[] resourceValues2
      • status

        public java.lang.String status
      • beginKey

        public java.lang.String beginKey
      • endKey

        public java.lang.String endKey
      • lineTotal

        public double[] lineTotal
        Total for each input line
      • inputs

        public java.util.Map<java.lang.String,​java.lang.String[]> inputs
        yyyy-MM-dd or yyyy-WW or yyyy-MM => Value for each input field
    • Constructor Detail

      • TimesheetLine

        public TimesheetLine​(java.lang.String assignId,
                             java.lang.String resId1,
                             java.lang.String resId2)
      • TimesheetLine

        public TimesheetLine​(java.lang.String assignId,
                             java.lang.String resId1,
                             java.lang.String resId2,
                             java.lang.String[] values1,
                             java.lang.String[] values2,
                             java.lang.String label1,
                             java.lang.String label2)
        Construct an empty line between 2 resources
    • Method Detail

      • setAssignPeriodKeys

        public void setAssignPeriodKeys​(java.lang.String begin,
                                        java.lang.String end)
        Prepare keys with the assigned period
      • getMinMaxInputKeys

        public java.lang.String[] getMinMaxInputKeys()
        Returns the period including not null inputs
      • addValues

        public void addValues​(java.lang.String key,
                              java.lang.String[] val,
                              double factor)
        Add values to the period key
      • addValue

        public void addValue​(java.lang.String key,
                             int indexField,
                             java.lang.String val,
                             double factor)
        Add value the the the period key
        Parameters:
        key - Period key
        indexField - Input index
        val - Value
        factor - Percentage to keep
      • copyInputs

        public void copyInputs​(Timesheet.TimesheetLine line,
                               double factor,
                               java.lang.String begin,
                               java.lang.String end)
        Add the line inputs values between a given period
        Parameters:
        line - Timesheet line
        factor - Percentage to add
        begin - Optional start date
        end - Optional end date
      • refactor

        public void refactor​(double factor,
                             java.lang.String begin,
                             java.lang.String end)
        Change the inputs charges in a given period
        Parameters:
        factor - Factor to apply
        begin - Optional start date
        end - Optional end date
      • shift

        public boolean shift​(int offset)
        Move and resize the input charges in time
        Parameters:
        offset - Shift size in days if field is shiftable
      • save

        public void save​(java.util.List<java.lang.String[]> period,
                         java.util.List<java.lang.String> msg)
        Save the line
        Parameters:
        period - Period to save
        msg - Message to append errors
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object