Java Code Examples for org.jfree.data.time.RegularTimePeriod#getMiddleMillisecond()

The following examples show how to use org.jfree.data.time.RegularTimePeriod#getMiddleMillisecond() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OHLCSeriesCollection.java    From ECG-Viewer with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the x-value for a time period.
 *
 * @param period  the time period (<code>null</code> not permitted).
 *
 * @return The x-value.
 */
protected synchronized long getX(RegularTimePeriod period) {
    long result = 0L;
    if (this.xPosition == TimePeriodAnchor.START) {
        result = period.getFirstMillisecond();
    }
    else if (this.xPosition == TimePeriodAnchor.MIDDLE) {
        result = period.getMiddleMillisecond();
    }
    else if (this.xPosition == TimePeriodAnchor.END) {
        result = period.getLastMillisecond();
    }
    return result;
}
 
Example 2
Source File: OHLCSeriesCollection.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns the x-value for a time period.
 *
 * @param period  the time period (<code>null</code> not permitted).
 *
 * @return The x-value.
 */
protected synchronized long getX(RegularTimePeriod period) {
    long result = 0L;
    if (this.xPosition == TimePeriodAnchor.START) {
        result = period.getFirstMillisecond();
    }
    else if (this.xPosition == TimePeriodAnchor.MIDDLE) {
        result = period.getMiddleMillisecond();
    }
    else if (this.xPosition == TimePeriodAnchor.END) {
        result = period.getLastMillisecond();
    }
    return result;
}
 
Example 3
Source File: OHLCSeriesCollection.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns the x-value for a time period.
 *
 * @param period  the time period (<code>null</code> not permitted).
 *
 * @return The x-value.
 */
protected synchronized long getX(RegularTimePeriod period) {
    long result = 0L;
    if (this.xPosition == TimePeriodAnchor.START) {
        result = period.getFirstMillisecond();
    }
    else if (this.xPosition == TimePeriodAnchor.MIDDLE) {
        result = period.getMiddleMillisecond();
    }
    else if (this.xPosition == TimePeriodAnchor.END) {
        result = period.getLastMillisecond();
    }
    return result;
}
 
Example 4
Source File: OHLCSeriesCollection.java    From opensim-gui with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the x-value for a time period.
 *
 * @param period  the time period (<code>null</code> not permitted).
 *
 * @return The x-value.
 */
protected synchronized long getX(RegularTimePeriod period) {
    long result = 0L;
    if (this.xPosition == TimePeriodAnchor.START) {
        result = period.getFirstMillisecond();
    }
    else if (this.xPosition == TimePeriodAnchor.MIDDLE) {
        result = period.getMiddleMillisecond();
    }
    else if (this.xPosition == TimePeriodAnchor.END) {
        result = period.getLastMillisecond(); 
    }
    return result;
}
 
Example 5
Source File: OHLCSeriesCollection.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the x-value for a time period.
 *
 * @param period  the time period (<code>null</code> not permitted).
 *
 * @return The x-value.
 */
protected synchronized long getX(RegularTimePeriod period) {
    long result = 0L;
    if (this.xPosition == TimePeriodAnchor.START) {
        result = period.getFirstMillisecond();
    }
    else if (this.xPosition == TimePeriodAnchor.MIDDLE) {
        result = period.getMiddleMillisecond();
    }
    else if (this.xPosition == TimePeriodAnchor.END) {
        result = period.getLastMillisecond(); 
    }
    return result;
}
 
Example 6
Source File: OHLCSeriesCollection.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the x-value for a time period.
 *
 * @param period  the time period (<code>null</code> not permitted).
 *
 * @return The x-value.
 */
protected synchronized long getX(RegularTimePeriod period) {
    long result = 0L;
    if (this.xPosition == TimePeriodAnchor.START) {
        result = period.getFirstMillisecond();
    }
    else if (this.xPosition == TimePeriodAnchor.MIDDLE) {
        result = period.getMiddleMillisecond();
    }
    else if (this.xPosition == TimePeriodAnchor.END) {
        result = period.getLastMillisecond();
    }
    return result;
}
 
Example 7
Source File: OHLCSeriesCollection.java    From SIMVA-SoS with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the x-value for a time period.
 *
 * @param period  the time period (<code>null</code> not permitted).
 *
 * @return The x-value.
 */
protected synchronized long getX(RegularTimePeriod period) {
    long result = 0L;
    if (this.xPosition == TimePeriodAnchor.START) {
        result = period.getFirstMillisecond();
    }
    else if (this.xPosition == TimePeriodAnchor.MIDDLE) {
        result = period.getMiddleMillisecond();
    }
    else if (this.xPosition == TimePeriodAnchor.END) {
        result = period.getLastMillisecond();
    }
    return result;
}
 
