diff options
author | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2019-10-21 22:38:21 +0200 |
---|---|---|
committer | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2019-10-21 22:38:21 +0200 |
commit | c08e466f19e6da4dcf6bc93dfd2709a35cf3e248 (patch) | |
tree | 7b5c7aceb2ad82fd947e4cc447db1e67d77aba27 /src/pl/edu | |
parent | b206b1225c39e2ef21a0f817b93cd573fba8e929 (diff) |
Refactor ValueList
Diffstat (limited to 'src/pl/edu')
-rw-r--r-- | src/pl/edu/mimuw/cloudatlas/model/ValueList.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pl/edu/mimuw/cloudatlas/model/ValueList.java b/src/pl/edu/mimuw/cloudatlas/model/ValueList.java index d60e896..ae438e2 100644 --- a/src/pl/edu/mimuw/cloudatlas/model/ValueList.java +++ b/src/pl/edu/mimuw/cloudatlas/model/ValueList.java @@ -40,8 +40,8 @@ import pl.edu.mimuw.cloudatlas.model.ValueList; /** * A value representing a list of values of the specified type. Implements <code>List</code> interface. * <p> - * All constructors expect type of elements stored in this list. This type is checked when adding elements to the list - * and an <code>IllegalArgumentException</code> is thrown in case of error. + * All constructors take a type of elements stored in this list. This type is checked when adding elements to the list + * and an <code>IllegalArgumentException</code> is thrown in case of a mismatch. * * @see java.util.List */ @@ -110,9 +110,9 @@ public class ValueList extends ValueSimple<List<Value>> implements List<Value> { if(this.type.getElementType().isCompatible(((TypeCollection)type).getElementType())) { if(this.isNull()) return new ValueSet(null, this.type.getElementType()); - Set<Value> l = new HashSet<Value>(); - l.addAll(this); - return new ValueSet(l, this.type.getElementType()); + Set<Value> set = new HashSet<Value>(); + set.addAll(this); + return new ValueSet(set, this.type.getElementType()); } throw new UnsupportedConversionException(getType(), type); case STRING: @@ -147,7 +147,7 @@ public class ValueList extends ValueSimple<List<Value>> implements List<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 list contains elements of type " - + type.getElementType().toString() + " only. Not compatibile with elements of type: " + + type.getElementType().toString() + " only. Incompatible with elements of type: " + element.getType().toString()); } |