W3C home > Mailing lists > Public > public-ddwg-comments@w3.org > April 2008

RE: DDR Simple API - PropertyValue and Enumerations

From: Rotan Hanrahan <rotan.hanrahan@mobileaware.com>
Date: Tue, 15 Apr 2008 06:07:40 -0400
Message-ID: <D5306DC72D165F488F56A9E43F2045D3018B114E@FTO.mobileaware.com>
To: "JOSE MANUEL CANTERA FONSECA" <jmcf@tid.es>
Cc: <public-ddwg-comments@w3.org>
Hello José,

 

Thank you for your comment. We have recorded this comment as “LC-1954” and we will respond as soon as possible.

 

On behalf of DDWG,

Rotan Hanrahan

Chair

 

From: public-ddwg-comments-request@w3.org [mailto:public-ddwg-comments-request@w3.org] On Behalf Of JOSE MANUEL CANTERA FONSECA
Sent: 15 April 2008 10:26
To: public-ddwg-comments@w3.org
Subject: DDR Simple API - PropertyValue and Enumerations

 

The PropertyValue interface publishes the method "getEnumeration()" to deal with property values that are an enumeration of several values, such as image formats. If a content adaptation solution needs to check if a Delivery Context supports "gif" it will need to do the following:

 

PropertyValue val = service.getPropertyValue(evidence,"supportedImageFormats");

 

String[] imageFormats = val.getEnumeration();

 

gifSupported = false;

 

for(int j = 0; j < imageFormats.length; j++) {
    if(imageFormats[j].equals("gif")) {
       gifSupported = true;
    }
}

 

As it is seen this is a very inconvenient way to do a more than common  operation. Also it will force develoeprs to copy & paste this code over all the applications

 

Proposed Amendment:

 

+ Add a contains method on the PropertyValue interface that returns true or false depending on the values of the enumeration

 

boolean gifSupported = service.getPropertyValue(evidence,"supportedImageFormats").contains("gif");

 

José Manuel Cantera 
Senior Technologist
Telefónica I+D

Received on Tuesday, 15 April 2008 10:08:52 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 19:41:40 UTC