SheetData.java 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /**
  2. * @(#)file SheetData.java
  3. * @(#)author [개발자명]
  4. * @(#)version 1.0
  5. * @(#)date May 10, 2007
  6. * @(#)since JDK 1.4.2
  7. *
  8. * Copyright (c) www.hwenc.co.kr, Inc.
  9. * All rights reserved.
  10. * This software is the proprietary information of Hanwha E&C, Inc.
  11. */
  12. package kr.co.udapsoft.common.sheet;
  13. import java.util.Hashtable;
  14. import kr.co.hsnc.common.sql.RowSet;
  15. import kr.co.hsnc.common.util.ValueObject;
  16. public class SheetData {
  17. private ValueObject attr = null;
  18. private Hashtable rowsets = null;
  19. private int rowsets_size = -100;
  20. public SheetTR sheetTR = null;
  21. public SheetData() {
  22. this.attr = new ValueObject();
  23. this.rowsets = new Hashtable();
  24. }
  25. /**
  26. * 속성 세팅
  27. * @param key
  28. * @param value
  29. */
  30. public void setAttribute(String key, String value) {
  31. this.attr.set(key, value);
  32. }
  33. /**
  34. * 속성 리턴
  35. * @param key
  36. * @return
  37. */
  38. public String getAttribute(String key) {
  39. return this.attr.get(key);
  40. }
  41. /**
  42. * 속성 전체 리턴
  43. * @return
  44. */
  45. public ValueObject getAttributes() {
  46. return this.attr;
  47. }
  48. /**
  49. * RowSet의 Size를 리
  50. * @return
  51. */
  52. public int getRowSetSize() {
  53. return this.rowsets_size;
  54. }
  55. /**
  56. * RowSet을 세팅
  57. * 2개 이상의 RowSet을 세팅할때 RowSet.size()가 서로 같아야 한다.
  58. * @param rowSetKey
  59. * @param rowSet
  60. */
  61. public void setRowSet(String rowSetKey, RowSet rowSet) throws Exception {
  62. this.rowsets.put(rowSetKey, rowSet);
  63. if( this.rowsets_size == -100 ) {
  64. this.rowsets_size = rowSet.size();
  65. }
  66. else {
  67. if( this.rowsets_size != rowSet.size() ) {
  68. throw new Exception("기존에 세팅된 RowSet의 Size와 현재 입력하려는 RowSet의 Size가 다릅니다.");
  69. }
  70. }
  71. }
  72. /**
  73. * @param rowSetKey
  74. * @return
  75. */
  76. public RowSet getRowSet(String rowSetKey) {
  77. return (RowSet)this.rowsets.get(rowSetKey);
  78. }
  79. /**
  80. * 세팅된 RowSet의 숫자를 리턴
  81. * @return
  82. */
  83. public int getRowSetCount() {
  84. return this.rowsets.size();
  85. }
  86. }