Package net.sf.kpex.builtins

Source Code of net.sf.kpex.builtins.DbGetDefault

/*
* KernelProlog Expanded - Pure Java based Prolog Engine
* Copyright (C) 1999  Paul Tarau (original KernelProlog)
* Copyright (C) 2009  Michiel Hendriks
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/
package net.sf.kpex.builtins;

import net.sf.kpex.prolog.FunBuiltin;
import net.sf.kpex.prolog.JavaObject;
import net.sf.kpex.prolog.Prog;

/**
* gets default database
*/
public class DbGetDefault extends FunBuiltin
{
  public DbGetDefault()
  {
    super("get_default_db", 1);
  }

  /*
   * (non-Javadoc)
   * @see net.sf.kpex.prolog.FunBuiltin#exec(net.sf.kpex.prolog.Prog)
   */
  @Override
  public int exec(Prog p)
  {
    return putArg(0, new JavaObject(p.getDatabase()), p);
  }
}
TOP

Related Classes of net.sf.kpex.builtins.DbGetDefault

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.