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 boolean
add(Scalar object)
boolean
addAll(Collection<? extends Scalar> vals)
void
clear()
boolean
contains(Object object)
boolean
containsAll(Collection<?> vals)
boolean
equals(Object object)
int
hashcode()
boolean
isEmpty()
Iterator<Scalar>
iterator()
String
normalize()
boolean
remove(Object object)
boolean
removeAll(Collection<?> vals)
boolean
retainAll(Collection<?> vals)
int
size()
Scalar[]
toArray()
<T> T[]
toArray(T[] objects)
String
toString()
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.-
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:
size
in interfaceCollection<Scalar>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceCollection<Scalar>
-
contains
public boolean contains(Object object)
- Specified by:
contains
in interfaceCollection<Scalar>
-
toArray
public Scalar[] toArray()
- Specified by:
toArray
in interfaceCollection<Scalar>
-
toArray
public <T> T[] toArray(T[] objects)
- Specified by:
toArray
in interfaceCollection<Scalar>
-
add
public boolean add(Scalar object)
- Specified by:
add
in interfaceCollection<Scalar>
-
remove
public boolean remove(Object object)
- Specified by:
remove
in interfaceCollection<Scalar>
-
containsAll
public boolean containsAll(Collection<?> vals)
- Specified by:
containsAll
in interfaceCollection<Scalar>
-
addAll
public boolean addAll(Collection<? extends Scalar> vals)
- Specified by:
addAll
in interfaceCollection<Scalar>
-
removeAll
public boolean removeAll(Collection<?> vals)
- Specified by:
removeAll
in interfaceCollection<Scalar>
-
retainAll
public boolean retainAll(Collection<?> vals)
- Specified by:
retainAll
in interfaceCollection<Scalar>
-
clear
public void clear()
- Specified by:
clear
in 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:
equals
in interfaceCollection<Scalar>
- Overrides:
equals
in classObject
-
hashcode
public int hashcode()
-
-