m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src/pl/edu/mimuw
diff options
context:
space:
mode:
authorMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2019-10-22 11:34:47 +0200
committerMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2019-10-22 11:34:55 +0200
commit4c92c11dc8d7fe8cb6331284050be238d619e043 (patch)
tree0e6d939f7c87198dbabd2b7ebc0a4fa8053c786f /src/pl/edu/mimuw
parent8500b8b6fbbc9c4a94ceb609611818a40e0be314 (diff)
Refactor ValueSet
Diffstat (limited to 'src/pl/edu/mimuw')
-rw-r--r--src/pl/edu/mimuw/cloudatlas/model/ValueSet.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/pl/edu/mimuw/cloudatlas/model/ValueSet.java b/src/pl/edu/mimuw/cloudatlas/model/ValueSet.java
index 7f4968b..9843cd4 100644
--- a/src/pl/edu/mimuw/cloudatlas/model/ValueSet.java
+++ b/src/pl/edu/mimuw/cloudatlas/model/ValueSet.java
@@ -39,8 +39,8 @@ import pl.edu.mimuw.cloudatlas.model.ValueSet;
/**
* A value representing a set of values of the specified type. Implements <code>Set</code> interface.
* <p>
- * All constructors expect type of elements stored in this set. This type is checked when adding elements to the set and
- * an <code>IllegalArgumentException</code> is thrown in case of error.
+ * All constructors take a type of elements stored in this set. This type is checked when adding elements to the set and
+ * an <code>IllegalArgumentException</code> is thrown in case of a mismatch.
*
* @see java.util.Set
*/
@@ -80,7 +80,7 @@ public class ValueSet extends ValueSimple<Set<Value>> implements Set<Value> {
}
/**
- * Gets a <code>Set</code> containing all the objects stored in this value. Modifying a return value will cause an
+ * Gets a <code>Set</code> containing all the objects stored in this value. Modifying the returned list will cause an
* exception.
*/
@Override
@@ -123,7 +123,7 @@ public class ValueSet extends ValueSimple<Set<Value>> implements Set<Value> {
throw new IllegalArgumentException("If you want to use null, create an object containing null instead.");
if(!type.getElementType().isCompatible(element.getType()))
throw new IllegalArgumentException("This set contains elements of type " + type.getElementType().toString()
- + " only. Not compatibile with elements of type: " + element.getType().toString());
+ + " only. Incompatible with elements of type: " + element.getType().toString());
}
@Override
@@ -205,9 +205,9 @@ public class ValueSet extends ValueSimple<Set<Value>> implements Set<Value> {
if(this.type.getElementType().isCompatible(((TypeCollection)type).getElementType())) {
if(this.isNull())
return new ValueList(null, this.type.getElementType());
- List<Value> l = new ArrayList<Value>();
- l.addAll(this);
- return new ValueList(l, this.type.getElementType());
+ List<Value> list = new ArrayList<Value>();
+ list.addAll(this);
+ return new ValueList(list, this.type.getElementType());
}
throw new UnsupportedConversionException(getType(), type);
case STRING: