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

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

      
    
Rootfs path

      
    
Size
4601 (4.5 KB)
MD5
5f5bdac91245724625fbbaf8c86fdaf6
SHA1
6768848954ee3ed4f9150aba9bd3eed5a113c095
SHA256
e52e3f3daca3c3fa8453f47c40287ee0866332771a3f5b5f7ceb17b6a9b8c00f
SHA512

      
    
SHA1_git
cf9a4de1552105b203aa745f8f9204a000f3d78c
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
ValueRow.java | 4.5 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; import org.h2.result.SimpleResult; /** * Row value. */ public final class ValueRow extends ValueCollectionBase { /** * Empty row. */ public static final ValueRow EMPTY = get(Value.EMPTY_VALUES); private TypeInfo type; private ValueRow(TypeInfo type, Value[] list) { super(list); int degree = list.length; if (degree > Constants.MAX_COLUMNS) { throw DbException.get(ErrorCode.TOO_MANY_COLUMNS_1, "" + Constants.MAX_COLUMNS); } if (type != null) { if (type.getValueType() != ROW || ((ExtTypeInfoRow) type.getExtTypeInfo()).getFields().size() != degree) { throw DbException.getInternalError(); } this.type = type; } } /** * Get or create a row value for the given value array. * Do not clone the data. * * @param list the value array * @return the value */ public static ValueRow get(Value[] list) { return new ValueRow(null, list); } /** * Get or create a typed row value for the given value array. * Do not clone the data. * * @param extTypeInfo the extended data type information * @param list the value array * @return the value */ public static ValueRow get(ExtTypeInfoRow extTypeInfo, Value[] list) { return new ValueRow(new TypeInfo(ROW, -1, -1, extTypeInfo), list); } /** * Get or create a typed row value for the given value array. * Do not clone the data. * * @param typeInfo the data type information * @param list the value array * @return the value */ public static ValueRow get(TypeInfo typeInfo, Value[] list) { return new ValueRow(typeInfo, list); } @Override public TypeInfo getType() { TypeInfo type = this.type; if (type == null) { this.type = type = TypeInfo.getTypeInfo(Value.ROW, 0, 0, new ExtTypeInfoRow(values)); } return type; } @Override public int getValueType() { return ROW; } @Override public String getString() { StringBuilder builder = new StringBuilder("ROW ("); for (int i = 0; i < values.length; i++) { if (i > 0) { builder.append(", "); } builder.append(values[i].getString()); } return builder.append(')').toString(); } public SimpleResult getResult() { SimpleResult result = new SimpleResult(); for (int i = 0, l = values.length; i < l;) { Value v = values[i++]; result.addColumn("C" + i, v.getType()); } result.addRow(values); return result; } @Override public int compareTypeSafe(Value o, CompareMode mode, CastDataProvider provider) { ValueRow v = (ValueRow) o; if (values == v.values) { return 0; } int len = values.length; if (len != v.values.length) { throw DbException.get(ErrorCode.COLUMN_COUNT_DOES_NOT_MATCH); } for (int i = 0; i < len; i++) { Value v1 = values[i]; Value v2 = v.values[i]; int comp = v1.compareTo(v2, provider, mode); if (comp != 0) { return comp; } } return 0; } @Override public StringBuilder getSQL(StringBuilder builder, int sqlFlags) { builder.append("ROW ("); int length = values.length; for (int i = 0; i < length; i++) { if (i > 0) { builder.append(", "); } values[i].getSQL(builder, sqlFlags); } return builder.append(')'); } @Override public boolean equals(Object other) { if (!(other instanceof ValueRow)) { return false; } ValueRow v = (ValueRow) other; if (values == v.values) { return true; } int len = values.length; if (len != v.values.length) { return false; } for (int i = 0; i < len; i++) { if (!values[i].equals(v.values[i])) { return false; } } return true; } }
Detected license expression

      
    
Detected license expression (SPDX)

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