/*
 * Copyright (C) 2004-2006  exedio GmbH (www.exedio.com)
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

package com.exedio.cope.instrument;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * Represents a behavioral feature of a class parsed by the java parser.
 * May be either a method or a constructor.
 * @see Injector
 * 
 * @author Ralf Wiebicke
 */
abstract class JavaBehaviour extends JavaFeature
{
	
	/**
	 * Contains subsequently parameter types and names.
	 */
	protected final ArrayList parameters=new ArrayList();
	
	protected final List unmodifiableParameters=Collections.unmodifiableList(parameters);
	
	/**
	 * Contains all names given in the &quot;throws&quot; clause.
	 */
	private final ArrayList throwables=new ArrayList();
	
	JavaBehaviour(
						final JavaClass parent,
						final int modifiers,
						final String type,
						final String name)
	throws InjectorParseException
	{
		// parent must not be null
		super(parent.file, parent, modifiers, type, name);
	}
	
	void addParameter(String paramtype, String paramname)
	{
		parameters.add(paramtype);
		parameters.add(paramname);
	}
	
	final List getParameters()
	{
		return unmodifiableParameters;
	}
	
	final void addThrowable(String throwable)
	{
		throwables.add(throwable);
	}
	
}

/*
 * Copyright (C) 2004-2006  exedio GmbH (www.exedio.com)
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

package com.exedio.cope.instrument;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * Represents a behavioral feature of a class parsed by the java parser.
 * May be either a method or a constructor.
 * @see Injector
 * 
 * @author Ralf Wiebicke
 */
abstract class JavaBehaviour extends JavaFeature
{
	
	/**
	 * Contains subsequently parameter types and names.
	 */
	protected final ArrayList<String> parameters=new ArrayList<String>();
	
	protected final List<String> unmodifiableParameters=Collections.unmodifiableList(parameters);
	
	/**
	 * Contains all names given in the &quot;throws&quot; clause.
	 */
	private final ArrayList<String> throwables = new ArrayList<String>();
	
	JavaBehaviour(
						final JavaClass parent,
						final int modifiers,
						final String type,
						final String name)
	throws InjectorParseException
	{
		// parent must not be null
		super(parent.file, parent, modifiers, type, name);
	}
	
	void addParameter(String paramtype, String paramname)
	{
		parameters.add(paramtype);
		parameters.add(paramname);
	}
	
	final List<String> getParameters()
	{
		return unmodifiableParameters;
	}
	
	final void addThrowable(String throwable)
	{
		throwables.add(throwable);
	}
	
}

fix warnings