001/* 002 * This file is part of OCaml-Java runtime. 003 * Copyright (C) 2007-2013 Xavier Clerc. 004 * 005 * OCaml-Java runtime is free software; you can redistribute it and/or modify 006 * it under the terms of the GNU Lesser General Public License as published by 007 * the Free Software Foundation; either version 3 of the License, or 008 * (at your option) any later version. 009 * 010 * OCaml-Java runtime is distributed in the hope that it will be useful, 011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 013 * GNU Lesser General Public License for more details. 014 * 015 * You should have received a copy of the GNU Lesser General Public License 016 * along with this program. If not, see <http://www.gnu.org/licenses/>. 017 */ 018 019package org.ocamljava.runtime.wrappers; 020 021import org.ocamljava.runtime.values.Value; 022 023/** 024 * The {@code AsbtractWrapper} class provides a partial implementation 025 * for the {@code Wrapper} interface, by making the {@code getWrapper(int)} 026 * method return a dummy value. 027 * 028 * @author <a href="mailto:xclerc@ocamljava.org">Xavier Clerc</a> 029 * @version 2.0 030 * @since 2.0 031 */ 032public abstract class SimpleWrapper<T extends OCamlValue> implements Wrapper<T>{ 033 034 /** 035 * Constructs a new instance. 036 */ 037 public SimpleWrapper() { 038 } // end empty constructor 039 040 /** 041 * {@inheritDoc} 042 */ 043 @Override 044 public final Wrapper<? extends OCamlValue> getWrapper(final int idx) { 045 return OCamlUnit.WRAPPER; 046 } // end method 'getWrapper(int)' 047 048} // end class 'SimpleWrapper'