Skip to content
Snippets Groups Projects
Verified Commit c1d95995 authored by Miles Vella's avatar Miles Vella
Browse files

fix subset of bool compile and logic errors

parent 7310cb90
No related branches found
No related tags found
1 merge request!66Refactor of Java BTypes
...@@ -337,9 +337,9 @@ public class BSet<T> implements BObject, Set<T> { ...@@ -337,9 +337,9 @@ public class BSet<T> implements BObject, Set<T> {
return result; return result;
} }
public BBoolean subsetOfInteger() { public BBoolean subsetOfBoolean() {
for(T e : this) { for(T e : this) {
if(e instanceof BInteger) { if(e instanceof BBoolean) {
return new BBoolean(true); return new BBoolean(true);
} else { } else {
return new BBoolean(false); return new BBoolean(false);
...@@ -349,7 +349,7 @@ public class BSet<T> implements BObject, Set<T> { ...@@ -349,7 +349,7 @@ public class BSet<T> implements BObject, Set<T> {
} }
public BBoolean strictSubsetOfBoolean() { public BBoolean strictSubsetOfBoolean() {
return subsetOfBoolean(); return new BBoolean(subsetOfBoolean().booleanValue() && this.size() < 2);
} }
public BBoolean notSubsetOfBoolean() { public BBoolean notSubsetOfBoolean() {
...@@ -364,6 +364,17 @@ public class BSet<T> implements BObject, Set<T> { ...@@ -364,6 +364,17 @@ public class BSet<T> implements BObject, Set<T> {
return new BBoolean(subsetOfBoolean().booleanValue() && this.size() < 2); return new BBoolean(subsetOfBoolean().booleanValue() && this.size() < 2);
} }
public BBoolean subsetOfInteger() {
for(T e : this) {
if(e instanceof BInteger) {
return new BBoolean(true);
} else {
return new BBoolean(false);
}
}
return new BBoolean(true);
}
public BBoolean strictSubsetOfInteger() { public BBoolean strictSubsetOfInteger() {
return subsetOfInteger(); return subsetOfInteger();
} }
......
...@@ -353,7 +353,7 @@ public class BSet<T> implements Set<T>, BObject { ...@@ -353,7 +353,7 @@ public class BSet<T> implements Set<T>, BObject {
} }
public BBoolean strictSubsetOfBoolean() { public BBoolean strictSubsetOfBoolean() {
return subsetOfBoolean(); return new BBoolean(subsetOfBoolean().booleanValue() && this.size() < 2);
} }
public BBoolean notSubsetOfBoolean() { public BBoolean notSubsetOfBoolean() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment