Use newer Java features in places where it makes sense and more (#1009)

This commit is contained in:
altrisi authored and GitHub committed 2021-08-03 07:32:40 -03:00
1 parent 28cb136c6b
commit 7fb5e47da5
34 files changed
+338 -399

No files matched your search

@@ -149,6 +149,8 @@ public class ListValue extends AbstractListValue implements ContainerValueInterf
{
items.add(v);
}
@Override
public Value subtract(Value other)
{
ListValue output = new ListValue();
@@ -182,6 +184,7 @@ public class ListValue extends AbstractListValue implements ContainerValueInterf
}
@Override
public Value multiply(Value other)
{
ListValue output = new ListValue();
@@ -209,6 +212,8 @@ public class ListValue extends AbstractListValue implements ContainerValueInterf
}
return output;
}
@Override
public Value divide(Value other)
{
ListValue output = new ListValue();
@@ -272,8 +277,10 @@ public class ListValue extends AbstractListValue implements ContainerValueInterf
return items;
}
@Override
public Iterator<Value> iterator() { return new ArrayList<>(items).iterator(); } // should be thread safe
@Override
public List<Value> unpack()
{
return new ArrayList<>(items);