Package java.util

Examples of java.util.Calendar.clear()


    for (i = 0; i < numBatches; i++) {
      Transaction txn = channel.getTransaction();
      txn.begin();
      for (j = 1; j <= batchSize; j++) {
        Event event = new SimpleEvent();
        eventDate.clear();
        eventDate.set(2011, i, i, i, 0); // yy mm dd
        event.getHeaders().put("timestamp",
            String.valueOf(eventDate.getTimeInMillis()));
        event.getHeaders().put("hostname", "Host" + i);
        event.getHeaders().put("slow", "1500");
View Full Code Here


    for (i = 0; i < numBatches; i++) {
      Transaction txn = channel.getTransaction();
      txn.begin();
      for (j = 1; j <= batchSize; j++) {
        Event event = new SimpleEvent();
        eventDate.clear();
        eventDate.set(2011, i, i, i, 0); // yy mm dd
        event.getHeaders().put("timestamp",
            String.valueOf(eventDate.getTimeInMillis()));
        event.getHeaders().put("hostname", "Host" + i);
        event.getHeaders().put("slow", "1500");
View Full Code Here

        final   int endindex = (start+length)-1;

        try
        {
            if (length < 16) throw new ParseException("Value is too short.",0);
            cal.clear();
            cal.setLenient(false);
//     If there's a leading sign, set the appropriate Era.
            if (value[i]=='-'||value[i]=='+')
            {
                cal.set(Calendar.ERA, (value[i]=='-'?GregorianCalendar.BC:GregorianCalendar.AD));
View Full Code Here

        final   int endindex = (start+length)-1;

        try
        {
            if (length < 16) throw new ParseException("Value is too short.",0);
            cal.clear();
            cal.setLenient(false);
//  If there's a leading sign, set the appropriate Era.
            if (value[i]=='-'||value[i]=='+')
            {
                cal.set(Calendar.ERA, (value[i]=='-'?GregorianCalendar.BC:GregorianCalendar.AD));
View Full Code Here

     * @deprecated since ISO8601DateFormat is deprecated
     */
  public void testISO8601Format() {
      DateFormat format = new ISO8601DateFormat();
      Calendar calendar = Calendar.getInstance();
      calendar.clear();
      calendar.set(1970, 0, 1, 0, 0, 0);
      String actual = format.format(calendar.getTime());
      assertEquals("1970-01-01 00:00:00,000", actual);
  }

View Full Code Here

     * @deprecated since DateTimeDateFormat is deprecated
     */
  public void testDateTimeFormat() {
      DateFormat format = new DateTimeDateFormat();
      Calendar calendar = Calendar.getInstance();
      calendar.clear();
      calendar.set(1970, 0, 1, 0, 0, 0);
      String actual = format.format(calendar.getTime());
      SimpleDateFormat df = new SimpleDateFormat("dd MMM yyyy HH:mm:ss,SSS");
      String expected = df.format(calendar.getTime());
      assertEquals(expected, actual);
View Full Code Here

    int [] M31 = {0,2,4,6,7,9,11};

    for(int i = 0; i < M31.length; i ++) {
      for(int d = 1; d <=31; d++) {
    for(int h = 0; h < 23; h++) {
      c.clear();
      c.set(Calendar.YEAR, 20);
      c.set(Calendar.MONTH, Calendar.JANUARY + M31[i]);
      c.set(Calendar.DAY_OF_MONTH, d);
      c.set(Calendar.HOUR_OF_DAY, h);
      c.set(Calendar.MINUTE, 10);
View Full Code Here

    for(int i = 0; i < M31.length; i ++) {
      System.out.println("Month = "+(M31[i]+1));
      for(int d = 1; d <= 31; d++) {
    for(int h = 0; h < 23; h++) {
      for(int m = 0; m <= 59; m++) {
        c.clear();
        c.set(Calendar.YEAR, 20);
        c.set(Calendar.MONTH, Calendar.JANUARY + M31[i]);
        c.set(Calendar.DAY_OF_MONTH, d);
        c.set(Calendar.HOUR_OF_DAY, h);
        c.set(Calendar.MINUTE, m);
View Full Code Here

      System.out.println("Month = "+(M31[i]+1));
      for(int d = 1; d <= 31; d++) {
    for(int h = 0; h < 23; h++) {
      for(int m = 0; m < M.length; m++) {
        for(int s = 0; s < S.length; s++) {
          c.clear();
          c.set(Calendar.YEAR, 20);
          c.set(Calendar.MONTH, Calendar.JANUARY + M31[i]);
          c.set(Calendar.DAY_OF_MONTH, d);
          c.set(Calendar.HOUR_OF_DAY, h);
          c.set(Calendar.MINUTE, M[m]);
View Full Code Here

        /* Default GregorianCalendar initializes to current time.
         * Make sure we clear that out before returning, per the
         * contract of this method.
         */
        Calendar result = new java.util.GregorianCalendar();
        result.clear();
        return result;
    }

    // *********************************************************
    // ******* CROSS input converters (class -> byte[]) ********
 
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.