SunSPOT host API V3.0


com.sun.spot.client.command
Class HelloResultList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList
              extended by com.sun.spot.client.command.HelloResultList
All Implemented Interfaces:
Serializable, Cloneable, Iterable, Collection, List, RandomAccess

public class HelloResultList
extends ArrayList

HelloResultList is a helper class for HelloCommand. It contains a list of HelloResult objects, as returned from running a "hello" command, and can display them nicely (see toString()

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
HelloResultList(int desktopLibraryHash, String desktopSDKVersion, byte[] desktopPublicKey)
           
 
Method Summary
 boolean add(Object hr)
          Adds the HelloResult object only if another one with the same IEEE address isn't already present.
 int getDesktopLibraryHash()
           
 byte[] getDesktopPublicKey()
           
 String getDesktopSDKVersion()
           
 HelloResult getResult(int i)
           
 String toString()
           
 
Methods inherited from class java.util.ArrayList
add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

HelloResultList

public HelloResultList(int desktopLibraryHash,
                       String desktopSDKVersion,
                       byte[] desktopPublicKey)
Parameters:
desktopLibraryHash - the suite hash of the latest library suite
desktopSDKVersion - the version of the SDK isntalled on the desktop
desktopPublicKey - the public key of the desktop SDK.
Method Detail

toString

public String toString()
Overrides:
toString in class AbstractCollection

getResult

public HelloResult getResult(int i)
Parameters:
i - index
Returns:
the result at specified index

add

public boolean add(Object hr)
Adds the HelloResult object only if another one with the same IEEE address isn't already present. This actually makes HelloResultList more like a HashSet but we keep it as an ArrayList as as not to break apps that expect HelloResultList to be an ArrayList. We also ignore responses with unsupported version

Specified by:
add in interface Collection
Specified by:
add in interface List
Overrides:
add in class ArrayList
Parameters:
hr - a HelloResult object we wish to add
Returns:
true

getDesktopLibraryHash

public int getDesktopLibraryHash()
Returns:
the desktopLibraryHash

getDesktopPublicKey

public byte[] getDesktopPublicKey()
Returns:
the desktopPublicKey

getDesktopSDKVersion

public String getDesktopSDKVersion()
Returns:
the desktopSDKVersion

SunSPOT host API V3.0


Copyright © 2006, 2007 Sun Microsystems, Inc. All Rights Reserved.