24 package org.lightjason.agentspeak.beliefbase;
32 import javax.annotation.Nonnull;
33 import javax.annotation.Nullable;
34 import java.util.Collection;
35 import java.util.stream.Stream;
55 m_storage = p_storage;
61 return m_storage.hashCode();
65 public final boolean equals(
final Object p_object )
75 ? super.add( p_literal )
100 ? super.remove( p_literal )
132 public final Collection<ILiteral>
literal( @Nonnull
final String p_key )
141 super.update( p_agent );
143 return m_storage.
update( p_agent );
165 return m_storage.
empty();
178 return Stream.concat(
179 super.trigger( p_view ).parallel(),
201 return m_storage.toString();
Stream< N > streamMultiElements()
returns a stream over all multi-elements
boolean containsSingleElement( @Nonnull final String p_key)
contains a single-element
interface of a physical beliefbase storage
Stream< M > streamSingleElements()
returns a stream over all single-elements
final IView internalremove(final IView p_view)
removes the interal view references
boolean putMultiElement( @Nonnull final String p_key, final N p_value)
puts a multi-element into the storage
final IView viewOrDefault( @Nonnull final String p_key, @Nullable final IView p_default)
returns a view element
boolean removeMultiElement( @Nonnull final String p_key, final N p_value)
removes a multi-element from the storage
Stream< ITrigger > trigger()
retruns all trigger of the beliefbase
final IView add( @Nonnull final IView p_view)
adds a view
ILiteral event(final ITrigger.EType p_event, final ILiteral p_literal)
push an event and literal to the event map
CBeliefbase( @Nonnull final IStorage< ILiteral, IView > p_storage)
ctor
Collection< N > getMultiElement( @Nonnull final String p_key)
returns a collection of multi-elementy by name
final int size()
returns the size of literals
boolean empty()
checks if a storage is empty
final Stream< ITrigger > trigger( @Nonnull final IView p_view)
returns all trigger of the beliefbase
final IView view( @Nonnull final String p_key)
returns a view element
boolean containsMultiElement( @Nonnull final String p_key)
contains a multi-element
view for a beliefbase that creates any access to the underlying data structures
final boolean containsLiteral( @Nonnull final String p_key)
contains a multi-element
final boolean empty()
checks if the structure empty
interface of beliefbase definition, that create the trigger events for the agent
final ILiteral add( @Nonnull final ILiteral p_literal)
adds a literal
default behaviour of a beliefbase
final IStorage< ILiteral, IView > m_storage
storage with data
M getSingleElementOrDefault( @Nonnull final String p_key, final M p_default)
returns a single-element by the name
final boolean equals(final Object p_object)
final Collection< ILiteral > literal( @Nonnull final String p_key)
returns a literal by the name
final Stream< ILiteral > streamLiteral()
returns a stream over all literals
IAgent<?> update( @Nonnull final IAgent<?> p_agent)
updates all items
int size()
returns the size of literals
void clear()
clears all elements
final boolean containsView( @Nonnull final String p_key)
contains a single-element
final IAgent<?> update( @Nonnull final IAgent<?> p_agent)
updates all items
int size()
number of multi elements
M getSingleElement( @Nonnull final String p_key)
returns a single-element by the name
final Stream< IView > streamView()
returns a stream over all views
boolean putSingleElement( @Nonnull final String p_key, final M p_value)
puts a single-element into the storage
final IBeliefbase clear()
clears all elements
boolean removeSingleElement( @Nonnull final String p_key)
removes a single-element from the storage
beliefbase to generate any event-based data by reference counting