public final class SideProofStore
extends java.lang.Object
The only instance of this class DEFAULT_INSTANCE
is used
to manage performed side proofs.
Side proofs are added via #disposeOrStore(String, ApplyStrategyInfo)
when they are no longer needed. If the SideProofStore
is enabled (isEnabled()
)
the side Proof
is not disposed; instead it is added via addProof(String, Proof)
and available for a later access until it is removed via removeEntries(Collection)
.
Modifier and Type | Class and Description |
---|---|
static class |
SideProofStore.Entry
An
SideProofStore.Entry of a SideProofStore . |
Modifier and Type | Field and Description |
---|---|
static SideProofStore |
DEFAULT_INSTANCE
The default and only instance of this class.
|
private boolean |
enabled
The enabled state.
|
private java.util.List<SideProofStore.Entry> |
entries
All contained
SideProofStore.Entry s. |
private java.util.List<ISideProofStoreListener> |
listener
All available
ISideProofStoreListener . |
private java.beans.PropertyChangeSupport |
pcs
The
PropertyChangeSupport . |
static java.lang.String |
PROP_ENABLED
Property
isEnabled() . |
Modifier | Constructor and Description |
---|---|
private |
SideProofStore()
Forbid other instances.
|
Modifier and Type | Method and Description |
---|---|
void |
addProof(java.lang.String description,
Proof proof)
Adds a new
Proof . |
void |
addProofStoreListener(ISideProofStoreListener l)
Registers the
ISideProofStoreListener . |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds the given listener.
|
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Adds the given listener for the given property only.
|
void |
clearProofs()
Removes all
SideProofStore.Entry s. |
boolean |
containsEntry(Proof proof)
Checks if an
SideProofStore.Entry for the given Proof exist. |
boolean |
containsEntry(SideProofStore.Entry entry)
Checks if the given
SideProofStore.Entry is contained. |
int |
countEntries()
Returns the number of contained
SideProofStore.Entry s. |
protected void |
fireEntriesAdded(SideProofStoreEvent e)
Fires the event
ISideProofStoreListener.entriesAdded(SideProofStoreEvent) . |
protected void |
fireEntriesRemoved(SideProofStoreEvent e)
Fires the event
ISideProofStoreListener.entriesRemoved(SideProofStoreEvent) . |
SideProofStore.Entry[] |
getEntries()
Returns all available
SideProofStore.Entry s. |
SideProofStore.Entry |
getEntry(Proof proof)
Returns the
SideProofStore.Entry for the given Proof . |
SideProofStore.Entry |
getEntryAt(int index)
Returns the
SideProofStore.Entry at the given index. |
ISideProofStoreListener[] |
getProofStoreListener()
Returns all registered
ISideProofStoreListener . |
boolean |
isEnabled()
Checks if the
SideProofStore is enabled or not. |
void |
removeEntries(java.util.Collection<SideProofStore.Entry> entries)
Removes the given
SideProofStore.Entry s. |
void |
removeProofStoreListener(ISideProofStoreListener l)
Unregisters the
ISideProofStoreListener . |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes the given listener.
|
void |
removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Removes the given listener from the given property.
|
void |
setEnabled(boolean enabled)
Defines the enabled state.
|
public static final java.lang.String PROP_ENABLED
isEnabled()
.public static final SideProofStore DEFAULT_INSTANCE
private final java.util.List<SideProofStore.Entry> entries
SideProofStore.Entry
s.private final java.util.List<ISideProofStoreListener> listener
ISideProofStoreListener
.private boolean enabled
private java.beans.PropertyChangeSupport pcs
PropertyChangeSupport
.public boolean isEnabled()
SideProofStore
is enabled or not.true
enabled, false
disabled.public void setEnabled(boolean enabled)
enabled
- true
enabled, false
disabled.public void addProof(java.lang.String description, Proof proof)
Proof
.description
- The description.proof
- The Proof
to add.public void removeEntries(java.util.Collection<SideProofStore.Entry> entries)
SideProofStore.Entry
s.entries
- The SideProofStore.Entry
s to remove.public void clearProofs()
SideProofStore.Entry
s.public boolean containsEntry(Proof proof)
SideProofStore.Entry
for the given Proof
exist.proof
- The Proof
to check.true
SideProofStore.Entry
for Proof
exist, false
otherwise.public SideProofStore.Entry getEntry(Proof proof)
SideProofStore.Entry
for the given Proof
.proof
- The Proof
for which the SideProofStore.Entry
is requested.SideProofStore.Entry
with the given Proof
or null
if not available.public boolean containsEntry(SideProofStore.Entry entry)
SideProofStore.Entry
is contained.entry
- The SideProofStore.Entry
to check.true
SideProofStore.Entry
is contained, false
SideProofStore.Entry
is not contained.public int countEntries()
SideProofStore.Entry
s.SideProofStore.Entry
s.public SideProofStore.Entry getEntryAt(int index)
SideProofStore.Entry
at the given index.index
- The index.SideProofStore.Entry
at the given index.public SideProofStore.Entry[] getEntries()
SideProofStore.Entry
s.SideProofStore.Entry
s.public void addProofStoreListener(ISideProofStoreListener l)
ISideProofStoreListener
.l
- The ISideProofStoreListener
to register.public void removeProofStoreListener(ISideProofStoreListener l)
ISideProofStoreListener
.l
- The ISideProofStoreListener
to unregister.public ISideProofStoreListener[] getProofStoreListener()
ISideProofStoreListener
.ISideProofStoreListener
.protected void fireEntriesAdded(SideProofStoreEvent e)
ISideProofStoreListener.entriesAdded(SideProofStoreEvent)
.e
- The event.protected void fireEntriesRemoved(SideProofStoreEvent e)
ISideProofStoreListener.entriesRemoved(SideProofStoreEvent)
.e
- The event.public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The listener to add.public void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
propertyName
- The property to observe.listener
- The listener to add.public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The listener to remove.public void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
propertyName
- The property to no longer observe.listener
- The listener to remove.