@Test public void get() { RegisterSet registerSet = new RegisterSet(); Register r1 = new Register("R1"); registerSet.put(1, r1); r1.setValue(10); assertEquals(10, registerSet.get(1)); assertEquals(0, registerSet.get(2)); }
@Override public int get(int address) { Register register = registers.get(address); if (register != null) { return register.getValue(); } else { return 0; } }
RegisterSet implements Target, MongoSerializable { @Override public int get(int address) { Register register = registers.get(address); if (register != null) { return register.getValue(); } else { return 0; } } }
RegisterSet implements Target, MongoSerializable { @Override public int get(int address) { Register register = registers.get(address); if (register != null) { return register.getValue(); } else { return 0; } } RegisterSet(); }
RegisterSet implements Target, MongoSerializable { @Override public int get(int address) { Register register = registers.get(address); if (register != null) { return register.getValue(); } else { return 0; } } RegisterSet(); Register getRegister(int index); Register getRegister(String name); @Override int get(int address); @Override void set(int address, int value); void put(int index, Register register); void clear(); @Override Document mongoSerialise(); static RegisterSet deserialize(Document obj); static RegisterSet deserialize(JSONObject json); @Override String toString(); }
RegisterSet implements Target, MongoSerializable { @Override public int get(int address) { Register register = registers.get(address); if (register != null) { return register.getValue(); } else { return 0; } } RegisterSet(); Register getRegister(int index); Register getRegister(String name); @Override int get(int address); @Override void set(int address, int value); void put(int index, Register register); void clear(); @Override Document mongoSerialise(); static RegisterSet deserialize(Document obj); static RegisterSet deserialize(JSONObject json); @Override String toString();  }