From 4c92c11dc8d7fe8cb6331284050be238d619e043 Mon Sep 17 00:00:00 2001 From: Marcin Chrzanowski Date: Tue, 22 Oct 2019 11:34:47 +0200 Subject: Refactor ValueSet --- src/pl/edu/mimuw/cloudatlas/model/ValueSet.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') 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 Set interface. *

- * All constructors expect type of elements stored in this set. This type is checked when adding elements to the set and - * an IllegalArgumentException 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 IllegalArgumentException is thrown in case of a mismatch. * * @see java.util.Set */ @@ -80,7 +80,7 @@ public class ValueSet extends ValueSimple> implements Set { } /** - * Gets a Set containing all the objects stored in this value. Modifying a return value will cause an + * Gets a Set 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> implements Set { 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> implements Set { if(this.type.getElementType().isCompatible(((TypeCollection)type).getElementType())) { if(this.isNull()) return new ValueList(null, this.type.getElementType()); - List l = new ArrayList(); - l.addAll(this); - return new ValueList(l, this.type.getElementType()); + List list = new ArrayList(); + list.addAll(this); + return new ValueList(list, this.type.getElementType()); } throw new UnsupportedConversionException(getType(), type); case STRING: -- cgit v1.2.3