updated

parent a0646bbb
Pipeline #207259 failed with stage
in 54 seconds
......@@ -105,10 +105,10 @@ public class TagResolver {
* @param symbol
* @return
*/
public Collection<TagSymbol> getTagSymbolsFor(String symbolName) {
public List<TagSymbol> getTagSymbolsFor(String symbolName) {
List<TagSymbol> list = new ArrayList<>();
for (TagSymbol tagSymbol : allCreatedTagSymbols) {
if (tagSymbol.getTaggedSymbolName().equals(symbolName)) {
if (tagSymbol.getTaggedSymbolNameOpt().get().equals(symbolName)) {
list.add(tagSymbol);
}
}
......@@ -121,7 +121,7 @@ public class TagResolver {
* @param symbol
* @return
*/
public Collection<TagPair> getTagsFor(String symbolName) {
public List<TagPair> getTagsFor(String symbolName) {
List<TagPair> list = new ArrayList<>();
for (TagSymbol tagSymbol : allCreatedTagSymbols) {
for (TagPair tagPair : tagSymbol.getTagPairs()) {
......
......@@ -23,6 +23,7 @@ package de.monticore.lang.tagging._symboltable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
/**
......@@ -33,7 +34,7 @@ import java.util.stream.Collectors;
*/
public class TagSymbol extends TagSymbolTOP {
protected String taggedSymbolName;
protected Optional<String> taggedSymbolName;
protected List<TagPair> tagPairs = new ArrayList<>();
......@@ -53,14 +54,14 @@ public class TagSymbol extends TagSymbolTOP {
* has no range check, it is should be only used for classes
* which extends this class, they know how many objects are stored
*/
protected <T> T getTagPair(int index) {
public <T> T getTagPair(int index) {
return (T) this.tagPairs.get(index);
}
/**
* is only needed for multiple inheritance chains
*/
protected void addValues(TagPair... tagPairs) {
public void addTagPairs(TagPair... tagPairs) {
this.tagPairs.addAll(Arrays.asList(tagPairs));
}
......@@ -92,12 +93,12 @@ public class TagSymbol extends TagSymbolTOP {
return tagPairs.hashCode();
}
public String getTaggedSymbolName() {
public Optional<String> getTaggedSymbolNameOpt() {
return taggedSymbolName;
}
public void setTaggedSymbolName(String taggedSymbolName) {
this.taggedSymbolName = taggedSymbolName;
this.taggedSymbolName = Optional.ofNullable(taggedSymbolName);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment