Skip to content

Commit 49e623c

Browse files
authored
add column index accessors to FilteredBank (#1383)
* add column-index accessors * extension class too
1 parent bd0b4aa commit 49e623c

2 files changed

Lines changed: 90 additions & 0 deletions

File tree

‎common-tools/clas-detector/src/main/java/org/jlab/detector/banks/FilteredBank.java‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,51 @@ public float getFloat(String varName, int index ){
135135
return bank.getFloat(varName, indexList.get(index));
136136
}
137137

138+
/**
139+
* @param column
140+
* @param index filtered index to retrieve
141+
* @return value for the filtered index
142+
*/
143+
public int getByte(int column, int index ){
144+
return bank.getByte(column, indexList.get(index));
145+
}
146+
147+
/**
148+
* @param column
149+
* @param index filtered index to retrieve
150+
* @return value for the filtered index
151+
*/
152+
public int getShort(int column, int index ){
153+
return bank.getShort(column, indexList.get(index));
154+
}
155+
156+
/**
157+
* @param column
158+
* @param index filtered index to retrieve
159+
* @return value for the filtered index
160+
*/
161+
public int getInt(int column, int index ){
162+
return bank.getInt(column, indexList.get(index));
163+
}
164+
165+
/**
166+
* @param column
167+
* @param index filtered index to retrieve
168+
* @return value for the filtered index
169+
*/
170+
public long getLong(int column, int index ){
171+
return bank.getLong(column, indexList.get(index));
172+
}
173+
174+
/**
175+
* @param column
176+
* @param index filtered index to retrieve
177+
* @return value for the filtered index
178+
*/
179+
public float getFloat(int column , int index ){
180+
return bank.getFloat(column, indexList.get(index));
181+
}
182+
138183
/**
139184
* @param index filtered index to retrieve
140185
* @return true bank row index corresponding to the filtered index

‎common-tools/clas-detector/src/main/java/org/jlab/detector/banks/RawDataBank.java‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,51 @@ public float getFloat(String varName, int index ){
9898
return dataBank.getFloat(varName, indexList.get(index));
9999
}
100100

101+
/**
102+
* @param index filtered index to retrieve
103+
* @return value for the filtered index
104+
*/
105+
@Override
106+
public int getByte(int column, int index ){
107+
return dataBank.getByte(column, indexList.get(index));
108+
}
109+
110+
/**
111+
* @param index filtered index to retrieve
112+
* @return value for the filtered index
113+
*/
114+
@Override
115+
public int getShort(int column, int index ){
116+
return dataBank.getShort(column, indexList.get(index));
117+
}
118+
119+
/**
120+
* @param index filtered index to retrieve
121+
* @return value for the filtered index
122+
*/
123+
@Override
124+
public int getInt(int column, int index ){
125+
return dataBank.getInt(column, indexList.get(index));
126+
}
127+
128+
/**
129+
* @param index filtered index to retrieve
130+
* @return value for the filtered index
131+
*/
132+
@Override
133+
public long getLong(int column, int index ){
134+
return dataBank.getLong(column, indexList.get(index));
135+
}
136+
137+
/**
138+
* @param index filtered index to retrieve
139+
* @return value for the filtered index
140+
*/
141+
@Override
142+
public float getFloat(int column, int index ){
143+
return dataBank.getFloat(column, indexList.get(index));
144+
}
145+
101146
public static void main(String[] args){
102147

103148
RawDataBank ftof = new RawDataBank("FTOF::adc");

0 commit comments

Comments
 (0)