@Test public void testPutOnFrame() { BoundingBoxMap map = new BoundingBoxMap(); BoundingBox boundingBox = new BoundingBox(25, 30, 100, 100, 0, false, 0xFF, 0, 0); BoundingBox boundingBoxCopy = new BoundingBox(25, 30, 100, 100, 0, false, 0xFF, 0, 0); map.putOnFrame(1, boundingBox); Assert.assertNotEquals("The value for map.get(1) must not be null.", map.get(1), null); Assert.assertEquals("The value for map.get(1) must contain 1 element.", map.get(1).size(), 1); Assert.assertEquals("The value for map.get(1).get(0) did not match the expected value.", map.get(1).get(0), boundingBoxCopy); }
public void putOnFrame(Integer frame, BoundingBox boundingBox) { if (frame == null) { throw new IllegalArgumentException("frame must not be null"); } if (frame < 0) { throw new IllegalArgumentException("frame must not be less than 0"); } if (boundingBox == null) { throw new IllegalArgumentException("boundingBox must not be null"); } if (!containsKey(frame)) { put(frame, new ArrayList<BoundingBox>()); } get(frame).add(boundingBox); }
BoundingBoxMap extends TreeMap<Integer, List<BoundingBox>> { public void putOnFrame(Integer frame, BoundingBox boundingBox) { if (frame == null) { throw new IllegalArgumentException("frame must not be null"); } if (frame < 0) { throw new IllegalArgumentException("frame must not be less than 0"); } if (boundingBox == null) { throw new IllegalArgumentException("boundingBox must not be null"); } if (!containsKey(frame)) { put(frame, new ArrayList<BoundingBox>()); } get(frame).add(boundingBox); } }
BoundingBoxMap extends TreeMap<Integer, List<BoundingBox>> { public void putOnFrame(Integer frame, BoundingBox boundingBox) { if (frame == null) { throw new IllegalArgumentException("frame must not be null"); } if (frame < 0) { throw new IllegalArgumentException("frame must not be less than 0"); } if (boundingBox == null) { throw new IllegalArgumentException("boundingBox must not be null"); } if (!containsKey(frame)) { put(frame, new ArrayList<BoundingBox>()); } get(frame).add(boundingBox); }  }
BoundingBoxMap extends TreeMap<Integer, List<BoundingBox>> { public void putOnFrame(Integer frame, BoundingBox boundingBox) { if (frame == null) { throw new IllegalArgumentException("frame must not be null"); } if (frame < 0) { throw new IllegalArgumentException("frame must not be less than 0"); } if (boundingBox == null) { throw new IllegalArgumentException("boundingBox must not be null"); } if (!containsKey(frame)) { put(frame, new ArrayList<BoundingBox>()); } get(frame).add(boundingBox); }  @Override List<BoundingBox> put(Integer key, List<BoundingBox> value); @Override void putAll(Map<? extends Integer, ? extends List<BoundingBox>> m); void putOnFrame(Integer frame, BoundingBox boundingBox); void putOnFrames(Integer firstFrame, Integer lastFrame, BoundingBox boundingBox); void animate(BoundingBox origin, BoundingBox destination, int firstFrame, int interval); @Override String toString(); List<Markup.BoundingBoxMapEntry> toBoundingBoxMapEntryList(); int getEntryCount(); }
BoundingBoxMap extends TreeMap<Integer, List<BoundingBox>> { public void putOnFrame(Integer frame, BoundingBox boundingBox) { if (frame == null) { throw new IllegalArgumentException("frame must not be null"); } if (frame < 0) { throw new IllegalArgumentException("frame must not be less than 0"); } if (boundingBox == null) { throw new IllegalArgumentException("boundingBox must not be null"); } if (!containsKey(frame)) { put(frame, new ArrayList<BoundingBox>()); } get(frame).add(boundingBox); }  @Override List<BoundingBox> put(Integer key, List<BoundingBox> value); @Override void putAll(Map<? extends Integer, ? extends List<BoundingBox>> m); void putOnFrame(Integer frame, BoundingBox boundingBox); void putOnFrames(Integer firstFrame, Integer lastFrame, BoundingBox boundingBox); void animate(BoundingBox origin, BoundingBox destination, int firstFrame, int interval); @Override String toString(); List<Markup.BoundingBoxMapEntry> toBoundingBoxMapEntryList(); int getEntryCount(); static final int ALL_FRAMES; }