1. /* ===========================================================
  2. * JFreeChart : a free chart library for the Java(tm) platform
  3. * ===========================================================
  4. *
  5. * (C) Copyright 2000-2004, by Object Refinery Limited and Contributors.
  6. *
  7. * Project Info: http://www.jfree.org/jfreechart/index.html
  8. *
  9. * This library is free software; you can redistribute it and/or modify it under the terms
  10. * of the GNU Lesser General Public License as published by the Free Software Foundation;
  11. * either version 2.1 of the License, or (at your option) any later version.
  12. *
  13. * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  14. * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  15. * See the GNU Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public License along with this
  18. * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  19. * Boston, MA 02111-1307, USA.
  20. *
  21. * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
  22. * in the United States and other countries.]
  23. *
  24. * ----------------
  25. * OHLCDataset.java
  26. * ----------------
  27. * (C) Copyright 2001-2004, by Object Refinery Limited.
  28. *
  29. * Original Author: David Gilbert (for Object Refinery Limited);
  30. * Contributor(s): Sylvain Vieujot;
  31. *
  32. * $Id: OHLCDataset.java,v 1.2 2004/09/08 09:14:58 mungady Exp $
  33. *
  34. * Changes (from 18-Sep-2001)
  35. * --------------------------
  36. * 18-Sep-2001 : Updated header info (DG);
  37. * 16-Oct-2001 : Moved to package com.jrefinery.data.* (DG);
  38. * 22-Oct-2001 : Renamed DataSource.java --> Dataset.java etc. (DG);
  39. * 05-Feb-2002 : Added getVolumeValue() method, as requested by Sylvain Vieujot (DG);
  40. * 05-May-2004 : Added methods that return double primitives (DG);
  41. * 26-Jul-2004 : Switched names of methods that return Number vs primitives (DG);
  42. * 06-Sep-2004 : Renamed HighLowDataset --> OHLCDataset (DG);
  43. *
  44. */
  45. package org.jfree.data.xy;
  46. /**
  47. * An interface that defines data in the form of (x, high, low, open, close) tuples.
  48. */
  49. public interface OHLCDataset extends XYDataset {
  50. /**
  51. * Returns the high-value for the specified series and item.
  52. *
  53. * @param series the series (zero-based index).
  54. * @param item the item (zero-based index).
  55. *
  56. * @return The value.
  57. */
  58. public Number getHigh(int series, int item);
  59. /**
  60. * Returns the high-value (as a double primitive) for an item within a series.
  61. *
  62. * @param series the series (zero-based index).
  63. * @param item the item (zero-based index).
  64. *
  65. * @return The high-value.
  66. */
  67. public double getHighValue(int series, int item);
  68. /**
  69. * Returns the low-value for the specified series and item.
  70. *
  71. * @param series the series (zero-based index).
  72. * @param item the item (zero-based index).
  73. *
  74. * @return The value.
  75. */
  76. public Number getLow(int series, int item);
  77. /**
  78. * Returns the low-value (as a double primitive) for an item within a series.
  79. *
  80. * @param series the series (zero-based index).
  81. * @param item the item (zero-based index).
  82. *
  83. * @return The low-value.
  84. */
  85. public double getLowValue(int series, int item);
  86. /**
  87. * Returns the open-value for the specified series and item.
  88. *
  89. * @param series the series (zero-based index).
  90. * @param item the item (zero-based index).
  91. *
  92. * @return The value.
  93. */
  94. public Number getOpen(int series, int item);
  95. /**
  96. * Returns the open-value (as a double primitive) for an item within a series.
  97. *
  98. * @param series the series (zero-based index).
  99. * @param item the item (zero-based index).
  100. *
  101. * @return The open-value.
  102. */
  103. public double getOpenValue(int series, int item);
  104. /**
  105. * Returns the y-value for the specified series and item.
  106. *
  107. * @param series the series (zero-based index).
  108. * @param item the item (zero-based index).
  109. *
  110. * @return The value.
  111. */
  112. public Number getClose(int series, int item);
  113. /**
  114. * Returns the close-value (as a double primitive) for an item within a series.
  115. *
  116. * @param series the series (zero-based index).
  117. * @param item the item (zero-based index).
  118. *
  119. * @return The close-value.
  120. */
  121. public double getCloseValue(int series, int item);
  122. /**
  123. * Returns the volume for the specified series and item.
  124. *
  125. * @param series the series (zero-based index).
  126. * @param item the item (zero-based index).
  127. *
  128. * @return The value.
  129. */
  130. public Number getVolume(int series, int item);
  131. /**
  132. * Returns the volume-value (as a double primitive) for an item within a series.
  133. *
  134. * @param series the series (zero-based index).
  135. * @param item the item (zero-based index).
  136. *
  137. * @return The volume-value.
  138. */
  139. public double getVolumeValue(int series, int item);
  140. }