ttomcat-1778514358873.zip-extract/_dependencies/maven/com.h2database_h2-2.2.220/org/h2/expression/UnaryOperation.java

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

      
    
Rootfs path

      
    
Size
1573 (1.5 KB)
MD5
62473af0f8bcc73beb8cc89f9d6937b6
SHA1
154bc031f7365eb229a16ffbe6bc164215bd582e
SHA256
f39d249f46c6e9464fd9d511bab85bd8a4867051b01d4d2e9bcf5ce919b830e6
SHA512

      
    
SHA1_git
145e8e2aba91af7c3dcd3e401c1775d5e632d10f
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
UnaryOperation.java | 1.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.expression; import org.h2.engine.SessionLocal; import org.h2.value.TypeInfo; import org.h2.value.Value; import org.h2.value.ValueNull; /** * Unary operation. Only negation operation is currently supported. */ public class UnaryOperation extends Operation1 { public UnaryOperation(Expression arg) { super(arg); } @Override public boolean needParentheses() { return true; } @Override public StringBuilder getUnenclosedSQL(StringBuilder builder, int sqlFlags) { // don't remove the space, otherwise it might end up some thing like // --1 which is a line remark return arg.getSQL(builder.append("- "), sqlFlags, AUTO_PARENTHESES); } @Override public Value getValue(SessionLocal session) { Value a = arg.getValue(session).convertTo(type, session); return a == ValueNull.INSTANCE ? a : a.negate(); } @Override public Expression optimize(SessionLocal session) { arg = arg.optimize(session); type = arg.getType(); if (type.getValueType() == Value.UNKNOWN) { type = TypeInfo.TYPE_NUMERIC_FLOATING_POINT; } else if (type.getValueType() == Value.ENUM) { type = TypeInfo.TYPE_INTEGER; } if (arg.isConstant()) { return ValueExpression.get(getValue(session)); } return this; } }
Detected license expression
mpl-2.0 AND epl-1.0
Detected license expression (SPDX)
MPL-2.0 AND EPL-1.0
Percentage of license text
5.56
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 detections License expression License expression SPDX
mpl_2_0_and_epl_1_0-796bf8d7-f485-3520-923d-e6a4b1ecd2f3 mpl-2.0 AND epl-1.0 MPL-2.0 AND EPL-1.0
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