public class Dict extends Term
Dict dict1 = new Dict(new Atom("location"), map); Dict t3 = (Dict) Term.textToTerm("location{t:12, z:312, y:23}");
Copyright (C) 2004 Paul Singleton
Copyright (C) 1998 Fred Dushin
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER OR 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.
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<Atom,Term> |
map
The mapping of the dictionary
|
protected Term |
tag
The tag of the dictionary - an Atom or a Variable
|
Constructor and Description |
---|
Dict(java.lang.String dict) |
Dict(Term tag,
java.util.Map<Atom,Term> map)
Creates a dictionary structure
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
java.util.Map<Atom,Term> |
getMap() |
Term |
getTag() |
boolean |
hasFunctor(Term val,
int arity)
whether this Dictionary's functor has 'name' and 'arity' (c.f.
|
int |
hashCode() |
protected void |
put(java.util.Map<java.lang.String,term_t> varnames_to_vars,
term_t term)
To convert an Rational into a Prolog term, we put its value into the term_t.
|
java.lang.String |
toString()
a Prolog source text representation of this dictionary's value
|
int |
type()
the type of this term, as "Prolog.DICT"
|
java.lang.String |
typeName()
the name of the type of this term, as "Rational"
|
arg, args, arity, atomListToStringArray, atomType, bigValue, doubleValue, floatValue, getSubst, getSubsts, getTerm, getTerm, hasFunctor, hasFunctor, hasFunctor, hasFunctor, intArrayArrayToList, intArrayToList, intValue, isAtom, isAtomOfNameType, isBig, isBigInteger, isCompound, isFloat, isInteger, isJFalse, isJNull, isJRef, isJTrue, isJVoid, isList, isList, isListNil, isListPair, isVariable, jrefToObject, listLength, listLength, listToTermArray, listToTermArray, longValue, name, object, objectToJRef, put, putParams, putParams, putParams1, putParams2, putTerm, putTerms, ref, setName, stringArrayToList, termArrayToList, textParamsToTerm, textToTerm, toString, toTermArray
protected final Term tag
public Dict(Term tag, java.util.Map<Atom,Term> map)
tag
- the tag of the dict as an Atom or Variablemap
- a mapping from Atoms to termspublic Dict(java.lang.String dict)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public final Term getTag()
public final boolean hasFunctor(Term val, int arity)
protected final void put(java.util.Map<java.lang.String,term_t> varnames_to_vars, term_t term)
public java.lang.String toString()
toString
in class java.lang.Object
public final int type()