LightJason - AgentSpeak(L++)
IContext.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.language.execution;
25 
32 
33 import javax.annotation.Nonnull;
34 import java.io.Serializable;
35 import java.util.Collections;
36 import java.util.Map;
37 
38 
42 public interface IContext extends Serializable
43 {
48  {
52  private static final long serialVersionUID = -1053856178724776159L;
53 
54  @Nonnull
55  @Override
56  public final IAgent<?> agent()
57  {
58  return IAgent.EMPTY;
59  }
60 
61  @Nonnull
62  @Override
63  public final IInstantiable instance()
64  {
65  return IPlan.EMPTY;
66  }
67 
68  @Nonnull
69  @Override
70  public final Map<IPath, IVariable<?>> instancevariables()
71  {
72  return Collections.emptyMap();
73  }
74 
75  @Nonnull
76  @Override
77  public final IContext duplicate()
78  {
79  return this;
80  }
81  };
82 
87  {
91  private static final long serialVersionUID = -1053856178757676139L;
92 
93  @Nonnull
94  @Override
95  public final IAgent<?> agent()
96  {
97  return IAgent.EMPTY;
98  }
99 
100  @Nonnull
101  @Override
102  public final IInstantiable instance()
103  {
104  return IRule.EMPTY;
105  }
106 
107  @Nonnull
108  @Override
109  public final Map<IPath, IVariable<?>> instancevariables()
110  {
111  return Collections.emptyMap();
112  }
113 
114  @Nonnull
115  @Override
116  public final IContext duplicate()
117  {
118  return this;
119  }
120  };
121 
122 
128  @Nonnull
129  IAgent<?> agent();
130 
136  @Nonnull
138 
144  @Nonnull
145  Map<IPath, IVariable<?>> instancevariables();
146 
152  @Nonnull
154 
155 }
Map< IPath, IVariable<?> > instancevariables()
returns the variables names and their current value
IContext EMPTYPLAN
empty context with plan
Definition: IContext.java:47
interface for (instantiable) plans and logical-rules
IInstantiable instance()
returns the instance object
execution context with local data
Definition: IContext.java:42
IAgent<?> EMPTY
empty agent
Definition: IAgent.java:63
IContext EMPTYRULE
empty context with rule
Definition: IContext.java:86
IContext duplicate()
duplicates the context with a shallow-copy
IAgent<?> agent()
returns the agent of the context