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.

TextColumnImpl.java 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 Text data types.
  17. *
  18. * @author James Ahlborn
  19. * @usage _advanced_class_
  20. */
  21. class TextColumnImpl extends ColumnImpl
  22. {
  23. /** whether or not they are compressed */
  24. private final boolean _compressedUnicode;
  25. /** the collating sort order for a text field */
  26. private final SortOrder _sortOrder;
  27. /** the code page for a text field (for certain db versions) */
  28. private final short _codePage;
  29. TextColumnImpl(InitArgs args) throws IOException
  30. {
  31. super(args);
  32. // co-located w/ precision/scale
  33. _sortOrder = readSortOrder(
  34. args.buffer, args.offset + getFormat().OFFSET_COLUMN_SORT_ORDER,
  35. getFormat());
  36. _codePage = readCodePage(args.buffer, args.offset, getFormat());
  37. _compressedUnicode =
  38. ((args.extFlags & COMPRESSED_UNICODE_EXT_FLAG_MASK) != 0);
  39. }
  40. @Override
  41. public boolean isCompressedUnicode() {
  42. return _compressedUnicode;
  43. }
  44. @Override
  45. public short getTextCodePage() {
  46. return _codePage;
  47. }
  48. @Override
  49. public SortOrder getTextSortOrder() {
  50. return _sortOrder;
  51. }
  52. }