- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {OutputStreamWriter o =
OutputStream out;new OutputStreamWriter(out)
OutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
HttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
- Smart code suggestions by Codota
}
/** * Add an arbitrary pipe to the GremlinPipeline * * @param pipe the pipe to add to the pipeline * @param <T> the type of the end of the pipe * @return the extended Pipeline */ public <T> GremlinPipeline<S, T> add(final Pipe<?, T> pipe) { this.addPipe(pipe); return (GremlinPipeline<S, T>) this; }
public static GremlinPipeline optimizePipelineForQuery(final GremlinPipeline pipeline, final Pipe pipe) { if (!optimizePipelineForGraphQuery(pipeline, pipe)) if (!optimizePipelineForVertexQuery(pipeline, pipe)) pipeline.addPipe(pipe); return pipeline; }
queryPipe.setHighRange(((RangeFilterPipe) pipe).getHighRange()); pipeline.addPipe(new IdentityPipe()); return true; } else {
private static boolean optimizePipelineForGraphQuery(final GremlinPipeline pipeline, final Pipe pipe) { GraphQueryPipe queryPipe = null; for (int i = pipeline.size() - 1; i > 0; i--) { final Pipe temp = pipeline.get(i); if (temp instanceof GraphQueryPipe) { queryPipe = (GraphQueryPipe) temp; break; } else if (!(temp instanceof IdentityPipe)) break; } if (null != queryPipe) { if (pipe instanceof PropertyFilterPipe) { final PropertyFilterPipe temp = (PropertyFilterPipe) pipe; queryPipe.addHasContainer(new QueryPipe.HasContainer(temp.getKey(), temp.getPredicate(), temp.getValue())); } else if (pipe instanceof IntervalFilterPipe) { final IntervalFilterPipe temp = (IntervalFilterPipe) pipe; queryPipe.addIntervalContainer(new QueryPipe.IntervalContainer(temp.getKey(), temp.getStartValue(), temp.getEndValue())); } else if (pipe instanceof RangeFilterPipe) { queryPipe.setLowRange(((RangeFilterPipe) pipe).getLowRange()); queryPipe.setHighRange(((RangeFilterPipe) pipe).getHighRange()); } pipeline.addPipe(new IdentityPipe()); return true; } else { return false; } } }