Skip to content

Commit

Permalink
attribute values are arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
spoltier committed Jan 10, 2024
1 parent 0ac2484 commit 77b6b22
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class RDataFrameWithAttributes extends ResultWithAttributes{

private final RDataFrameWrapper value;

public RDataFrameWithAttributes(Map<String, String> attributes, RDataFrameWrapper value) {
public RDataFrameWithAttributes(Map<String, String[]> attributes, RDataFrameWrapper value) {
super(attributes);
this.value = value;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
*/
class ResultWithAttributes {

private final Map<String,String> attributes;
private final Map<String,String[]> attributes;

public ResultWithAttributes(Map<String,String> theAttributes) {
public ResultWithAttributes(Map<String,String[]> theAttributes) {
this.attributes = theAttributes;
}

Expand All @@ -21,22 +21,22 @@ public ResultWithAttributes() {
}

public ResultWithAttributes(Attribute attributeName, String attributeValue) {
this(Collections.singletonMap(attributeName.toString(), attributeValue));
this(Collections.singletonMap(attributeName.toString(), new String[]{attributeValue}));
}

public Map<String, String> getAttributes() {
public Map<String, String[]> getAttributes() {
return Collections.unmodifiableMap(attributes);
}

public String[] getAttributeNames() {
return attributes.keySet().toArray(new String[0]);
}

public String[] getAttributeValues() {
/* public String[] getAttributeValues() {
return attributes.values().toArray(new String[0]);
}
}*/

public String getAttributeValue(String attributeName){
public String[] getAttributeValue(String attributeName){
return attributes.get(attributeName);
}
}

0 comments on commit 77b6b22

Please sign in to comment.