public Integer getOrder(int crate, int slot, int channel) { Integer key = TranslationTableEntry.getHashCreate(crate, slot, channel); if (this.tableEntries.containsKey(key) == true) { return this.tableEntries.get(key).descriptor().getOrder(); } return -1; }
public void addEntry(String entryLine) { TranslationTableEntry entry = new TranslationTableEntry("empty"); entry.parse(entryLine); if (entry.descriptor().getType() == DetectorType.UNDEFINED) { System.err.println("----> error : detector type unknown"); return; } if (this.tableEntries.size() == 0) { this.type = entry.descriptor().getType(); } else { if (entry.descriptor().getType() != this.type) { System.err.println( "----> error : entry # " + this.tableEntries.size() + " has wrong detector type"); return; } } if (this.tableEntries.containsKey(entry.getHashCreate()) == true) { System.err.println( "[Translation Map] (ERROR) ==> " + " Duplicate entry detected. Not added.\n" + "\t" + entryLine); } else { this.tableEntries.put(entry.getHashCreate(), entry); } }
public void addEntry(int crate, int slot, int channel, int sector, int layer, int component) { TranslationTableEntry entry = new TranslationTableEntry(this.tableName); entry.setCreate(crate, slot, channel); entry.setDetector(sector, layer, component); if (this.tableEntries.containsKey(entry.getHashCreate()) == true) { System.out.println("ERROR : dublicate entry is not being added : " + entry.toString()); } else { this.tableEntries.put(entry.getHashCreate(), entry); } }
public TranslationTableEntry getEntry(int crate, int slot, int channel) { Integer key = TranslationTableEntry.getHashCreate(crate, slot, channel); return this.tableEntries.get(key); }
public Boolean hasEntry(int crate, int slot, int channel) { Integer key = TranslationTableEntry.getHashCreate(crate, slot, channel); return this.tableEntries.containsKey(key); }
public Integer getHashCreate() { return TranslationTableEntry.getHashCreate( this.desc.getCrate(), this.desc.getSlot(), this.desc.getChannel()); }