Package pt.opensoft.util

Examples of pt.opensoft.util.Date


  }

  public abstract boolean contains (String holidayRegion, DateTime date);

  public Date getDate (int year) {
    return new Date(year, month, day);
  }
View Full Code Here


  public static void add (Date day) {
    nonWorkingDays.add(day);
  }

  public static boolean isNonWorkingDay (DateTime date) {
    return isNonWorkingDay(new Date(date));
  }
View Full Code Here

  public static boolean isNonWorkingDay (Date date) {
    int weekDay = date.getWeekDay();
    if (weekDay == Week.SABADO || weekDay == Week.DOMINGO) return true;
    for (Iterator iterator = nonWorkingDays.iterator(); iterator.hasNext();) {
      Date data = (Date) iterator.next();
      if (data.getTime() == date.getTime()) return true;
    }
    return false;
  }
View Full Code Here

abstract class ProducerConsumer extends Thread {

    private static final long DEFAULT_SLEEP_ON_ERROR = 5 * 60 * 1000;

    protected static DateTime getNextDate(String weekDayName, String hour) {
        DateTime date = new DateTime(new Date().formatDate() + " " + hour);
        int weekDay = Week.getWeekDay(weekDayName);
        if (weekDay == -1) throw new IllegalArgumentException("invalid week day name: " + weekDayName);
        int diff = weekDay - date.getWeekDay();
        date = date.addDays(diff < 0 ? diff + 7 : diff);
        return date;
View Full Code Here

    return filename;
  }

  public synchronized void open () {
    if (writer != null) return;
    Date now = new Date();
    day = now.getDay();
    try {
      writer = new PrintWriter(new OutputStreamWriter(new FileOutputStream(filename + "-" + now.format()
        + ".log", true), SystemParameters.DEFAULT_ENCODING), true);
    } catch (IOException e) {
      throw new LogException(e);
    }
  }
View Full Code Here

TOP

Related Classes of pt.opensoft.util.Date

Copyright © 2018 www.massapicom. 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.