com.sun.spot.client.command
Class HelloResultList
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList
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
Constructor Summary |
HelloResultList(int desktopLibraryHash,
String desktopSDKVersion,
byte[] desktopPublicKey)
|
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 |
HelloResultList
public HelloResultList(int desktopLibraryHash,
String desktopSDKVersion,
byte[] desktopPublicKey)
- Parameters:
desktopLibraryHash
- the suite hash of the latest library suitedesktopSDKVersion
- the version of the SDK isntalled on the desktopdesktopPublicKey
- the public key of the desktop SDK.
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
Copyright © 2006, 2007 Sun Microsystems, Inc. All Rights Reserved.