org.ocap.hn.upnp.server
Class UPnPManagedDeviceIcon

java.lang.Object
  extended by org.ocap.hn.upnp.server.UPnPManagedDeviceIcon
All Implemented Interfaces:
UPnPDeviceIcon

public class UPnPManagedDeviceIcon
extends Object
implements UPnPDeviceIcon

This class represents a UPnP Device Icon with associated binary data for a UPnPManagedDevice.


Constructor Summary
UPnPManagedDeviceIcon(String mimetype, int width, int height, int colordepth, byte[] data)
          Construct the instance.
 
Method Summary
 UPnPAdvertisedDeviceIcon[] getAdvertisedDeviceIcons()
          Gets the network representations of this UPnPManagedDeviceIcon.
 int getColorDepth()
          Gets the color depth of this icon in bits.
 byte[] getData()
          Gets the binary data that represents this icon.
 int getHeight()
          Gets the height of this icon in pixels.
 String getMimeType()
          Gets the mimetype for this UPnPDeviceIcon.
 int getWidth()
          Gets the width of this icon in pixels.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UPnPManagedDeviceIcon

public UPnPManagedDeviceIcon(String mimetype,
                             int width,
                             int height,
                             int colordepth,
                             byte[] data)
Construct the instance.

Parameters:
mimetype - The mimetype of this icon in the form image/xxxx.
width - The width of this icon in pixels.
height - The height of this icon in pixels.
colordepth - The color depth of this icon in bits.
data - A byte array containing the binary icon data. The contents of the array are copied into the resulting UPnPManagedDeviceIcon object. No validation is performed on the array, but it should contain data consistent with the other parameters to the constructor.
Method Detail

getData

public byte[] getData()
Gets the binary data that represents this icon.

Returns:
An array containing a copy of the binary icon data.

getAdvertisedDeviceIcons

public UPnPAdvertisedDeviceIcon[] getAdvertisedDeviceIcons()
Gets the network representations of this UPnPManagedDeviceIcon. Since the UPnP device description iconList element contains information specific to the network interface on which it is advertised, there can be multiple UPnPAdvertisedDeviceIcon objects associated with a single UPnPManagedDeviceIcon.

Returns:
The network representations of this UPnPManagedDeviceIcon. Returns a zero-length array if the corresponding UPnP device has not been advertised on a network interface.

getColorDepth

public int getColorDepth()
Gets the color depth of this icon in bits.

Specified by:
getColorDepth in interface UPnPDeviceIcon
Returns:
The color depth of the icon in bits. If the corresponding UPnP device has been advertised, this method returns the same value as getAdvertisedDeviceIcons()[0].getColorDepth().

getHeight

public int getHeight()
Gets the height of this icon in pixels.

Specified by:
getHeight in interface UPnPDeviceIcon
Returns:
The height of the icon in pixels. If the corresponding UPnP device has been advertised, this method returns the same value as getAdvertisedDeviceIcons()[0].getHeight().

getMimeType

public String getMimeType()
Gets the mimetype for this UPnPDeviceIcon. For UPnPDeviceIcons conforming to UPnP Device Architecture 1.0, this should be of the form image/xxxx where xxxx is the specific image subtype.

Specified by:
getMimeType in interface UPnPDeviceIcon
Returns:
The mimetype string for this icon. If the corresponding UPnP device has been advertised, this method returns the same value as getAdvertisedDeviceIcons()[0].getMimeType().

getWidth

public int getWidth()
Gets the width of this icon in pixels.

Specified by:
getWidth in interface UPnPDeviceIcon
Returns:
The width of the icon in pixels. If the corresponding UPnP device has been advertised, this method returns the same value as getAdvertisedDeviceIcons()[0].getWidth().


Copyright © 2011. All Rights Reserved.