001 /***************************************************************************** 002 * Copyright (C) PicoContainer 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.picocontainer.script.testmodel; 012 013 import java.util.ArrayList; 014 import java.util.Collection; 015 016 public final class MockComponentImpl implements MockComponent { 017 private int port = 0; 018 private String server = null; 019 private final Collection<Integer> registers = new ArrayList<Integer>(); 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(i); 047 } 048 }