LightJason - AgentSpeak(L++)
IBeliefbaseOnDemand.java
Go to the documentation of this file.
1 /*
2  * @cond LICENSE
3  * ######################################################################################
4  * # LGPL License #
5  * # #
6  * # This file is part of the LightJason AgentSpeak(L++) #
7  * # Copyright (c) 2015-19, LightJason (info@lightjason.org) #
8  * # This program is free software: you can redistribute it and/or modify #
9  * # it under the terms of the GNU Lesser General Public License as #
10  * # published by the Free Software Foundation, either version 3 of the #
11  * # License, or (at your option) any later version. #
12  * # #
13  * # This program is distributed in the hope that it will be useful, #
14  * # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15  * # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16  * # GNU Lesser General Public License for more details. #
17  * # #
18  * # You should have received a copy of the GNU Lesser General Public License #
19  * # along with this program. If not, see http://www.gnu.org/licenses/ #
20  * ######################################################################################
21  * @endcond
22  */
23 
24 package org.lightjason.agentspeak.beliefbase;
25 
31 
32 import javax.annotation.Nonnull;
33 import java.util.Collection;
34 import java.util.Collections;
35 import java.util.stream.Stream;
36 
37 
42 public abstract class IBeliefbaseOnDemand<T extends IAgent<?>> extends IBaseBeliefbase
43 {
44 
45  @Override
46  public boolean empty()
47  {
48  return true;
49  }
50 
51  @Override
52  public int size()
53  {
54  return 0;
55  }
56 
57  @Nonnull
58  @Override
59  public Stream<ILiteral> streamLiteral()
60  {
61  return Stream.empty();
62  }
63 
64  @Nonnull
65  @Override
66  public ILiteral add( @Nonnull final ILiteral p_literal )
67  {
68  return super.add( p_literal );
69  }
70 
71  @Nonnull
72  @Override
73  public ILiteral remove( @Nonnull final ILiteral p_literal )
74  {
75  return super.remove( p_literal );
76  }
77 
78  @Override
79  public boolean containsLiteral( @Nonnull final String p_key )
80  {
81  return false;
82  }
83 
84  @Nonnull
85  @Override
86  public Collection<ILiteral> literal( @Nonnull final String p_key )
87  {
88  return Collections.<ILiteral>emptySet();
89  }
90 
91  @Nonnull
92  @Override
93  public final IView view( @Nonnull final String p_key )
94  {
95  throw new CIllegalStateException( CCommon.languagestring( IBeliefbaseOnDemand.class, "nostorage", this, p_key ) );
96  }
97 
98  @Override
99  public final IView viewOrDefault( @Nonnull final String p_key, final IView p_default )
100  {
101  throw new CIllegalStateException( CCommon.languagestring( IBeliefbaseOnDemand.class, "nostorage", this, p_key ) );
102  }
103 
104  @Nonnull
105  @Override
106  public final Stream<IView> streamView()
107  {
108  return Stream.empty();
109  }
110 
111  @Nonnull
112  @Override
113  public final IBeliefbase clear()
114  {
115  return this;
116  }
117 
118  @Nonnull
119  @Override
120  public final IView add( @Nonnull final IView p_view )
121  {
122  throw new CIllegalStateException( CCommon.languagestring( IBeliefbaseOnDemand.class, "nostorage", this, p_view.name() ) );
123  }
124 
125  @Nonnull
126  @Override
127  public final IView remove( @Nonnull final IView p_view )
128  {
129  throw new CIllegalStateException( CCommon.languagestring( IBeliefbaseOnDemand.class, "nostorage", this, p_view.name() ) );
130  }
131 
132  @Override
133  public final boolean containsView( @Nonnull final String p_key )
134  {
135  return false;
136  }
137 
138 }
final IView viewOrDefault( @Nonnull final String p_key, final IView p_default)
on-demand beliefbase for creating trigger-events without any percistency
Stream< ILiteral > streamLiteral()
returns a stream over all literals
final boolean containsView( @Nonnull final String p_key)
contains a single-element
static< T > String languagestring(final T p_source, final String p_label, final Object... p_parameter)
returns the language depend string on any object
view for a beliefbase that creates any access to the underlying data structures
Definition: IView.java:44
Collection< ILiteral > literal( @Nonnull final String p_key)
returns a literal by the name
boolean containsLiteral( @Nonnull final String p_key)
contains a multi-element
interface of beliefbase definition, that create the trigger events for the agent
final IView view( @Nonnull final String p_key)
returns a view element
final Stream< IView > streamView()
returns a stream over all views
final IView add( @Nonnull final IView p_view)
adds a view
ILiteral add( @Nonnull final ILiteral p_literal)
adds a literal