/** * Returns the prior probability for <code>v</code>. * * @param v * the vertex whose prior probability is being queried * @return the prior probability for <code>v</code> */ protected S getVertexPrior(V v) { return vertex_priors.transform(v); }
/** * Transforms the input by ignoring the input and returning the result of * calling the decorated factory. * * @param input * the input object to transform * @return the transformed result */ @Override public T transform(I input) { return iFactory.create(); }
/** * Under testing, do not use just yet **/ public T getElementAtModelRowIndex(int rowModelIndex) { return this.mapElementId2ModelIndexWithThatValue.inverseBidiMap().get(rowModelIndex); }
/** * Under testing, do not use just yet **/ public Optional<Integer> getRowModelIndexOfElement(Object element) { final Integer res = this.mapElementId2ModelIndexWithThatValue.get(element); return res == null? Optional.empty() : Optional.of(res); }
/** * Remember to call super if you override this template method. */ public void configure(WidgetBuilder builder) { for (Closure<WidgetBuilder> configuration : this.configurations) { configuration.execute(builder); } } }
public int getCanvasNumberOfVisibleLayers() { return cache_mapCanvasVisibleLayer2VisualizationOrderRemovingNonVisible.size(); }
/** * Returns an <code>Iterator</code> that does not support modification * of the heap. */ @Override public Iterator<T> iterator() { return IteratorUtils.<T>unmodifiableIterator(heap.iterator()); }
@Override public List<String> transform(List<String> resource) { List<String> copy = new ArrayList<String>(resource); CollectionUtils.transform(copy, new Transformer<String, String>() { public String transform(String input) { return StringUtils.trim(input); } }); return copy; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; OptionList<?> that = (OptionList<?>) o; if (!elementClass.equals(that.elementClass)) return false; return ListUtils.isEqualList(list, that.list); }
/** * @see edu.uci.ics.jung.graph.Hypergraph#getVertices() */ @Override public Collection<V> getVertices() { return CollectionUtils.unmodifiableCollection(vertex_data.keySet()); }
/** * Returns the prior probability for <code>v</code>. * @param v the vertex whose prior probability is being queried * @return the prior probability for <code>v</code> */ protected S getVertexPrior(V v) { return vertex_priors.transform(v); }
/** * create a Forest from the supplied Graph and supplied Factory, which is * used to create a new, empty Forest. If non-null, the supplied root will * be used as the root of the tree/forest. If the supplied root is null, or * not present in the Graph, then an arbitary Graph vertex will be selected * as the root. If the Minimum Spanning Tree does not include all vertices * of the Graph, then a leftover vertex is selected as a root, and another * tree is created * * @param graph * @param factory * @param weights */ public MinimumSpanningForest2(Graph<V, E> graph, Factory<Forest<V, E>> factory, Factory<? extends Graph<V, E>> treeFactory, Transformer<E, Double> weights) { this(graph, factory.create(), treeFactory, weights); }
/** * create an instance with passed values. * * @param graphFactory * must create a DirectedGraph to use as a delegate */ public DelegateTree(Factory<DirectedGraph<V, E>> graphFactory) { super(graphFactory.create()); this.vertex_depths = new HashMap<V, Integer>(); }
/** * Transforms the input to result via each decorated transformer * * @param object * the input object passed to the first transformer * @return the transformed result */ @Override public O transform(I object) { Object intermediate = object; for (int i = 0; i < iTransformers.length; i++) { intermediate = iTransformers[i].transform(intermediate); } return (O) intermediate; }
@Override @SuppressWarnings("unchecked") public V get(Object key) { // create value for key if key is not currently in the map if (map.containsKey(key) == false) { V value = this.transformer.transform((K) key); map.put((K) key, value); return value; } return map.get(key); }
/** * @see Transformer#transform(Object) */ @Override public Number transform(VEPair<V, E> arg0) { return delegate.transform(arg0.getE()); }
/** * Returns a <code>Rectangle2D</code> whose width and height are defined by * this instance's size and aspect ratio functions for this vertex. */ public Rectangle2D getRectangle(V v) { float width = vsf.transform(v); float height = width * varf.transform(v); float h_offset = -(width / 2); float v_offset = -(height / 2); theRectangle.setFrame(h_offset, v_offset, width, height); return (Rectangle2D) theRectangle.clone(); }
public String transform(String s) { final Transformer<String, String> transformer = createTransformer(); if (transformer == null) return null; return transformer.transform(s); } };