Example usage for org.apache.commons.lang3 ArrayUtils EMPTY_INTEGER_OBJECT_ARRAY

List of usage examples for org.apache.commons.lang3 ArrayUtils EMPTY_INTEGER_OBJECT_ARRAY

Introduction

In this page you can find the example usage for org.apache.commons.lang3 ArrayUtils EMPTY_INTEGER_OBJECT_ARRAY.

Prototype

Integer[] EMPTY_INTEGER_OBJECT_ARRAY

To view the source code for org.apache.commons.lang3 ArrayUtils EMPTY_INTEGER_OBJECT_ARRAY.

Click Source Link

Document

An empty immutable Integer array.

Usage

From source file:com.github.xbn.array.helper.NewPrimitiveArrayHelper.java

public Integer[] getEmpty() {
    return ArrayUtils.EMPTY_INTEGER_OBJECT_ARRAY;
}

From source file:org.apache.flink.table.runtime.functions.SqlLikeChainChecker.java

public SqlLikeChainChecker(String pattern) {
    final StringTokenizer tokens = new StringTokenizer(pattern, "%");
    final boolean leftAnchor = !pattern.startsWith("%");
    final boolean rightAnchor = !pattern.endsWith("%");
    int len = 0;//from  w  ww  . ja  va  2s.  c o  m
    // at least 2 checkers always
    BinaryString leftPattern = null;
    BinaryString rightPattern = null;
    int leftLen = 0; // not -1
    int rightLen = 0; // not -1
    final List<BinaryString> middleCheckers = new ArrayList<>(2);
    final List<Integer> lengths = new ArrayList<>(2);

    for (int i = 0; tokens.hasMoreTokens(); i++) {
        String chunk = tokens.nextToken();
        if (chunk.length() == 0) {
            // %% is folded in the .*?.*? regex usually into .*?
            continue;
        }
        len += utf8Length(chunk);
        if (leftAnchor && i == 0) {
            // first item
            leftPattern = fromString(chunk);
            leftLen = utf8Length(chunk);
        } else if (rightAnchor && !tokens.hasMoreTokens()) {
            // last item
            rightPattern = fromString(chunk);
            rightLen = utf8Length(chunk);
        } else {
            // middle items in order
            middleCheckers.add(fromString(chunk));
            lengths.add(utf8Length(chunk));
        }
    }
    midLens = ArrayUtils.toPrimitive(lengths.toArray(ArrayUtils.EMPTY_INTEGER_OBJECT_ARRAY));
    middlePatterns = middleCheckers.toArray(new BinaryString[0]);
    minLen = len;
    beginPattern = leftPattern;
    endPattern = rightPattern;
    beginLen = leftLen;
    endLen = rightLen;
}