001package myhw2.data; 002 003import myhw2.command.Command; 004 005/** 006 * Implementation of command to check in a video. 007 * @see Data 008 */ 009final class CmdIn implements Command { 010 private InventorySet inventory; 011 private Video video; 012 CmdIn(InventorySet inventory, Video video) { 013 this.inventory = inventory; 014 this.video = video; 015 } 016 public boolean run() { 017 try { 018 inventory.checkIn(video); 019 return true; 020 } catch (IllegalArgumentException e) { 021 return false; 022 } 023 } 024}