001 /**
002 * Copyright 2007 Mike Kroutikov.
003 *
004 * This program is free software; you can redistribute it and/or modify
005 * it under the terms of the Lesser GNU General Public License as
006 * published by the Free Software Foundation; either version 3 of
007 * the License, or (at your option) any later version.
008 *
009 * This program is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
012 * Lesser GNU General Public License for more details.
013 *
014 * You should have received a copy of the Lesser GNU General Public License
015 * along with this program. If not, see <http://www.gnu.org/licenses/>.
016 */
017
018 package org.otfeed.command;
019
020 /**
021 * Enumerates time units used for aggregation.
022 * {@link #TICKS} is a special "quasi-time" unit, specifying
023 * how many ticks to aggregate. For example, asking for
024 * {@link #DAYS} with interval 1 will return trade quotes
025 * aggregated during the day; {@link #MINUTES} with interval 5
026 * will return quotes aggregated on a 5-minute basis;
027 * {@link #TICKS} with interval 10 will return quotes
028 * aggregated on a 10-tick basis.
029 *
030 * See also {@link org.otfeed.command.HistDataCommand HistDataCommand}.
031 */
032 public enum TimeUnitEnum {
033
034 /** Ticks */
035 TICKS (2),
036
037 /** Minutes */
038 MINUTES (3),
039
040 /** Hours */
041 HOURS (4),
042
043 /** Days */
044 DAYS (5),
045
046 /** Weeks */
047 WEEKS (6),
048
049 /** Months */
050 MONTHS (7),
051
052 /** Years */
053 YEARS (8);
054
055 public final int code;
056
057 private TimeUnitEnum(int code) {
058 this.code = code;
059 }
060 }