예제 #1
0
 private ModelCoordinate createIndexCoordinateWithRemoteUrlHint(String remoteUrl) {
   ModelCoordinate mc =
       new ModelCoordinate(
           INDEX.getGroupId(),
           INDEX.getArtifactId(),
           INDEX.getClassifier(),
           INDEX.getExtension(),
           INDEX.getVersion());
   return createCopyWithRepositoryUrlHint(mc, remoteUrl);
 }
예제 #2
0
 void updateModel(final OperationContext context, ModelNode model, ModelNode listAttribute)
     throws OperationFailedException {
   int index = INDEX.resolveModelAttribute(context, model).asInt();
   if (listAttribute.hasDefined(index)) {
     context.getResult().set(listAttribute.get(index));
   }
 }
예제 #3
0
 void updateModel(final OperationContext context, ModelNode model, ModelNode listAttribute)
     throws OperationFailedException {
   ModelNode value = VALUE.resolveModelAttribute(context, model);
   ModelNode index = INDEX.resolveModelAttribute(context, model);
   List<ModelNode> res = new ArrayList<>(listAttribute.asList());
   if (index.isDefined()) {
     res.remove(index.asInt());
   } else {
     res.remove(value);
   }
   listAttribute.set(res);
 }
예제 #4
0
    void updateModel(final OperationContext context, ModelNode model, ModelNode listAttribute)
        throws OperationFailedException {
      String value = VALUE.resolveModelAttribute(context, model).asString();
      ModelNode indexNode = INDEX.resolveModelAttribute(context, model);

      LinkedList<ModelNode> res =
          new LinkedList<>(
              listAttribute.isDefined()
                  ? listAttribute.asList()
                  : Collections.<ModelNode>emptyList());
      if (indexNode.isDefined()) {
        res.add(indexNode.asInt(), new ModelNode(value));
      } else {
        res.add(new ModelNode(value));
      }
      listAttribute.set(res);
    }
예제 #5
0
 private void addSeriesToPlot(
     int index, XYLineChart xyLineChart, double[] iterations, int series) {
   double[] values = new double[index + 1];
   System.arraycopy(this.history[series], 0, values, 0, index + 1);
   xyLineChart.addSeries(INDEX.values()[series].enName, iterations, values);
 }
예제 #6
0
 private boolean isIndex(ModelCoordinate model) {
   return model.getGroupId().equals(INDEX.getGroupId())
       && model.getArtifactId().equals(INDEX.getArtifactId())
       && model.getExtension().equals(INDEX.getExtension())
       && model.getVersion().equals(INDEX.getVersion());
 }