Example 8
Source File: OHLCSeriesCollection.java    From ccu-historian with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns the x-value for a time period.
 *
 * @param period  the time period (<code>null</code> not permitted).
 *
 * @return The x-value.
 */
protected synchronized long getX(RegularTimePeriod period) {
    long result = 0L;
    if (this.xPosition == TimePeriodAnchor.START) {
        result = period.getFirstMillisecond();
    }
    else if (this.xPosition == TimePeriodAnchor.MIDDLE) {
        result = period.getMiddleMillisecond();
    }
    else if (this.xPosition == TimePeriodAnchor.END) {
        result = period.getLastMillisecond();
    }
    return result;
}
 
Example 9
Source File: OHLCSeriesCollection.java    From openstock with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns the x-value for a time period.
 *
 * @param period  the time period (<code>null</code> not permitted).
 *
 * @return The x-value.
 */
protected synchronized long getX(RegularTimePeriod period) {
    long result = 0L;
    if (this.xPosition == TimePeriodAnchor.START) {
        result = period.getFirstMillisecond();
    }
    else if (this.xPosition == TimePeriodAnchor.MIDDLE) {
        result = period.getMiddleMillisecond();
    }
    else if (this.xPosition == TimePeriodAnchor.END) {
        result = period.getLastMillisecond();
    }
    return result;
}
 
Example 10
Source File: SeriesWrapper.java    From swift-k with Apache License 2.0 4 votes vote down vote up
@Override
public int getIndex(RegularTimePeriod period) {
    return (int) ((period.getMiddleMillisecond() / 1000) - sampler.getOffset());
}
 
Example 11
Source File: DefaultWindDatasetTest.java    From ECG-Viewer with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Creates an array representing one item in a series.
 *
 * @param t  the time period.
 * @param dir  the wind direction.
 * @param force  the wind force.
 *
 * @return An array containing the specified items.
 */
private Object[] createItem(RegularTimePeriod t, int dir, int force) {
    return new Object[] {new Long(t.getMiddleMillisecond()),
            new Integer(dir), new Integer(force)};
}
 
Example 12
Source File: DefaultWindDatasetTest.java    From openstock with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Creates an array representing one item in a series.
 *
 * @param t  the time period.
 * @param dir  the wind direction.
 * @param force  the wind force.
 *
 * @return An array containing the specified items.
 */
private Object[] createItem(RegularTimePeriod t, int dir, int force) {
    return new Object[] {new Long(t.getMiddleMillisecond()),
            new Integer(dir), new Integer(force)};
}
 
Example 13
Source File: DefaultWindDatasetTests.java    From astor with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Creates an array representing one item in a series.
 *
 * @param t  the time period.
 * @param dir  the wind direction.
 * @param force  the wind force.
 *
 * @return An array containing the specified items.
 */
private Object[] createItem(RegularTimePeriod t, int dir, int force) {
    return new Object[] {new Long(t.getMiddleMillisecond()),
            new Integer(dir), new Integer(force)};
}
 
Example 14
Source File: DefaultWindDatasetTests.java    From astor with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Creates an array representing one item in a series.
 * 
 * @param t  the time period.
 * @param dir  the wind direction.
 * @param force  the wind force.
 * 
 * @return An array containing the specified items.
 */
private Object[] createItem(RegularTimePeriod t, int dir, int force) {
    return new Object[] { new Long(t.getMiddleMillisecond()), 
            new Integer(dir), new Integer(force) };
}
 
Example 15
Source File: DefaultWindDatasetTest.java    From SIMVA-SoS with Apache License 2.0 2 votes vote down vote up
/**
 * Creates an array representing one item in a series.
 *
 * @param t  the time period.
 * @param dir  the wind direction.
 * @param force  the wind force.
 *
 * @return An array containing the specified items.
 */
private Object[] createItem(RegularTimePeriod t, int dir, int force) {
    return new Object[] {new Long(t.getMiddleMillisecond()),
            new Integer(dir), new Integer(force)};
}
 
Example 16
Source File: DefaultWindDatasetTest.java    From buffer_bci with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Creates an array representing one item in a series.
 *
 * @param t  the time period.
 * @param dir  the wind direction.
 * @param force  the wind force.
 *
 * @return An array containing the specified items.
 */
private Object[] createItem(RegularTimePeriod t, int dir, int force) {
    return new Object[] {new Long(t.getMiddleMillisecond()),
            new Integer(dir), new Integer(force)};
}
 
Example 17
Source File: DefaultWindDatasetTest.java    From ccu-historian with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Creates an array representing one item in a series.
 *
 * @param t  the time period.
 * @param dir  the wind direction.
 * @param force  the wind force.
 *
 * @return An array containing the specified items.
 */
private Object[] createItem(RegularTimePeriod t, int dir, int force) {
    return new Object[] {new Long(t.getMiddleMillisecond()),
            new Integer(dir), new Integer(force)};
}