Java List Subtract subtract(final List result, final Object o1, final Object o2)

Here you can find the source of subtract(final List result, final Object o1, final Object o2)

Description

subtract

License

Apache License

Declaration

private static void subtract(final List<Double> result, final Object o1, final Object o2) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright 2015/* w  w  w. j  ava  2  s  . c om*/
 * Ubiquitous Knowledge Processing (UKP) Lab
 * Technische Universit?t Darmstadt
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 ******************************************************************************/

import java.util.List;

public class Main {
    private static void subtract(final List<Double> result, final Object o1, final Object o2) {
        final Number val1 = (Number) o1;
        final Number val2 = (Number) o2;

        result.add(val1.doubleValue() - val2.doubleValue());
    }
}

Related

  1. subtract(final List list1, final List list2)
  2. subtract(final List list1, final List list2)
  3. subtract(final String[] input, final String[] list)
  4. subtract(List a, List b)
  5. subtract(List vector, int[] sparseVector)
  6. subtract(List a, List b)