ttomcat-1778514358873.zip-extract/_dependencies/maven/com.h2database_h2-2.2.220/org/h2/mode/DefaultNullOrdering.java

Path
ttomcat-1778514358873.zip-extract/_dependencies/maven/com.h2database_h2-2.2.220/org/h2/mode/DefaultNullOrdering.java
Status
scanned
Type
file
Name
DefaultNullOrdering.java
Extension
.java
Programming language
Java
Mime type
text/x-java
File type
Java source, ASCII text
Tag

      
    
Rootfs path

      
    
Size
3249 (3.2 KB)
MD5
87e60e3a6f7ee0780112c00b02d99c53
SHA1
a20c2e14ed72ce12a33ca9901b07ec68cba490be
SHA256
d9d8a53c20cbbec68fdcac5d44fc521af1ba82b72e8ed787652f21a5a5e860bf
SHA512

      
    
SHA1_git
7dfc7dcf8f29bc6cda43f0dc6ba3f5bd36618680
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
DefaultNullOrdering.java | 3.2 KB |

/* * Copyright 2004-2023 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ package org.h2.mode; import static org.h2.result.SortOrder.DESCENDING; import static org.h2.result.SortOrder.NULLS_FIRST; import static org.h2.result.SortOrder.NULLS_LAST; /** * Default ordering of NULL values. */ public enum DefaultNullOrdering { /** * NULL values are considered as smaller than other values during sorting. */ LOW(NULLS_FIRST, NULLS_LAST), /** * NULL values are considered as larger than other values during sorting. */ HIGH(NULLS_LAST, NULLS_FIRST), /** * NULL values are sorted before other values, no matter if ascending or * descending order is used. */ FIRST(NULLS_FIRST, NULLS_FIRST), /** * NULL values are sorted after other values, no matter if ascending or * descending order is used. */ LAST(NULLS_LAST, NULLS_LAST); private static final DefaultNullOrdering[] VALUES = values(); /** * Returns default ordering of NULL values for the specified ordinal number. * * @param ordinal * ordinal number * @return default ordering of NULL values for the specified ordinal number * @see #ordinal() */ public static DefaultNullOrdering valueOf(int ordinal) { return VALUES[ordinal]; } private final int defaultAscNulls, defaultDescNulls; private final int nullAsc, nullDesc; private DefaultNullOrdering(int defaultAscNulls, int defaultDescNulls) { this.defaultAscNulls = defaultAscNulls; this.defaultDescNulls = defaultDescNulls; nullAsc = defaultAscNulls == NULLS_FIRST ? -1 : 1; nullDesc = defaultDescNulls == NULLS_FIRST ? -1 : 1; } /** * Returns a sort type bit mask with {@link org.h2.result.SortOrder#NULLS_FIRST} or * {@link org.h2.result.SortOrder#NULLS_LAST} explicitly set * * @param sortType * sort type bit mask * @return bit mask with {@link org.h2.result.SortOrder#NULLS_FIRST} or {@link org.h2.result.SortOrder#NULLS_LAST} * explicitly set */ public int addExplicitNullOrdering(int sortType) { if ((sortType & (NULLS_FIRST | NULLS_LAST)) == 0) { sortType |= ((sortType & DESCENDING) == 0 ? defaultAscNulls : defaultDescNulls); } return sortType; } /** * Compare two expressions where one of them is NULL. * * @param aNull * whether the first expression is null * @param sortType * the sort bit mask to use * @return the result of the comparison (-1 meaning the first expression * should appear before the second, 0 if they are equal) */ public int compareNull(boolean aNull, int sortType) { if ((sortType & NULLS_FIRST) != 0) { return aNull ? -1 : 1; } else if ((sortType & NULLS_LAST) != 0) { return aNull ? 1 : -1; } else if ((sortType & DESCENDING) == 0) { return aNull ? nullAsc : -nullAsc; } else { return aNull ? nullDesc : -nullDesc; } } }
Detected license expression

      
    
Detected license expression (SPDX)

      
    
Percentage of license text
3.06
Copyrights
- end_line: 2
  copyright: Copyright 2004-2023 H2 Group. Multiple-Licensed
  start_line: 2
Holders
- holder: H2 Group. Multiple-Licensed
  end_line: 2
  start_line: 2
Authors

      
    
License expression License clue details
(mpl-2.0 OR epl-1.0) AND proprietary-license {'score': 20.37, 'matcher': '3-seq', 'end_line': 3, 'rule_url': 'https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/mpl-2.0_or_epl-1.0_and_proprietary-license_2.RULE', 'from_file': None, 'start_line': 2, 'matched_text': ' * Copyright 2004-2023 H2 Group. Multiple-Licensed under the MPL 2.0,\n * and the EPL 1.0 (https://h2database.com/html/license.html).', 'match_coverage': 20.37, 'matched_length': 11, 'rule_relevance': 100, 'rule_identifier': 'mpl-2.0_or_epl-1.0_and_proprietary-license_2.RULE', 'license_expression': '(mpl-2.0 OR epl-1.0) AND proprietary-license', 'license_expression_spdx': '(MPL-2.0 OR EPL-1.0) AND LicenseRef-scancode-proprietary-license'}
URL Start line End line
https://h2database.com/html/license.html 3 3
Package URL License Primary language
pkg:osgi/com.h2database.source@2.2.220