1 /* 2 * #%L 3 * prolobjectlink-jpi 4 * %% 5 * Copyright (C) 2019 Prolobjectlink Project 6 * %% 7 * Permission is hereby granted, free of charge, to any person obtaining a copy 8 * of this software and associated documentation files (the "Software"), to deal 9 * in the Software without restriction, including without limitation the rights 10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 * copies of the Software, and to permit persons to whom the Software is 12 * furnished to do so, subject to the following conditions: 13 * 14 * The above copyright notice and this permission notice shall be included in 15 * all copies or substantial portions of the Software. 16 * 17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 * THE SOFTWARE. 24 * #L% 25 */ 26 package io.github.prolobjectlink.prolog; 27 28 /** 29 * <p> 30 * Represent the Prolog atom data type. Prolog atoms are can be of two kinds 31 * simple or complex. Simple atoms are defined like a single alpha numeric word 32 * that begin like initial lower case character. The complex atom are define 33 * like any character sequence that begin and end with simple quotes. 34 * </p> 35 * <p> 36 * The string passed to build a simple atoms should be match with 37 * [a-z][A-Za-z0-9_]* regular expression. If the string passed to build an atom 38 * don't match with the before mentioned regular expression the atom constructor 39 * can be capable of create a complex atom automatically. 40 * </p> 41 * <p> 42 * For complex atom the string value can have the quotes or just can be absent. 43 * The printed string representation of the complex atom implementation set the 44 * quotes if they are needed. 45 * </p> 46 * <p> 47 * The Prolog Provider is the mechanism to create a new Prolog atoms 48 * invoking {@link PrologProvider#newAtom(String)}. 49 * </p> 50 * <p> 51 * Two atoms are equals if and only if are atoms and have equals functor 52 * (value). Atoms terms unify only with same atoms or with free variable. 53 * </p> 54 * 55 * @author Jose Zalacain 56 * @since 1.0 57 */ 58 public interface PrologAtom extends PrologTerm { 59 60 /** 61 * String value for atom term. 62 * 63 * @return value for atom term. 64 * @since 1.0 65 */ 66 public String getStringValue(); 67 68 /** 69 * Set the string value for this atom instance. The string value should be match 70 * with [a-z][A-Za-z0-9_]* regular expression. If the string passed to build an 71 * atom don't match with the before mentioned regular expression the atom 72 * constructor can be capable of create a complex atom automatically. 73 * 74 * @param value string value for this atom 75 * @since 1.0 76 */ 77 public void setStringValue(String value); 78 79 }