gov.nasa.pds.tools.label
Class Set

java.lang.Object
  extended by 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 of Value. A set can appear on the right hand side of an AttributeStatement.

Version:
$Revision: 12806 $
Author:
pramirez, jagander

Constructor Summary
Set()
           
Set(Collection<Scalar> values)
           
 
Method Summary
 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
 

Constructor Detail

Set

public Set()

Set

public Set(Collection<Scalar> values)
Method Detail

size

public int size()
Specified by:
size in interface Collection<Scalar>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection<Scalar>

contains

public boolean contains(Object object)
Specified by:
contains in interface Collection<Scalar>

iterator

public Iterator<Scalar> iterator()
Specified by:
iterator in interface Iterable<Scalar>
Specified by:
iterator in interface Collection<Scalar>

toArray

public Scalar[] toArray()
Specified by:
toArray in interface Collection<Scalar>

toArray

public <T> T[] toArray(T[] objects)
Specified by:
toArray in interface Collection<Scalar>

add

public boolean add(Scalar object)
Specified by:
add in interface Collection<Scalar>

remove

public boolean remove(Object object)
Specified by:
remove in interface Collection<Scalar>

containsAll

public boolean containsAll(Collection<?> vals)
Specified by:
containsAll in interface Collection<Scalar>

addAll

public boolean addAll(Collection<? extends Scalar> vals)
Specified by:
addAll in interface Collection<Scalar>

removeAll

public boolean removeAll(Collection<?> vals)
Specified by:
removeAll in interface Collection<Scalar>

retainAll

public boolean retainAll(Collection<?> vals)
Specified by:
retainAll in interface Collection<Scalar>

clear

public void clear()
Specified by:
clear in interface Collection<Scalar>

normalize

public String normalize()
Specified by:
normalize in interface Value

toString

public String toString()
Overrides:
toString in class Object

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 interface Collection<Scalar>
Overrides:
equals in class Object

hashcode

public int hashcode()


Copyright © 2005-2014 Planetary Data System. All Rights Reserved.