Rambler's Top100
/*
 *  Copyright (C) 2004 Roman Krylov
 *  rkrylov@mail.ru
 *  
 *
 *  This program 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
 *  of the License, or (at your option) any later version.
 *
 *  This program 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 program; if not, write to the Free Software
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

package org.JWrapper;

public abstract class JAccessAdapter
{
    protected Class value_class;
    protected boolean RW = true;
    protected Signal1 access_changed = new Signal1();
    
    public JAccessAdapter() {}
    public JAccessAdapter(Class _value_class) { value_class = _value_class; }
    
    public final Class getTargetClass() {return value_class;}
    
    public boolean isRW() { return RW; }
    public void setRW(boolean rw) { RW=rw; }
    public Signal1 getSignalAccessChanged() { return access_changed; }
    
    
    public abstract T get() throws Exception;
    
    public final void set(T obj) throws Exception
        {
        if(RW)
            {_set(obj);}
        else
            { throw new Exception("Access denied"); }
        }
    
    protected abstract void _set(T obj) throws Exception;
    
}

Предприятие реального времени №1

На главную   Новости   Карта сайта
  Rambler's Top100