org.restlet.util.Series.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(8.1k)|赞(0)|评价(0)|浏览(131)

本文整理了Java中org.restlet.util.Series.<init>()方法的一些代码示例,展示了Series.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Series.<init>()方法的具体详情如下:
包路径:org.restlet.util.Series
类名称:Series
方法名:<init>

Series.<init>介绍

[英]Constructor.
[中]建造师。

代码示例

代码示例来源:origin: stackoverflow.com

Series a = new Series()
Array chartData = []
for (var i = 0; i < 4; i++) {
  chartData.add(a);
  -- some modifications on a ---
}

代码示例来源:origin: org.restlet.osgi/org.restlet

/**
 * 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;
}

代码示例来源:origin: org.restlet.osgi/org.restlet

/**
 * 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;
}

代码示例来源:origin: stackoverflow.com

private final Series series = new Series();
...
series.getData().add(new Data(sb.toString(), nbAnswersForProposal));
...
barChart.getData().addAll(series);

代码示例来源:origin: DeviceConnect/DeviceConnect-Android

/**
 * 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;
}

代码示例来源:origin: DeviceConnect/DeviceConnect-Android

/**
 * 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;
}

代码示例来源:origin: stackoverflow.com

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"));

代码示例来源:origin: stackoverflow.com

ObjectInputStream ois = new ObjectInputStream(new FileInputStream("series.ser"));
   while(ois.available() != 0) {
     Series series = new Series();
     series = (Series) ois.readObject();

代码示例来源:origin: org.restlet.osgi/org.restlet

/**
 * 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()));
}

代码示例来源:origin: DeviceConnect/DeviceConnect-Android

/**
 * 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()));
}

代码示例来源:origin: org.restlet.osgi/org.restlet

/**
 * 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));
}

代码示例来源:origin: DeviceConnect/DeviceConnect-Android

/**
 * 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));
}

代码示例来源:origin: stackoverflow.com

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();
}

代码示例来源:origin: jtalks-org/jcommune

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);
}

代码示例来源:origin: stackoverflow.com

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);");

代码示例来源:origin: org.restlet.jse/org.restlet.ext.html

/**
 * 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;
}

代码示例来源:origin: org.restlet.jee/org.restlet.ext.jaxrs

/**
 * 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;
}

代码示例来源:origin: org.restlet.jee/org.restlet.ext.jaxrs

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);
}

代码示例来源:origin: org.restlet.osgi/org.restlet

/**
 * 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;
}

代码示例来源:origin: com.github.ansell.restlet-utils/restlet-utils

/**
 * 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());
}

相关文章