Examples of DayOfWeek


Examples of org.optaplanner.examples.nurserostering.domain.DayOfWeek

        return shiftDate.getDayIndex();
    }

    public boolean isWeekendAndNotLastDayOfWeekend() {
        WeekendDefinition weekendDefinition = employee.getContract().getWeekendDefinition();
        DayOfWeek dayOfWeek = shiftDate.getDayOfWeek();
        return weekendDefinition.isWeekend(dayOfWeek) && weekendDefinition.getLastDayOfWeekend() != dayOfWeek;
    }
View Full Code Here

Examples of org.optaplanner.examples.nurserostering.domain.DayOfWeek

        return weekendDefinition.isWeekend(dayOfWeek) && weekendDefinition.getLastDayOfWeekend() != dayOfWeek;
    }

    public int getDistanceToLastDayOfWeekend() {
        WeekendDefinition weekendDefinition = employee.getContract().getWeekendDefinition();
        DayOfWeek dayOfWeek = shiftDate.getDayOfWeek();
        return dayOfWeek.getDistanceToNext(weekendDefinition.getLastDayOfWeekend());
    }
View Full Code Here

Examples of org.optaplanner.examples.nurserostering.domain.DayOfWeek

                    }
                    pattern.setId(id);
                    pattern.setCode(code);
                    pattern.setWeight(weight);
                    int patternEntryIndex = 0;
                    DayOfWeek firstDayOfweek = null;
                    for (Element patternEntryElement : patternEntryElementList) {
                        assertElementName(patternEntryElement, "PatternEntry");
                        Element shiftTypeElement = patternEntryElement.getChild("ShiftType");
                        boolean shiftTypeIsNone;
                        ShiftType shiftType;
                        if (shiftTypeElement.getText().equals("Any")) {
                            shiftTypeIsNone = false;
                            shiftType = null;
                        } else if (shiftTypeElement.getText().equals("None")) {
                            shiftTypeIsNone = true;
                            shiftType = null;
                        } else {
                            shiftTypeIsNone = false;
                            shiftType = shiftTypeMap.get(shiftTypeElement.getText());
                            if (shiftType == null) {
                                throw new IllegalArgumentException("The shiftType (" + shiftTypeElement.getText()
                                        + ") of pattern (" + pattern.getCode() + ") does not exist.");
                            }
                        }
                        Element dayElement = patternEntryElement.getChild("Day");
                        DayOfWeek dayOfWeek;
                        if (dayElement.getText().equals("Any")) {
                            dayOfWeek = null;
                        } else {
                            dayOfWeek = DayOfWeek.valueOfCode(dayElement.getText());
                            if (dayOfWeek == null) {
View Full Code Here

Examples of org.optaplanner.examples.nurserostering.domain.DayOfWeek

        private void readRequiredEmployeeSizes(NurseRoster nurseRoster, Element coverRequirementsElement) {
            List<Element> coverRequirementElementList = (List<Element>) coverRequirementsElement.getChildren();
            for (Element element : coverRequirementElementList) {
                if (element.getName().equals("DayOfWeekCover")) {
                    Element dayOfWeekElement = element.getChild("Day");
                    DayOfWeek dayOfWeek = DayOfWeek.valueOfCode(dayOfWeekElement.getText());
                    if (dayOfWeek == null) {
                        throw new IllegalArgumentException("The dayOfWeek (" + dayOfWeekElement.getText()
                                + ") of an entity DayOfWeekCover does not exist.");
                    }
View Full Code Here

Examples of org.optaplanner.examples.nurserostering.domain.DayOfWeek

        return shiftDate.getDayIndex();
    }

    public boolean isWeekendAndNotFirstDayOfWeekend() {
        WeekendDefinition weekendDefinition = employee.getContract().getWeekendDefinition();
        DayOfWeek dayOfWeek = shiftDate.getDayOfWeek();
        return weekendDefinition.isWeekend(dayOfWeek) && weekendDefinition.getFirstDayOfWeekend() != dayOfWeek;
    }
View Full Code Here

Examples of org.optaplanner.examples.nurserostering.domain.DayOfWeek

        return weekendDefinition.isWeekend(dayOfWeek) && weekendDefinition.getFirstDayOfWeekend() != dayOfWeek;
    }

    public int getDistanceToFirstDayOfWeekend() {
        WeekendDefinition weekendDefinition = employee.getContract().getWeekendDefinition();
        DayOfWeek dayOfWeek = shiftDate.getDayOfWeek();
        return weekendDefinition.getFirstDayOfWeekend().getDistanceToNext(dayOfWeek);
    }
View Full Code Here

Examples of org.pentaho.gwt.widgets.client.utils.TimeUtil.DayOfWeek

  }

  private ListBox createDayOfWeekListBox() {
    ListBox l = new ListBox();
    for ( int ii = 0; ii < DayOfWeek.length(); ++ii ) {
      DayOfWeek day = DayOfWeek.get( ii );
      l.addItem( day.toString() );
    }
    return l;
  }
View Full Code Here

Examples of org.pentaho.gwt.widgets.client.utils.TimeUtil.DayOfWeek

      gp.setCellPadding( 0 );
      gp.setCellSpacing( 0 );
      // add Sun - Wed
      final int ITEMS_IN_ROW = 4;
      for ( int ii = 0; ii < ITEMS_IN_ROW; ++ii ) {
        DayOfWeek day = DayOfWeek.get( ii );
        CheckBox cb = new CheckBox( day.toString() );
        cb.setStylePrimaryName( DOW_CHECKBOX );
        gp.setWidget( 0, ii, cb );
        dayToCheckBox.put( day, cb );
      }
      // Add Thur - Sat
      for ( int ii = ITEMS_IN_ROW; ii < DayOfWeek.length(); ++ii ) {
        DayOfWeek day = DayOfWeek.get( ii );
        CheckBox cb = new CheckBox( day.toString() );
        cb.setStylePrimaryName( DOW_CHECKBOX );
        gp.setWidget( 1, ii - 4, cb );
        dayToCheckBox.put( day, cb );
      }
      add( gp );
View Full Code Here

Examples of org.pentaho.gwt.widgets.client.utils.TimeUtil.DayOfWeek

     */
    public void setCheckedDaysAsString( String strDays, int valueOfSunday ) {
      String[] days = strDays.split( "," ); //$NON-NLS-1$
      for ( String day : days ) {
        int intDay = Integer.parseInt( day ) - valueOfSunday;
        DayOfWeek dayOfWeek = DayOfWeek.get( intDay );
        CheckBox cb = dayToCheckBox.get( dayOfWeek );
        cb.setChecked( true );
      }
    }
View Full Code Here

Examples of org.pentaho.platform.scheduler2.recur.QualifiedDayOfWeek.DayOfWeek

            } else if ( qualifiedDayPattern.matcher( token ).matches() ) {
              String[] days = token.split( "#" ); //$NON-NLS-1$
              dayOfWeekRecurrence
                  .add( new QualifiedDayOfWeek( Integer.parseInt( days[1] ), Integer.parseInt( days[0] ) ) );
            } else if ( lastDayPattern.matcher( token ).matches() ) {
              DayOfWeek dayOfWeek =
                  DayOfWeek.values()[( Integer.parseInt( token.substring( 0, token.length() - 1 ) ) - 1 ) % 7];
              dayOfWeekRecurrence.add( new QualifiedDayOfWeek( DayOfWeekQualifier.LAST, dayOfWeek ) );
            } else if ( dayOfWeekRangePattern.matcher( token ).matches() ) {
              String[] days = token.split( "-" ); //$NON-NLS-1$
              int start = DayOfWeek.valueOf( days[0] ).ordinal();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.