1 package nom.tam.fits.compression.provider.param.api; 2 3 /* 4 * #%L 5 * nom.tam FITS library 6 * %% 7 * Copyright (C) 1996 - 2024 nom-tam-fits 8 * %% 9 * This is free and unencumbered software released into the public domain. 10 * 11 * Anyone is free to copy, modify, publish, use, compile, sell, or 12 * distribute this software, either in source code form or as a compiled 13 * binary, for any purpose, commercial or non-commercial, and by any 14 * means. 15 * 16 * In jurisdictions that recognize copyright laws, the author or authors 17 * of this software dedicate any and all copyright interest in the 18 * software to the public domain. We make this dedication for the benefit 19 * of the public at large and to the detriment of our heirs and 20 * successors. We intend this dedication to be an overt act of 21 * relinquishment in perpetuity of all present and future rights to this 22 * software under copyright law. 23 * 24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 27 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 28 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 29 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 30 * OTHER DEALINGS IN THE SOFTWARE. 31 * #L% 32 */ 33 34 /** 35 * <p> 36 * (<i>for internal use</i>) Compression parameters that are stored in the table along with the compressed data. Each 37 * parameter is associated to a comlumn in the table, and the parameter takes the value that is stored in the same row 38 * as the compressed data themselves. 39 * </p> 40 * <p> 41 * It is possible to make independent copies of a set of such parameters, e.g. for parallel processing. In such cases 42 * all copies share their underlying column data with the original, so changing the sotrage array of column data in 43 * either the original or any of its decendants will affect the original and all decendans equally. 44 * </p> 45 */ 46 public interface ICompressColumnParameter extends ICompressParameter { 47 /** 48 * Returns the data column, in which each entry stores the parameter value for the compressed data of the 49 * corresponding row in the table. 50 * 51 * @return The array that contains the data for each compressed row. 52 * 53 * @see #setColumnData(Object, int) 54 * @see #getValueFromColumn(int) 55 * @see #setValueInColumn(int) 56 * 57 * @since 1.18 58 */ 59 Object getColumnData(); 60 61 /** 62 * @deprecated Provided for back compatibility only. Use {@link #getColumnData()} instead. 63 * 64 * @return The array that contains the data for each compressed row. 65 */ 66 @Deprecated 67 default Object column() { 68 return getColumnData(); 69 } 70 71 /** 72 * @deprecated Provided for back compatibility only. Use {@link #getColumnData()} instead. 73 * 74 * @return The array that contains the data for each compressed row. 75 */ 76 @Deprecated 77 default Object initializedColumn() { 78 return getColumnData(); 79 } 80 81 /** 82 * Sets new parameter data for each compressed row to be stored along as a separate parameter column in the 83 * compressed table. To discard prior column data with no replacement, you can call this as 84 * <code>setColumnData(null, 0)</code>. 85 * 86 * @param column The array that contains the data for each compressed row. If not <code>null</code> the 87 * <code>size</code> parameter is ignored, and the size of the array is used instead. 88 * @param size The number of compressed rows in the table, if the <code>column</code> argument is 89 * <code>null</code>. If <code>size</code> is zero or negative, any prior column data will be 90 * discarded and <code>null</code> will be set. 91 * 92 * @see #getColumnData() 93 */ 94 void setColumnData(Object column, int size); 95 96 /** 97 * @deprecated Provided for back compatibility only. Use {@link #setColumnData(Object, int)} instead. 98 * 99 * @param column The array that contains the data for each compressed row. If not <code>null</code> the 100 * <code>size</code> parameter is ignored, and the size of the array is used instead. 101 * @param size The number of compressed rows in the table, if the <code>column</code> argument is 102 * <code>null</code> 103 */ 104 @Deprecated 105 default void column(Object column, int size) { 106 setColumnData(column, size); 107 } 108 109 /** 110 * Updates the associated compression options to use the parameter value defined to the compressed tile of the 111 * specified index. 112 * 113 * @param index the tile index, a.k.a. row index in the compressed data table. 114 * 115 * @see #setValueInColumn(int) 116 * @see #setColumnData(Object, int) 117 */ 118 void getValueFromColumn(int index); 119 120 /** 121 * Stores the current parameter value of the associated compression options for the tile of the specified index. 122 * 123 * @param index the tile index, a.k.a. row index in the compressed data table. 124 * 125 * @see #getValueFromColumn(int) 126 * @see #setColumnData(Object, int) 127 */ 128 void setValueInColumn(int index); 129 130 /** 131 * @deprecated Provided for back compatibility only. Use {@link #setValueInColumn(int)} instead. 132 * 133 * @param index the tile index, a.k.a. row index in the compressed data table. 134 */ 135 @Deprecated 136 default void setValueFromColumn(int index) { 137 setValueInColumn(index); 138 } 139 140 }