MCPcopy Create free account
hub / github.com/SWI-Prolog/packages-jpl / toString

Method toString

src/main/java/org/jpl7/Dict.java:154–165  ·  view source on GitHub ↗

a Prolog source text representation of this dictionary's value @return a Prolog source text representation of this dictionary's value

()

Source from the content-addressed store, hash-verified

152 * @return a Prolog source text representation of this dictionary's value
153 */
154 @Override
155 public String toString() {
156 String mapping = "";
157
158 for (Iterator<Atom> iterator = map.keySet().iterator(); iterator.hasNext();) {
159 Atom key= iterator.next();
160 Term value = map.get(key);
161 mapping = mapping + String.format("%s:%s", key.toString(), value.toString()) ;
162 if (iterator.hasNext()) mapping = mapping + ", ";
163 }
164 return String.format("%s{%s}", tag, mapping);
165 }
166
167 //TODO: exchange for this when upgrading to Java 1.8
168// public String toString() {

Callers 2

test_dict1Method · 0.95
test_dict4Method · 0.95

Calls 5

toStringMethod · 0.95
toStringMethod · 0.95
iteratorMethod · 0.80
hasNextMethod · 0.80
nextMethod · 0.80

Tested by 2

test_dict1Method · 0.76
test_dict4Method · 0.76