ttomcat-1778514358873.zip-extract/_dependencies/maven/com.h2database_h2-2.2.220/org/h2/value/ValueCollectionBase.java

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

      
    
Rootfs path

      
    
Size
3179 (3.1 KB)
MD5
0a70bb8f7004170e5a80664f32270d5d
SHA1
1ecf76f3846bdc3f8852834f3e4d177f4a407c0c
SHA256
99c50b023d3c0f471cb84c3ab0ce4fec027f90a44de187fa7e63256115424901
SHA512

      
    
SHA1_git
492ba0d49e88c77ff7318ebd8e23914cd9e2921f
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
ValueCollectionBase.java | 3.1 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.value; import org.h2.api.ErrorCode; import org.h2.engine.CastDataProvider; import org.h2.engine.Constants; import org.h2.message.DbException; /** * Base class for ARRAY and ROW values. */ public abstract class ValueCollectionBase extends Value { /** * Values. */ final Value[] values; private int hash; ValueCollectionBase(Value[] values) { this.values = values; } public Value[] getList() { return values; } @Override public int hashCode() { if (hash != 0) { return hash; } int h = getValueType(); for (Value v : values) { h = h * 31 + v.hashCode(); } hash = h; return h; } @Override public int compareWithNull(Value v, boolean forEquality, CastDataProvider provider, CompareMode compareMode) { if (v == ValueNull.INSTANCE) { return Integer.MIN_VALUE; } ValueCollectionBase l = this; int leftType = l.getValueType(); int rightType = v.getValueType(); if (rightType != leftType) { throw v.getDataConversionError(leftType); } ValueCollectionBase r = (ValueCollectionBase) v; Value[] leftArray = l.values, rightArray = r.values; int leftLength = leftArray.length, rightLength = rightArray.length; if (leftLength != rightLength) { if (leftType == ROW) { throw DbException.get(ErrorCode.COLUMN_COUNT_DOES_NOT_MATCH); } if (forEquality) { return 1; } } if (forEquality) { boolean hasNull = false; for (int i = 0; i < leftLength; i++) { Value v1 = leftArray[i]; Value v2 = rightArray[i]; int comp = v1.compareWithNull(v2, forEquality, provider, compareMode); if (comp != 0) { if (comp != Integer.MIN_VALUE) { return comp; } hasNull = true; } } return hasNull ? Integer.MIN_VALUE : 0; } int len = Math.min(leftLength, rightLength); for (int i = 0; i < len; i++) { Value v1 = leftArray[i]; Value v2 = rightArray[i]; int comp = v1.compareWithNull(v2, forEquality, provider, compareMode); if (comp != 0) { return comp; } } return Integer.compare(leftLength, rightLength); } @Override public boolean containsNull() { for (Value v : values) { if (v.containsNull()) { return true; } } return false; } @Override public int getMemory() { int memory = 72 + values.length * Constants.MEMORY_POINTER; for (Value v : values) { memory += v.getMemory(); } return memory; } }
Detected license expression

      
    
Detected license expression (SPDX)

      
    
Percentage of license text
3.74
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