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.

NumericColumnImpl.java 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. Copyright (c) 2014 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.impl;
  14. import java.io.IOException;
  15. /**
  16. * ColumnImpl subclass which is used for numeric data types.
  17. *
  18. * @author James Ahlborn
  19. * @usage _advanced_class_
  20. */
  21. class NumericColumnImpl extends ColumnImpl
  22. {
  23. /** Numeric precision */
  24. private final byte _precision;
  25. /** Numeric scale */
  26. private final byte _scale;
  27. NumericColumnImpl(InitArgs args) throws IOException
  28. {
  29. super(args);
  30. _precision = args.buffer.get(
  31. args.offset + getFormat().OFFSET_COLUMN_PRECISION);
  32. _scale = args.buffer.get(args.offset + getFormat().OFFSET_COLUMN_SCALE);
  33. }
  34. @Override
  35. public byte getPrecision() {
  36. return _precision;
  37. }
  38. @Override
  39. public byte getScale() {
  40. return _scale;
  41. }
  42. }