And.java org::apache::iceberg::expressions::And org::apache::iceberg::expressions /* *LicensedtotheApacheSoftwareFoundation(ASF)underone *ormorecontributorlicenseagreements.SeetheNOTICEfile *distributedwiththisworkforadditionalinformation *regardingcopyrightownership.TheASFlicensesthisfile *toyouundertheApacheLicense,Version2.0(the *"License");youmaynotusethisfileexceptincompliance *withtheLicense.YoumayobtainacopyoftheLicenseat * *http://www.apache.org/licenses/LICENSE-2.0 * *Unlessrequiredbyapplicablelaworagreedtoinwriting, *softwaredistributedundertheLicenseisdistributedonan *"ASIS"BASIS,WITHOUTWARRANTIESORCONDITIONSOFANY *KIND,eitherexpressorimplied.SeetheLicenseforthe *specificlanguagegoverningpermissionsandlimitations *undertheLicense. */ packageorg.apache.iceberg.expressions; publicclassAndimplementsExpression{ privatefinalExpressionleft; privatefinalExpressionright; And(Expressionleft,Expressionright){ this.left=left; this.right=right; } publicExpressionleft(){ returnleft; } publicExpressionright(){ returnright; } @Override publicOperationop(){ returnExpression.Operation.AND; } @Override publicbooleanisEquivalentTo(Expressionexpr){ if(expr.op()==Operation.AND){ Andother=(And)expr; return(left.isEquivalentTo(other.left())&&right.isEquivalentTo(other.right())) ||(left.isEquivalentTo(other.right())&&right.isEquivalentTo(other.left())); } returnfalse; } @Override publicExpressionnegate(){ //not(and(a,b))=>or(not(a),not(b)) returnExpressions.or(left.negate(),right.negate()); } @Override publicStringtoString(){ returnString.format("(%sand%s)",left,right); } }