Examples of Indexed


Examples of ar.glyphsets.implicitgeometry.Indexed

      shaper = new Indexed.ToRect(size, size, false, xfield, yfield);
      valuer = new Indexed.ToValue<Object,V>(vfield);
    }
   
    public Glyph<Rectangle2D, V> value(GenericRecord r) {
      Indexed from =new GlyphsetTools.IndexedRecord(r);
      return new SimpleGlyph<Rectangle2D, V>(shaper.shape(from), valuer.value(from));
    }
View Full Code Here

Examples of ar.glyphsets.implicitgeometry.Indexed

   * @return The acc passed in, with new entries in the form (key, val, idx)
   */
  public static Collection<Indexed> broadcast(Object key, Iterable<?> values, Collection<Indexed> acc) {
    int i=0;
    for (Object val: values) {
      Indexed item = new Indexed.ArrayWrapper(new Object[]{key, val, i});
      acc.add(item);
      i++;
    }
    return acc;
  }
View Full Code Here

Examples of ar.glyphsets.implicitgeometry.Indexed

      catch (IOException e) {throw new RuntimeException(String.format("Error reading around character %d of %s.", charsRead, source.getName()), e);}
      if (next == null) {return;}
     
      try {
        for (String s: next) {charsRead += s.length();} //TODO: Probably not the fastest way to do this...
        Indexed base = conv.applyTo(new Indexed.ListWrapper(next));
        cached = new SimpleGlyph<>(shaper.shape(base), valuer.value(base));
      } catch (Exception e) {throw new RuntimeException(String.format("Error constructing glyph around character %d of %s", charsRead, source.getName()), e);}
    }
View Full Code Here

Examples of clojure.lang.Indexed

  @Override
  @SuppressWarnings("unchecked")
  public boolean nextKeyValue() throws IOException, InterruptedException {
    boolean nextp = super.nextKeyValue();
    if (nextp) {
      Indexed kv = getCurrentRecord();
      key.datum((K) kv.nth(0));
      val.datum((V) kv.nth(1));
    } else {
      key.datum(null);
      val.datum(null);
    }
    return nextp;
View Full Code Here

Examples of com.buschmais.cdo.neo4j.api.annotation.Indexed

        return new EnumPropertyMetadata(name);
    }

    @Override
    public IndexedPropertyMetadata createIndexedPropertyMetadata(PropertyMethod propertyMethod) {
        Indexed indexed = propertyMethod.getAnnotation(Indexed.class);
        return new IndexedPropertyMetadata(indexed.create());
    }
View Full Code Here

Examples of com.buschmais.xo.neo4j.api.annotation.Indexed

        return new PropertyMetadata(name);
    }

    @Override
    public IndexedPropertyMetadata createIndexedPropertyMetadata(PropertyMethod propertyMethod) {
        Indexed indexed = propertyMethod.getAnnotation(Indexed.class);
        return new IndexedPropertyMetadata(indexed.create(), indexed.unique());
    }
View Full Code Here

Examples of com.erudika.para.annotations.Indexed

   */
  public Object invoke(MethodInvocation mi) throws Throwable {
    Object result = null;
    Method m = mi.getMethod();
    Method superMethod = null;
    Indexed indexedAnno = null;
    Cached cachedAnno = null;
    String cn = getClass().getSimpleName();

    try {
      superMethod = DAO.class.getMethod(m.getName(), m.getParameterTypes());
      indexedAnno = Config.SEARCH_ENABLED ? superMethod.getAnnotation(Indexed.class) : null;
      cachedAnno = Config.CACHE_ENABLED ? superMethod.getAnnotation(Cached.class) : null;
    } catch (Exception e) {
      logger.error(null, e);
    }

    Object[] args = mi.getArguments();
    String appid = AOPUtils.getFirstArgOfString(args);

    if (indexedAnno != null) {
      switch (indexedAnno.action()) {
        case ADD:
          ParaObject addMe = AOPUtils.getArgOfParaObject(args);
          if (Utils.isValidObject(addMe)) {
            result = mi.proceed();
            search.index(appid, addMe);
View Full Code Here

Examples of com.erudika.para.annotations.Indexed

  @SuppressWarnings("unchecked")
  public Object invoke(MethodInvocation mi) throws Throwable {
    Object result = null;
    Method m = mi.getMethod();
    Method superMethod = null;
    Indexed indexedAnno = null;
    Cached cachedAnno = null;
    String cn = getClass().getSimpleName();

    try {
      superMethod = DAO.class.getMethod(m.getName(), m.getParameterTypes());
      indexedAnno = Config.SEARCH_ENABLED ? superMethod.getAnnotation(Indexed.class) : null;
      cachedAnno = Config.CACHE_ENABLED ? superMethod.getAnnotation(Cached.class) : null;
    } catch (Exception e) {
      logger.error(null, e);
    }

    Object[] args = mi.getArguments();
    String appid = AOPUtils.getFirstArgOfString(args);

    if (indexedAnno != null) {
      switch (indexedAnno.action()) {
        case ADD:
          ParaObject addMe = AOPUtils.getArgOfParaObject(args);
          if (Utils.isValidObject(addMe)) {
            result = mi.proceed();
            search.index(appid, addMe);
View Full Code Here

Examples of com.vaadin.data.Container.Indexed

     */
    @Test
    public void testWithBeanItemContainer() {

        // Create a container to use as a datasource
        Indexed container = createTestBeanItemContainer();

        // Set datasource
        calendar.setContainerDataSource(container);

        // Start and end dates to query for
        java.util.Calendar cal = java.util.Calendar.getInstance();
        cal.setTime(((CalendarEvent) container.getIdByIndex(0)).getStart());
        Date start = cal.getTime();
        cal.add(java.util.Calendar.MONTH, 1);
        Date end = cal.getTime();

        // Test the all events are returned
        List<CalendarEvent> events = calendar.getEventProvider().getEvents(
                start, end);
        assertEquals(container.size(), events.size());

        // Test that a certain range is returned
        cal.setTime(((CalendarEvent) container.getIdByIndex(6)).getStart());
        end = cal.getTime();
        events = calendar.getEventProvider().getEvents(start, end);
        assertEquals(6, events.size());
    }
View Full Code Here

Examples of com.vaadin.data.Container.Indexed

     * beans has been intentionally sorted by caption instead of date.
     */
    @Test
    public void testWithUnsortedBeanItemContainer() {
        // Create a container to use as a datasource
        Indexed container = createTestBeanItemContainer();

        // Make the container sorted by caption
        ((Sortable) container).sort(new Object[] { "caption" },
                new boolean[] { true });

        // Set data source
        calendar.setContainerDataSource(container);

        // Start and end dates to query for
        java.util.Calendar cal = java.util.Calendar.getInstance();
        cal.setTime(((CalendarEvent) container.getIdByIndex(0)).getStart());
        Date start = cal.getTime();
        cal.add(java.util.Calendar.MONTH, 1);
        Date end = cal.getTime();

        // Test the all events are returned
        List<CalendarEvent> events = calendar.getEventProvider().getEvents(
                start, end);
        assertEquals(container.size(), events.size());

        // Test that a certain range is returned
        cal.setTime(((CalendarEvent) container.getIdByIndex(6)).getStart());
        end = cal.getTime();
        events = calendar.getEventProvider().getEvents(start, end);

        // The events size is 1 since the getEvents returns the wrong range
        assertEquals(1, events.size());
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.