Examples of roll()


Examples of java.util.Calendar.roll()

    int hour = random.nextInt(60) * (random.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.HOUR_OF_DAY, hour);
    int day = random.nextInt(30) * (random.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.DAY_OF_MONTH, day);
    int month = random.nextInt(12) * (random.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.MONTH, month);
   
    // make sure we do not go over the 4 digit year limit, which breaks things
    int year = random.nextInt(5000) * (random.nextBoolean() ? -1 : 1);
   
    // make sure we don't go into negative territory
View Full Code Here

Examples of java.util.Calendar.roll()

  @Override
  public IValue visitDateTime(Type type) {
    Calendar cal = Calendar.getInstance();
    int milliOffset = stRandom.nextInt(1000) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.MILLISECOND, milliOffset);
    int second = stRandom.nextInt(60) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.SECOND, second);
    int minute = stRandom.nextInt(60) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.MINUTE, minute);
    int hour = stRandom.nextInt(60) * (stRandom.nextBoolean() ? -1 : 1);
View Full Code Here

Examples of java.util.Calendar.roll()

  public IValue visitDateTime(Type type) {
    Calendar cal = Calendar.getInstance();
    int milliOffset = stRandom.nextInt(1000) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.MILLISECOND, milliOffset);
    int second = stRandom.nextInt(60) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.SECOND, second);
    int minute = stRandom.nextInt(60) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.MINUTE, minute);
    int hour = stRandom.nextInt(60) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.HOUR_OF_DAY, hour);
    int day = stRandom.nextInt(30) * (stRandom.nextBoolean() ? -1 : 1);
View Full Code Here

Examples of java.util.Calendar.roll()

    int milliOffset = stRandom.nextInt(1000) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.MILLISECOND, milliOffset);
    int second = stRandom.nextInt(60) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.SECOND, second);
    int minute = stRandom.nextInt(60) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.MINUTE, minute);
    int hour = stRandom.nextInt(60) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.HOUR_OF_DAY, hour);
    int day = stRandom.nextInt(30) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.DAY_OF_MONTH, day);
    int month = stRandom.nextInt(12) * (stRandom.nextBoolean() ? -1 : 1);
View Full Code Here

Examples of java.util.Calendar.roll()

    int second = stRandom.nextInt(60) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.SECOND, second);
    int minute = stRandom.nextInt(60) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.MINUTE, minute);
    int hour = stRandom.nextInt(60) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.HOUR_OF_DAY, hour);
    int day = stRandom.nextInt(30) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.DAY_OF_MONTH, day);
    int month = stRandom.nextInt(12) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.MONTH, month);
   
View Full Code Here

Examples of java.util.Calendar.roll()

    int minute = stRandom.nextInt(60) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.MINUTE, minute);
    int hour = stRandom.nextInt(60) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.HOUR_OF_DAY, hour);
    int day = stRandom.nextInt(30) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.DAY_OF_MONTH, day);
    int month = stRandom.nextInt(12) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.MONTH, month);
   
    // make sure we do not go over the 4 digit year limit, which breaks things
    int year = stRandom.nextInt(5000) * (stRandom.nextBoolean() ? -1 : 1);
View Full Code Here

Examples of java.util.Calendar.roll()

    int hour = stRandom.nextInt(60) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.HOUR_OF_DAY, hour);
    int day = stRandom.nextInt(30) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.DAY_OF_MONTH, day);
    int month = stRandom.nextInt(12) * (stRandom.nextBoolean() ? -1 : 1);
    cal.roll(Calendar.MONTH, month);
   
    // make sure we do not go over the 4 digit year limit, which breaks things
    int year = stRandom.nextInt(5000) * (stRandom.nextBoolean() ? -1 : 1);
   
    // make sure we don't go into negative territory
View Full Code Here

Examples of java.util.Calendar.roll()

          label.setText("Fri");
        } else if (dayInt == Calendar.SATURDAY) {
          label.setText("Sat");
        }
        days.add(label);
        setupCalendar.roll(Calendar.DAY_OF_WEEK, true);
      }

      setupCalendar = (Calendar) calendar.clone();
      setupCalendar.set(Calendar.DAY_OF_MONTH, 1);
      int first = setupCalendar.get(Calendar.DAY_OF_WEEK);
View Full Code Here

Examples of java.util.Calendar.roll()

  private void update(int addend, boolean shifted){
    Calendar c = parseDate(getText());
    int pos = getCaretPosition();
    int field = posToField(pos);
    if (shifted){
      c.roll(field,true);
    } else {
      c.add(field,addend);
    }
    String newDate =dateFormat.format(c.getTime());
    setText(newDate);
View Full Code Here

Examples of java.util.Calendar.roll()

        return df;
    }

    private static long calculateExpiryDate() {
        Calendar cal = Calendar.getInstance();
        cal.roll(Calendar.MONTH, 1);
        return cal.getTime().getTime();
    }

    public static void fastChannelCopy(final InputStream in, final OutputStream out) throws IOException {
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.