Changeset 4896
- Timestamp:
- 07/10/08 13:18:27 (6 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openmrs/branches/complex-obs/src/api/org/openmrs/obs/ComplexData.java
r4289 r4896 19 19 * in the database. It has a data Object and a title. Alternatively, it can have 20 20 * a byte array instead of an Object. 21 * 21 * 22 22 */ 23 23 public class ComplexData implements java.io.Serializable { … … 37 37 /** 38 38 * Default constructor requires title and data. 39 * 39 * 40 40 * @param title Name or brief description of ComplexData. 41 41 * @param data The complex data for an Obs 42 42 */ 43 43 public ComplexData(String title, Object data) { 44 this.type = Type.OBJECT; 44 45 setTitle(title); 45 46 setData(data); 46 this.type = Type.OBJECT;47 47 } 48 48 … … 52 52 * OpenmrsUtil.getFileAsBytes(file); <br/>ComplexData data = new 53 53 * ComplexData("test name", bytes); 54 * 54 * 55 55 * @param title 56 56 * @param bytes 57 57 */ 58 58 public ComplexData(String title, byte[] bytes) { 59 this.type = Type.BYTE; 59 60 setBytes(bytes); 60 61 setTitle(title); 61 this.type = Type.BYTE;62 62 } 63 63 64 64 /** 65 65 * Set the title for this ComplexData 66 * 66 * 67 67 * @param title 68 68 */ … … 73 73 /** 74 74 * Get the title for this ComplexData 75 * 75 * 76 76 * @return 77 77 */ … … 82 82 /** 83 83 * Set the data Object. 84 * 84 * 85 85 * @param data 86 86 */ … … 94 94 * output may not be reliable. TODO: Should this even try to return the byte 95 95 * array? 96 * 96 * 97 97 * @return 98 98 */ … … 106 106 /** 107 107 * Set the byte array. This is alternative to {@link #setData(Object)} 108 * 108 * 109 109 * @param bytes 110 110 */ … … 118 118 * File("text"); <br/> FileOutputStream fout = new FileOutputStream(file); 119 119 * <br/> fout.write(complexData.getBytes()); <br/> 120 * 120 * 121 121 * @return 122 122 */ … … 132 132 * initialized with a byte array, returns ComplexData.Type.BYTE. If 133 133 * initialized with an Object, returns ComplexData.Type.OBJECT. 134 * 134 * 135 135 * @return ComplexData.Type.OBJECT or ComplexData.Type.BYTE 136 136 */ … … 143 143 * this.getData().getClass().getName() except that it safely returns the 144 144 * String "null" if this.data is null. 145 * 145 * 146 146 * TODO: This method is not used anywhere. Should it be deleted? 147 * 147 * 148 148 * @return 149 149 */