You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Row.java 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /*
  2. Copyright (c) 2013 James Ahlborn
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. package com.healthmarketscience.jackcess;
  14. import java.io.IOException;
  15. import java.util.Date;
  16. import java.util.Map;
  17. import java.math.BigDecimal;
  18. import com.healthmarketscience.jackcess.complex.ComplexValueForeignKey;
  19. import com.healthmarketscience.jackcess.util.OleBlob;
  20. /**
  21. * A row of data as column name->value pairs. Values are strongly typed, and
  22. * column names are case sensitive.
  23. *
  24. * @author James Ahlborn
  25. * @usage _general_class_
  26. */
  27. public interface Row extends Map<String,Object>
  28. {
  29. /**
  30. * @return the id of this row
  31. */
  32. public RowId getId();
  33. /**
  34. * Convenience method which gets the value for the row with the given name,
  35. * casting it to a String (DataTypes TEXT, MEMO, GUID).
  36. */
  37. public String getString(String name);
  38. /**
  39. * Convenience method which gets the value for the row with the given name,
  40. * casting it to a Boolean (DataType BOOLEAN).
  41. */
  42. public Boolean getBoolean(String name);
  43. /**
  44. * Convenience method which gets the value for the row with the given name,
  45. * casting it to a Byte (DataType BYTE).
  46. */
  47. public Byte getByte(String name);
  48. /**
  49. * Convenience method which gets the value for the row with the given name,
  50. * casting it to a Short (DataType INT).
  51. */
  52. public Short getShort(String name);
  53. /**
  54. * Convenience method which gets the value for the row with the given name,
  55. * casting it to a Integer (DataType LONG).
  56. */
  57. public Integer getInt(String name);
  58. /**
  59. * Convenience method which gets the value for the row with the given name,
  60. * casting it to a BigDecimal (DataTypes MONEY, NUMERIC).
  61. */
  62. public BigDecimal getBigDecimal(String name);
  63. /**
  64. * Convenience method which gets the value for the row with the given name,
  65. * casting it to a Float (DataType FLOAT).
  66. */
  67. public Float getFloat(String name);
  68. /**
  69. * Convenience method which gets the value for the row with the given name,
  70. * casting it to a Double (DataType DOUBLE).
  71. */
  72. public Double getDouble(String name);
  73. /**
  74. * Convenience method which gets the value for the row with the given name,
  75. * casting it to a Date (DataType SHORT_DATE_TIME).
  76. */
  77. public Date getDate(String name);
  78. /**
  79. * Convenience method which gets the value for the row with the given name,
  80. * casting it to a byte[] (DataTypes BINARY, OLE).
  81. */
  82. public byte[] getBytes(String name);
  83. /**
  84. * Convenience method which gets the value for the row with the given name,
  85. * casting it to a {@link ComplexValueForeignKey} (DataType COMPLEX_TYPE).
  86. */
  87. public ComplexValueForeignKey getForeignKey(String name);
  88. /**
  89. * Convenience method which gets the value for the row with the given name,
  90. * converting it to an {@link OleBlob} (DataTypes OLE).
  91. * </p>
  92. * Note, <i>the OleBlob should be closed after use</i>.
  93. */
  94. public OleBlob getBlob(String name) throws IOException;
  95. }