Class JsonArray
java.lang.Object
de.monticore.symboltable.serialization.json.JsonArray
- All Implemented Interfaces:
JsonElement
Represents a Json Array, i.e., a list of any Json elements. These can be of different types.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(JsonElement e) booleanaddAll(Collection<? extends JsonElement> c) booleanvoidforEach(Consumer<? super JsonElement> action) get(int index) booleanisEmpty()booleanremove(int index) booleanvoidsetValues(List<JsonElement> values) intsize()toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface de.monticore.symboltable.serialization.json.JsonElement
getAsJsonBoolean, getAsJsonNull, getAsJsonNumber, getAsJsonObject, getAsJsonString, isJsonBoolean, isJsonNull, isJsonNumber, isJsonObject, isJsonString
-
Field Details
-
values
-
-
Constructor Details
-
JsonArray
public JsonArray()
-
-
Method Details
-
isJsonArray
public boolean isJsonArray()- Specified by:
isJsonArrayin interfaceJsonElement- Returns:
- true iff this object is of type JsonArray and false otherwise.
- See Also:
-
getAsJsonArray
- Specified by:
getAsJsonArrayin interfaceJsonElement- Returns:
- this object as JsonArray if it is of this type and throws an error otherwise.
- See Also:
-
forEach
-
getValues
- Returns:
- elements
-
setValues
- Parameters:
values- the elements to set
-
size
public int size()- Returns:
- See Also:
-
isEmpty
public boolean isEmpty()- Returns:
- See Also:
-
contains
- Parameters:
o-- Returns:
- See Also:
-
add
- Parameters:
e-- Returns:
- See Also:
-
remove
- Parameters:
o-- Returns:
- See Also:
-
addAll
- Parameters:
c-- Returns:
- See Also:
-
get
- Parameters:
index-- Returns:
- See Also:
-
remove
- Parameters:
index-- Returns:
- See Also:
-
toString
-
print
- Specified by:
printin interfaceJsonElement
-