Example usage for org.joda.time Chronology dayOfWeek

List of usage examples for org.joda.time Chronology dayOfWeek

Introduction

In this page you can find the example usage for org.joda.time Chronology dayOfWeek.

Prototype

public abstract DateTimeField dayOfWeek();

Source Link

Document

Get the day of week field for this chronology.

Usage

From source file:ch.oakmountain.tpa.solver.PeriodicalTimeFrame.java

License:Apache License

/**
 * Gets the field for a specific index in the chronology specified.
 * <p/>//  w w w. j  av a  2s . co  m
 * This method must not use any instance variables.
 *
 * @param index  the index to retrieve
 * @param chrono the chronology to use
 * @return the field
 */
protected DateTimeField getField(int index, Chronology chrono) {
    switch (index) {
    case DAY_OF_WEEK:
        return chrono.dayOfWeek();
    case MILLIS_OF_DAY:
        return chrono.millisOfDay();
    default:
        throw new IndexOutOfBoundsException("Invalid index: " + index);
    }
}