openllet.aterm.ATerm Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of openllet-functions Show documentation
Show all versions of openllet-functions Show documentation
Openllet management of abstracts functions
/*
* Copyright (c) 2002-2007, CWI and INRIA
*
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the University of California, Berkeley nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package openllet.aterm;
import java.io.IOException;
import java.io.OutputStream;
import java.util.List;
import openllet.shared.hash.HashFunctions;
/**
* This is the base interface for all ATerm interfaces,
* which will ultimately be implemented by two separate
* ATerm Factories (a native and a pure one).
*
* @author Hayco de Jong ([email protected])
* @author Pieter Olivier ([email protected])
*/
public interface ATerm extends Visitable, Identifiable
{
public static final int GOLDEN_RATIO = HashFunctions.GOLDEN_RATIO;
/**
* A term of type INT
*/
public static final int INT = 2;
/**
* A term of type REAL
*/
public static final int REAL = 3;
/**
* A term of type APPL (function application)
*/
public static final int APPL = 1;
/**
* A term of type LIST
*/
public static final int LIST = 4;
/**
* A term of type PLACEHOLDER
*/
public static final int PLACEHOLDER = 5;
/**
* A term of type BLOB (Binary Large OBject)
*/
public static final int BLOB = 6;
/**
* A term of type AFUN (function symbol)
*/
public static final int AFUN = 7;
/**
* A term of type LONG
*/
public static final int LONG = 8;
/**
* Gets the type of this term.
*
*
* @return the type of this ATerm.
*
* @see #INT
* @see #REAL
* @see #APPL
* @see #LIST
* @see #PLACEHOLDER
* @see #BLOB
* @see #AFUN
* @see #LONG
*/
public int getType();
/**
* Gets a hashcode value of this term.
*
* @return the hashcode of this term.
*
*/
@Override
public int hashCode();
/**
* Matches this term against a String pattern. The pattern is
* parsed into a term, which this term is then matched against.
*
* @param pattern the string pattern to match this term against.
*
* @return a list containing the subterms matching the placeholders
* if the match succeeds, or null if the match fails.
*
* @throws ParseError if pattern cannot be parsed into a term.
*
* @see #match(ATerm)
*/
public List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy