Series a = new Series() Array chartData = [] for (var i = 0; i < 4; i++) { chartData.add(a); -- some modifications on a --- }
/** * Returns the modifiable series of scheme parameters. Creates a new * instance if no one has been set. * * @return The modifiable series of scheme parameters. */ public Series<Parameter> getParameters() { if (this.parameters == null) { this.parameters = new Series<Parameter>(Parameter.class); } return this.parameters; }
/** * Returns the list of disposition parameters. * * @return The list of disposition parameters. */ public Series<Parameter> getParameters() { if (this.parameters == null) { this.parameters = new Series<Parameter>(Parameter.class); } return this.parameters; }
private final Series series = new Series(); ... series.getData().add(new Data(sb.toString(), nbAnswersForProposal)); ... barChart.getData().addAll(series);
/** * Returns the list of disposition parameters. * * @return The list of disposition parameters. */ public Series<Parameter> getParameters() { if (this.parameters == null) { this.parameters = new Series<Parameter>(Parameter.class); } return this.parameters; }
/** * Constructor. * * @param logger * The logger instance of use. */ public Context(Logger logger) { this.attributes = new ConcurrentHashMap<String, Object>(); this.logger = logger; this.parameters = new Series<Parameter>(Parameter.class, new CopyOnWriteArrayList<Parameter>()); this.defaultVerifier = null; }
Series<Header> responseHeaders = (Series<Header>) response.getAttributes().get(HeaderConstants.ATTRIBUTE_HEADERS); if (responseHeaders == null) { responseHeaders = new Series(Header.class); response.getAttributes().put( HeaderConstants.ATTRIBUTE_HEADERS, responseHeaders); } responseHeaders.add(new Header("X-MyHeader", "value"));
ObjectInputStream ois = new ObjectInputStream(new FileInputStream("series.ser")); while(ois.available() != 0) { Series series = new Series(); series = (Series) ois.readObject();
/** * Returns an unmodifiable view of the specified series. Attempts to call a * modification method will throw an UnsupportedOperationException. * * @param series * The series for which an unmodifiable view should be returned. * @return The unmodifiable view of the specified series. */ @SuppressWarnings({ "unchecked", "rawtypes" }) public static Series<? extends NamedValue> unmodifiableSeries( final Series<? extends NamedValue> series) { return new Series(series.entryClass, java.util.Collections.unmodifiableList(series.getDelegate())); }
/** * Returns an unmodifiable view of the specified series. Attempts to call a * modification method will throw an UnsupportedOperationException. * * @param series * The series for which an unmodifiable view should be returned. * @return The unmodifiable view of the specified series. */ @SuppressWarnings({ "unchecked", "rawtypes" }) public static Series<? extends NamedValue> unmodifiableSeries( final Series<? extends NamedValue> series) { return new Series(series.entryClass, java.util.Collections.unmodifiableList(series.getDelegate())); }
/** * Returns a view of the portion of this list between the specified * fromIndex, inclusive, and toIndex, exclusive. * * @param fromIndex * The start position. * @param toIndex * The end position (exclusive). * @return The sub-list. */ @Override public Series<T> subList(int fromIndex, int toIndex) { return new Series<T>(this.entryClass, getDelegate().subList(fromIndex, toIndex)); }
/** * Returns a view of the portion of this list between the specified * fromIndex, inclusive, and toIndex, exclusive. * * @param fromIndex * The start position. * @param toIndex * The end position (exclusive). * @return The sub-list. */ @Override public Series<T> subList(int fromIndex, int toIndex) { return new Series<T>(this.entryClass, getDelegate().subList(fromIndex, toIndex)); }
public class Factorial{ public static void main(String args[]){ Scanner x = new Scanner(System.in); System.out.println("Enter a number: "); int number = x.nextInt(); Series s=new Series(number); s.print(); x.close(); }
private void addHeaderAttribute(ClientResource clientResource, String attrName, String attrValue) { ConcurrentMap<String, Object> attrs = clientResource.getRequest().getAttributes(); Series<Header> headers = (Series<Header>) attrs.get(HeaderConstants.ATTRIBUTE_HEADERS); if (headers == null) { headers = new Series<>(Header.class); Series<Header> prev = (Series<Header>) attrs.putIfAbsent(HeaderConstants.ATTRIBUTE_HEADERS, headers); if (prev != null) { headers = prev; } } headers.add(attrName, attrValue); }
XYChart chart = new AreaChart(); Series series = new Series(); chart.getData().add(series); Node fill = series.getNode().lookup(".chart-series-area-fill"); // only for AreaChart Node line = series.getNode().lookup(".chart-series-area-line"); Color color = Color.RED; // or any other color String rgb = String.format("%d, %d, %d", (int) (color.getRed() * 255), (int) (color.getGreen() * 255), (int) (color.getBlue() * 255)); fill.setStyle("-fx-fill: rgba(" + rgb + ", 0.15);"); line.setStyle("-fx-stroke: rgba(" + rgb + ", 1.0);");
/** * Creates the media type of a multipart form which must include the used * boundary. * * @param boundary * The multipart boundary. * @return The multipart media type. */ private static MediaType createMultipartMediaType(String boundary) { Series<Parameter> params = new Series<Parameter>(Parameter.class); params.add("boundary", boundary); MediaType result = new MediaType( MediaType.MULTIPART_FORM_DATA.getName(), params); return result; }
/** * Copies the headers of the given {@link Response} into the given {@link Series}. * * @param restletResponse * The response to update. Should contain a {@link Representation} to copy the representation headers * from * it. * @return The copied headers. */ public static Series<Header> copyResponseHeaders(Response restletResponse) { Series<Header> headers = new Series<Header>(Header.class); HeaderUtils.addResponseHeaders(restletResponse, headers); HeaderUtils.addEntityHeaders(restletResponse.getEntity(), headers); return headers; }
private void addCookieParam(Request request, String representationAsText, Annotation annotation) { Series<Cookie> cookies = request.getCookies(); if (cookies == null) { cookies = new Series<Cookie>(Cookie.class); } cookies.add(new Cookie(((CookieParam) annotation).value(), representationAsText)); request.setCookies(cookies); }
/** * Returns the helped Restlet parameters. * * @return The helped Restlet parameters. */ public Series<Parameter> getHelpedParameters() { Series<Parameter> result = null; if ((getHelped() != null) && (getHelped().getContext() != null)) { result = getHelped().getContext().getParameters(); } else { result = new Series<Parameter>(Parameter.class); } return result; }
/** * Test method for {@link org.restlet.security.Realm#setParameters(org.restlet.util.Series)}. */ @Test public final void testSetParameters() { Assert.assertEquals(0, this.testRealm.getParameters().size()); final List<Parameter> list = new ArrayList<Parameter>(1); list.add(new Parameter("testName", "123")); this.testRealm.setParameters(new Series<Parameter>(Parameter.class, list)); Assert.assertEquals(1, this.testRealm.getParameters().size()); final Parameter parameter = this.testRealm.getParameters().get(0); Assert.assertEquals("testName", parameter.getName()); Assert.assertEquals("123", parameter.getValue()); }