Author: [log in to unmask] Date: Thu Oct 23 00:49:44 2014 New Revision: 1279 Log: Extend AbstractSvtConditions and clean up. Modified: java/branches/hps_java_trunk_HPSJAVA-255/conditions/src/main/java/org/hps/conditions/svt/SvtConditions.java Modified: java/branches/hps_java_trunk_HPSJAVA-255/conditions/src/main/java/org/hps/conditions/svt/SvtConditions.java ============================================================================= --- java/branches/hps_java_trunk_HPSJAVA-255/conditions/src/main/java/org/hps/conditions/svt/SvtConditions.java (original) +++ java/branches/hps_java_trunk_HPSJAVA-255/conditions/src/main/java/org/hps/conditions/svt/SvtConditions.java Thu Oct 23 00:49:44 2014 @@ -1,11 +1,6 @@ package org.hps.conditions.svt; -import java.util.HashMap; -import java.util.Map; - -import org.hps.conditions.svt.SvtChannel.SvtChannelCollection; import org.hps.conditions.svt.SvtDaqMapping.SvtDaqMappingCollection; -import org.hps.conditions.svt.SvtT0Shift.SvtT0ShiftCollection; import static org.hps.conditions.svt.SvtChannel.MAX_NUMBER_OF_SAMPLES; @@ -17,52 +12,10 @@ * @author Jeremy McCormick <[log in to unmask]> * @author Omar Moreno <[log in to unmask]> */ -public final class SvtConditions { +public final class SvtConditions extends AbstractSvtConditions { /** SVT conditions data. */ - private Map<SvtChannel, ChannelConstants> channelData = new HashMap<SvtChannel, ChannelConstants>(); - private SvtChannelCollection channelMap = null; private SvtDaqMappingCollection daqMap = null; - private SvtT0ShiftCollection t0Shifts = null; - - /** - * Class constructor, which takes a channel map. - * - * @param channelMap The SVT channel map. - */ - SvtConditions(SvtChannelCollection channelMap) { - this.channelMap = channelMap; - } - - /** - * Get the conditions constants for a specific channel. These will be created if they - * do not exist for the given channel, BUT only channels in the current channel map - * are allowed as an argument. - * - * @param channel The SVT channel. - * @return The conditions constants for the channel. - * @throws IllegalArgumentException if . - */ - public ChannelConstants getChannelConstants(SvtChannel channel) { - // This channel must come from the map. - if (!channelMap.getObjects().contains(channel)) { - System.err.println("Channel not found in map => " + channel); - throw new IllegalArgumentException("Channel was not found in map."); - } - // If channel has no data yet, then add it. - if (!channelData.containsKey(channel)) - channelData.put(channel, new ChannelConstants()); - return channelData.get(channel); - } - - /** - * Get the {@link SvtChannelCollection} for this set of conditions. - * - * @return The SVT channel map. - */ - public SvtChannelCollection getChannelMap() { - return channelMap; - } /** * Get the {@link SvtDaqMappingCollection} associated with these conditions. @@ -74,30 +27,12 @@ } /** - * Get the {@link SvtT0ShiftCollection}. - * - * @return The t0 shifts by sensor. - */ - public SvtT0ShiftCollection getT0Shifts() { - return t0Shifts; - } - - /** * Set the {@link SvtDaqMappingCollection} associated with these conditions. * * @param daqMap The SVT DAQ map. */ void setDaqMap(SvtDaqMappingCollection daqMap) { this.daqMap = daqMap; - } - - /** - * Set the sensor t0 shifts. - * - * @param t0Shifts The sensor time shifts collection. - */ - void setTimeShifts(SvtT0ShiftCollection t0Shifts) { - this.t0Shifts = t0Shifts; } /**