Example usage for org.jfree.data.time TimePeriod getEnd

List of usage examples for org.jfree.data.time TimePeriod getEnd

Introduction

In this page you can find the example usage for org.jfree.data.time TimePeriod getEnd.

Prototype

public Date getEnd();

Source Link

Document

Returns the end date/time.

Usage

From source file:org.jfree.data.time.TimeTableXYDataset.java

/**
 * Returns the x-value for a time period.
 *
 * @param period  the time period./*from w  w w  .j av a2 s. c o m*/
 *
 * @return The x-value.
 */
private long getXValue(TimePeriod period) {
    long result = 0L;
    if (this.xPosition == TimePeriodAnchor.START) {
        result = period.getStart().getTime();
    } else if (this.xPosition == TimePeriodAnchor.MIDDLE) {
        long t0 = period.getStart().getTime();
        long t1 = period.getEnd().getTime();
        result = t0 + (t1 - t0) / 2L;
    } else if (this.xPosition == TimePeriodAnchor.END) {
        result = period.getEnd().getTime();
    }
    return result;
}