Package gov.nasa.pds.tools.label
Class Set
- java.lang.Object
-
- gov.nasa.pds.tools.label.Set
-
- All Implemented Interfaces:
Value,Iterable<Scalar>,Collection<Scalar>
public class Set extends Object implements Collection<Scalar>, Value
This class implements the Collection interface to hide its backing. It is a unordered set ofValue. A set can appear on the right hand side of anAttributeStatement.- Version:
- $Revision$
- Author:
- pramirez, jagander
-
-
Constructor Summary
Constructors Constructor Description Set()Set(Collection<Scalar> values)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(Scalar object)booleanaddAll(Collection<? extends Scalar> vals)voidclear()booleancontains(Object object)booleancontainsAll(Collection<?> vals)booleanequals(Object object)inthashcode()booleanisEmpty()Iterator<Scalar>iterator()Stringnormalize()booleanremove(Object object)booleanremoveAll(Collection<?> vals)booleanretainAll(Collection<?> vals)intsize()Scalar[]toArray()<T> T[]toArray(T[] objects)StringtoString()StringtoString(boolean retainQuotes)Provides a string representation of the Set with single or double quotes surrounding each value if the retainQuotes flag is set to true and the ValueType was SINGLE_QUOTED or DOUBLE_QUOTED for a value.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
hashCode, parallelStream, removeIf, spliterator, stream, toArray
-
-
-
-
Constructor Detail
-
Set
public Set()
-
Set
public Set(Collection<Scalar> values)
-
-
Method Detail
-
size
public int size()
- Specified by:
sizein interfaceCollection<Scalar>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceCollection<Scalar>
-
contains
public boolean contains(Object object)
- Specified by:
containsin interfaceCollection<Scalar>
-
toArray
public Scalar[] toArray()
- Specified by:
toArrayin interfaceCollection<Scalar>
-
toArray
public <T> T[] toArray(T[] objects)
- Specified by:
toArrayin interfaceCollection<Scalar>
-
add
public boolean add(Scalar object)
- Specified by:
addin interfaceCollection<Scalar>
-
remove
public boolean remove(Object object)
- Specified by:
removein interfaceCollection<Scalar>
-
containsAll
public boolean containsAll(Collection<?> vals)
- Specified by:
containsAllin interfaceCollection<Scalar>
-
addAll
public boolean addAll(Collection<? extends Scalar> vals)
- Specified by:
addAllin interfaceCollection<Scalar>
-
removeAll
public boolean removeAll(Collection<?> vals)
- Specified by:
removeAllin interfaceCollection<Scalar>
-
retainAll
public boolean retainAll(Collection<?> vals)
- Specified by:
retainAllin interfaceCollection<Scalar>
-
clear
public void clear()
- Specified by:
clearin interfaceCollection<Scalar>
-
toString
public String toString(boolean retainQuotes)
Provides a string representation of the Set with single or double quotes surrounding each value if the retainQuotes flag is set to true and the ValueType was SINGLE_QUOTED or DOUBLE_QUOTED for a value.- Parameters:
retainQuotes- Set to true to return the value with quotes surrounding it if it was originally there in the label.- Returns:
- The string representation of the Set.
-
equals
public boolean equals(Object object)
- Specified by:
equalsin interfaceCollection<Scalar>- Overrides:
equalsin classObject
-
hashcode
public int hashcode()
-
-