summaryrefslogtreecommitdiffstats
path: root/options/license/Leptonica
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-06-08 08:42:17 +0200
committerGitHub <noreply@github.com>2020-06-08 09:42:17 +0300
commit9749c356565d74da96a071742ac9ad15a1b5e070 (patch)
tree40e256b44c547c157b26cf674d3a87152d21bf08 /options/license/Leptonica
parentfc15e594751d877c14c135f4d963e4dec8f5c2fb (diff)
downloadgitea-1.12.0-rc2.tar.gz
gitea-1.12.0-rc2.zip
Changelog v1.12.0-rc2 (#11799)v1.12.0-rc2
* Update * format * seperate * Update CHANGELOG.md Co-authored-by: techknowlogick <matti@mdranta.net> * Update CHANGELOG.md Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: techknowlogick <matti@mdranta.net> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
Diffstat (limited to 'options/license/Leptonica')
0 files changed, 0 insertions, 0 deletions
lgraphics-fop.git/tree/src/java?h=Temp_PDF_in_PDF&id=75560f958fd85d4ca867b075c297a90ec444d452'>java/org/apache/fop/fo/expr/MinFunction.java
blob: c36f5b194e66ffc250be9a6352182b247473a10e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
 * Copyright 1999-2004 The Apache Software Foundation.
 * 
 * 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.
 */

/* $Id$ */

package org.apache.fop.fo.expr;

import org.apache.fop.datatypes.Numeric;
import org.apache.fop.fo.properties.Property;

/**
 * Class for managing the "min" Number Function. See Sec. 5.10.1 in the XSL-FO
 * standard.
 */
public class MinFunction extends FunctionBase {

    /**
     * @return 2 (the number of arguments required for the min function)
     */
    public int nbArgs() {
        return 2;
    }

    /**
     * Handle "numerics" if no proportional/percent parts
     * @param args array of arguments to be processed
     * @param pInfo PropertyInfo to be processed
     * @return the minimum of the two args elements passed
     * @throws PropertyException for invalid operands
     */
    public Property eval(Property[] args,
                         PropertyInfo pInfo) throws PropertyException {
        Numeric n1 = args[0].getNumeric();
        Numeric n2 = args[1].getNumeric();
        if (n1 == null || n2 == null) {
            throw new PropertyException("Non numeric operands to min function");
        }
        return (Property) NumericOp.min(n1, n2);
       }

}