| |
---|
| | |
---|
| | private final List<IBookListener> iBookListeners = new ArrayList<>(); |
---|
| | |
---|
| | //IBookListenerを追加 |
---|
| | private void addListener(IBookListener iBookListener) |
---|
| | public void addListener(IBookListener iBookListener) |
---|
| | { |
---|
| | iBookListeners.add(iBookListener); |
---|
| | } |
---|
| | |
---|
| | //IBookListenerに通知する |
---|
| | private void notifyListener(Account account, Book book) |
---|
| | { |
---|
| | for(IBookListener iBookListener : iBookListeners) |
---|
| | { |
---|
| | iBookListener.bookChanged(account, book); |
---|
| | } |
---|
| | } |
---|
| | |
---|
| | |
---|
| | @Autowired |
---|
| | public BookManager(AccountManager accountManager) { |
---|
| | this.accountManager = accountManager; |
---|
| |
---|
| | return 1; |
---|
| | } |
---|
| | |
---|
| | } |
---|
| | |
---|
| | //IBookListenerに通知する |
---|
| | private void notifyListener(Account account, Book book) |
---|
| | { |
---|
| | for(IBookListener iBookListener : iBookListeners) |
---|
| | { |
---|
| | iBookListener.bookChanged(account, book); |
---|
| | } |
---|
| | } |
---|
| | } |
---|
| | |
---|
| | |