Examples of Item


Examples of com.sun.jersey.samples.optimisticconcurrency.Item

            version = id.getVersionAsString();
            mediaType = id.getMediaType();
        }
       
        UriBuilder ub = uriInfo.getAbsolutePathBuilder().path("content");
        return new Item(
                ub.build(),
                ub.path(version).build(),
                mediaType.toString());
    }
View Full Code Here

Examples of com.sun.jersey.samples.springannotations.model.Item

     * a valid response.
     */
    @Test
    public void doTestJerseyAutowired() {
        WebResource webResource = resource();
        Item item = webResource.path("jersey-autowired").accept(MediaType.APPLICATION_XML)
                .get(Item.class);
        assertEquals("Method: doTestJerseyAutowired \nMessage: Returned item's value " +
                " does not match the expected one.", "foo", item.getValue());
    }
View Full Code Here

Examples of com.sun.jersey.samples.storageservice.Item

   
    @GET
    public Response getItem() {
        System.out.println("GET ITEM " + container + " " + item);
       
        Item i = MemoryStore.MS.getItem(container, item);
        if (i == null)
            throw new NotFoundException("Item not found");
        Date lastModified = i.getLastModified().getTime();
        EntityTag et = new EntityTag(i.getDigest());
        ResponseBuilder rb = request.evaluatePreconditions(lastModified, et);
        if (rb != null)
            return rb.build();
           
        byte[] b = MemoryStore.MS.getItemData(container, item);
        return Response.ok(b, i.getMimeType()).
                lastModified(lastModified).tag(et).build();
    }   
View Full Code Here

Examples of com.sun.speech.freetts.Item

     */
    public void processUtterance(Utterance utterance) throws ProcessException {
  Relation segmentRelation = utterance.getRelation(Relation.SEGMENT);
        Relation targetRelation = utterance.getRelation(Relation.TARGET);

        Item segment = segmentRelation.getHead();
        Item target = null;
  if (targetRelation != null) target = targetRelation.getHead();
        float prevEnd = 0f;
        while (segment != null) {
            // String name = segment.getFeatures().getString("name");
            // Accumulated duration of all segments in the utterance,
            // in seconds:
            float end = segment.getFeatures().getFloat("end");
            // Individual duration of segment, in milliseconds:
            int dur = (int) ((end - prevEnd) * 1000);
            StringBuffer targetStringBuffer = new StringBuffer();
            while (target != null &&
                   target.getFeatures().getFloat("pos") <= end) {
                float pos = target.getFeatures().getFloat("pos");
                // time axis as percentage of segment duration:
                int percentage = ((int) ((pos - prevEnd) * 1000)) * 100 / dur;
                // f0 as an integer:
                int f0 = (int) target.getFeatures().getFloat("f0");
                targetStringBuffer.append(" ");
                targetStringBuffer.append(percentage);
                targetStringBuffer.append(" ");
                targetStringBuffer.append(f0);
                target = target.getNext();
            }
            // System.err.println(name + " " + dur + targetStringBuffer);
            segment.getFeatures().setInt("mbr_dur", dur);
            segment.getFeatures().setString("mbr_targets",
                                            targetStringBuffer.toString().trim());
View Full Code Here

Examples of com.sun.syndication.feed.rss.Item

     * @return the parsed RSSItem bean.
     */
    @Override
    protected Item parseItem(Element rssRoot, Element eItem)
    {
        Item item = super.parseItem(rssRoot, eItem);

        // Parse the pub date
        String pubDate = eItem.getChildText("pubDate", getRSSNamespace());
        if (StringUtils.isNotEmpty(pubDate))
        {
            Date date = DateParser.parseDate(pubDate);
            if (date != null) item.setPubDate(date);
        }

        return item;
    }
View Full Code Here

Examples of com.vaadin.data.Item

        });
        update(beans);
        layout.addComponent(table);

        Object first = table.getItemIds().iterator().next();
        Item item = table.getItem(first);
        form.setItemDataSource(item);

        form.setCaption("Edit Task");
        form.setVisibleItemProperties(VISIBLE_COLUMNS);
        form.setImmediate(true);
        form.addListener(new Property.ValueChangeListener() {
            public void valueChange(ValueChangeEvent event) {
                @SuppressWarnings("unchecked")
                BeanItem<Task> item = (BeanItem<Task>) form.getItemDataSource();
                taskService.updateTask(item.getBean());
            }
        });
        layout.addComponent(form);
    }
View Full Code Here

Examples of com.volantis.xml.expression.sequence.Item

                                    String[] strings) throws Exception {
        assertTrue("Sequence length should be " + strings.length +
                ", was " + retSeq.getLength(),
                retSeq.getLength() == strings.length);
        for (int i = 1; i <= strings.length; i++) {
            Item item = retSeq.getItem(i);
            assertTrue("Item " + i + " should be same string",
                    strings[i - 1].equals(item.stringValue().asJavaString()));
        }
    }
View Full Code Here

Examples of com.vtence.tape.testmodel.Item

    public ItemRecord(Table<Product> products) {
        this.products = products;
    }

    public Item hydrate(ResultSet rs) throws SQLException {
        Item item = new Item(number.get(rs), products.hydrate(rs), price.get(rs));
        Access.idOf(item).set(id.get(rs));
        return item;
    }
View Full Code Here

Examples of com.xerox.amazonws.simpledb.Item

            itemsQueue.clear();
        }
    }

    private Item jsonItemToSimpleDBItem(JSONItem jsonItem) {
        Item item = domain.createItem(jsonItem.getIdentifier());
        for (JSONAttribute jsonAttribute : jsonItem.getAttributes()) {
            item.getAttributes().put(jsonAttribute.getName(), jsonAttribute.getValues());
        }

        return item;
    }
View Full Code Here

Examples of coordinate.model.Item

    /**
     * @throws Exception
     */
    @Test
    public void isSecondSkirt() throws Exception {
        Item second = new Item();
        second.setCategory(Category.BOTTOMS);
        second.setVariety(Variety.SKIRT);
        assertThat(rule.isSecondSkirt(second), is(true));
        second.setVariety(Variety.PANTS);
        assertThat(rule.isSecondSkirt(second), is(false));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.