001 /*****************************************************************************
002 * Copyright (C) NanoContainer Organization. All rights reserved. *
003 * ------------------------------------------------------------------------- *
004 * The software in this package is published under the terms of the BSD *
005 * style license a copy of which has been included with this distribution in *
006 * the LICENSE.txt file. *
007 * *
008 * Original code by Mike Hogan *
009 *****************************************************************************/
010
011 package org.nanocontainer.testmodel;
012
013 import java.util.ArrayList;
014 import java.util.Collection;
015
016 public class MockComponentImpl implements MockComponent {
017 private int port = 0;
018 private String server = null;
019 private Collection registers = new ArrayList();
020
021 public int getPort() {
022 return port;
023 }
024
025 public void setPort(int port) {
026 this.port = port;
027 }
028
029 public String getServer() {
030 return server;
031 }
032
033 public void setServer(String server) {
034 this.server = server;
035 }
036
037 public void addRegister(Integer i) {
038 registers.add(i);
039 }
040
041 public int getNumRegisters() {
042 return registers.size();
043 }
044
045 public boolean hasRegister(int i) {
046 return registers.contains(new Integer(i));
047 }
048 }