public class Facts extends java.lang.Object implements java.lang.Iterable<Fact<?>>
Facts
object.Constructor and Description |
---|
Facts() |
Modifier and Type | Method and Description |
---|---|
<T> void |
add(Fact<T> fact)
Add a fact, replacing any fact with the same name.
|
java.util.Map<java.lang.String,java.lang.Object> |
asMap()
Return a copy of the facts as a map.
|
void |
clear()
Clear facts.
|
<T> T |
get(java.lang.String factName)
Get the value of a fact by its name.
|
Fact<?> |
getFact(java.lang.String factName)
Get a fact by name.
|
java.util.Iterator<Fact<?>> |
iterator()
Return an iterator on the set of facts.
|
<T> void |
put(java.lang.String name,
T value)
Add a fact, replacing any fact with the same name.
|
<T> void |
remove(Fact<T> fact)
Remove a fact.
|
void |
remove(java.lang.String factName)
Remove a fact by name.
|
java.lang.String |
toString() |
public <T> void put(java.lang.String name, T value)
name
- of the fact to add, must not be nullvalue
- of the fact to add, must not be nullpublic <T> void add(Fact<T> fact)
fact
- to add, must not be nullpublic void remove(java.lang.String factName)
factName
- name of the fact to remove, must not be nullpublic <T> void remove(Fact<T> fact)
fact
- to remove, must not be nullpublic <T> T get(java.lang.String factName)
getFact(factName).getValue()
.T
- type of the fact's valuefactName
- name of the fact, must not be nullpublic Fact<?> getFact(java.lang.String factName)
factName
- name of the fact, must not be nullpublic java.util.Map<java.lang.String,java.lang.Object> asMap()
HashMap
public java.util.Iterator<Fact<?>> iterator()
iterator
in interface java.lang.Iterable<Fact<?>>
public void clear()
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2020. All Rights Reserved.