Examples of Period


Examples of org.cast.cwm.data.Period

      // create a new site
      Site newSite = SiteService.get().newSite();
      newSite.setName("Site_" + user.getUsername()); // make this unique

      // create a new period
      Period newPeriod = SiteService.get().newPeriod();
      newPeriod.setSite(newSite);
      newPeriod.setName("Class_" + user.getUsername()); // make this unique
     
      // add the period to the user and the site
      SortedSet<Period> periodSet = new TreeSet<Period>();
      periodSet.add(newPeriod);
      user.getPeriods().add(newPeriod);
      newSite.getPeriods().add(newPeriod);     
     
      // a default student must be added to the new period
      User studentUser = UserService.get().newUser();
      studentUser.setRole(Role.STUDENT);
      studentUser.setFirstName("Student");
      studentUser.setLastName(newPeriod.getName());
      studentUser.setUsername(newPeriod.getName());
      studentUser.getPeriods().add(newPeriod);
      studentUser.setValid(true);
      studentUser.setCreateDate(new Date());
     
      // create a random number for the password
      Random randomNumber = new Random();
      Integer studentPasswordInteger = randomNumber.nextInt();
      studentPassword = studentPasswordInteger.toString().substring(0, 6);
      log.debug("this is the student password : {}", studentPassword);
      studentUser.setPassword(studentPassword);     
     
      // add the teacher and the default student to the new default class
      userSet.add(studentUser);
      newPeriod.setUsers(userSet);

      Databinder.getHibernateSession().save(newSite);
      Databinder.getHibernateSession().save(newPeriod);
      Databinder.getHibernateSession().save(studentUser);
    }
View Full Code Here

Examples of org.drools.planner.examples.curriculumcourse.domain.Period

                add(periodRoomPanel);
                roomPanelMap.put(room, periodRoomPanel);
            }
        }
        for (Lecture lecture : schedule.getLectureList()) {
            Period period = lecture.getPeriod();
            Room room = lecture.getRoom();
            if (period != null && room != null) {
                PeriodRoomPanel periodRoomPanel = periodRoomPanelMap.get(period).get(room);
                periodRoomPanel.addLecture(lecture);
            }
View Full Code Here

Examples of org.drools.planner.examples.examination.domain.Period

                add(periodRoomPanel);
                roomPanelMap.put(room, periodRoomPanel);
            }
        }
        for (Exam exam : examination.getExamList()) {
            Period period = exam.getPeriod();
            Room room = exam.getRoom();
            if (period != null && room != null) {
                PeriodRoomPanel periodRoomPanel = periodRoomPanelMap.get(period).get(room);
                periodRoomPanel.addExam(exam);
            }
View Full Code Here

Examples of org.elasticsearch.common.joda.time.Period

    private final PeriodFormatter defaultFormatter = PeriodFormat.getDefault()
            .withParseType(PeriodType.standard());

    public String format() {
        Period period = new Period(millis());
        return defaultFormatter.print(period);
    }
View Full Code Here

Examples of org.fusesource.hawtdb.metric.Period

    }

    protected void displayRates(List<? extends MetricCounter> metrics) throws InterruptedException {
        System.out.println("Gathering rates for: " + getName());
        for (int i = 0; i < samples; i++) {
            Period p = new Period();
            Thread.sleep(period);
            for (MetricCounter metric : metrics) {
                System.out.println(metric.getRateSummary(p));
                metric.reset();
            }
View Full Code Here

Examples of org.goda.time.Period

                String nextNameKey = nameKeys[i + 1];
                long curOffset = wallOffsets[i];
                long nextOffset = wallOffsets[i + 1];
                long curStdOffset = standardOffsets[i];
                long nextStdOffset = standardOffsets[i + 1];
                Period p = new Period(trans[i], trans[i + 1], PeriodType.yearMonthDay());
                if (curOffset != nextOffset &&
                        curStdOffset == nextStdOffset &&
                        curNameKey.equals(nextNameKey) &&
                        p.getYears() == 0 && p.getMonths() > 4 && p.getMonths() < 8 &&
                        curNameKey.equals(zoneNameData[2]) &&
                        curNameKey.equals(zoneNameData[4])) {
                   
                    System.out.println("Fixing duplicate name key - " + nextNameKey);
                    System.out.println("     - " + new DateTime(trans[i]) + " - " + new DateTime(trans[i + 1]));
View Full Code Here

Examples of org.joda.time.Period

     if (utc == null) return "";
     utc = ReplaceVariable.replaceAll(utc, " ", "T");
     DateTime now = new DateTime();
     DateTimeFormatter f = ISODateTimeFormat.dateTimeParser();
     DateTime other = f.parseDateTime(utc);
     Period period = new Period(other, now); // Period(ReadableInstant startInstant, ReadableInstant endInstant)
     return period.toString();
   }
View Full Code Here

Examples of org.jquantlib.time.Period

        final IborIndex clonedIborIndex = iborIndex.clone(this.termStructureHandle);

        // do not pass the spread here, as it might be a Quote i.e. it can dinamically change
        this.swap = new MakeVanillaSwap(tenor, clonedIborIndex, 0.0, fwdStart)
        .withFixedLegDayCount(fixedDayCount)
        .withFixedLegTenor(new Period(fixedFrequency))
        .withFixedLegConvention(fixedConvention)
        .withFixedLegTerminationDateConvention(fixedConvention)
        .withFixedLegCalendar(calendar)
        .withFloatingLegCalendar(calendar).value();
View Full Code Here

Examples of org.jquantlib.time.Period

              final Date maturity = calendar.advance(issue, lengths[j], TimeUnit.Years);

              final Schedule sch = new Schedule(
                      dated,
                  maturity,
                  new Period(frequencies[l]),
                  calendar,
                  accrualConvention,
                  accrualConvention,
                  DateGeneration.Rule.Backward,
                  false,
View Full Code Here

Examples of org.jquantlib.time.Period

          final SimpleQuote rate = new SimpleQuote(0.0);
          final Handle<YieldTermStructure> discountCurve = new Handle<YieldTermStructure>(Utilities.flatRate(today, rate, bondDayCount));

          final Schedule sch = new Schedule(
                  dated, maturity,
              new Period(frequency), calendar,
              accrualConvention, accrualConvention,
              Rule.Backward, false);

          final FixedRateBond bond = new FixedRateBond(
                  settlementDays, faceAmount, sch,
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.