<commit_before>/***************************************************************************
 *   Copyright 2009 (C) by <NAME>                                     *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU Library General Public License as       *
 *   published by the Free Software Foundation; either version 2 of the    *
 *   License, or (at your option) any later version.                       *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU Library General Public     *
 *   License along with this program; if not, write to the                 *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 *                                                                         *
 *   For details about the authors of this software, see the AUTHORS file. *
 ***************************************************************************/

package jolie.runtime;

/**
 * A CompareOperator performs some kind of boolean comparison between two values.
 * @author <NAME>
 */
public enum CompareOperator
{
	EQUAL {
		public final boolean evaluate( Value left, Value right ) {
			return left.equals( right );
		}
	}, NOT_EQUAL {
		public final boolean evaluate( Value left, Value right ) {
			return EQUAL.evaluate( left, right ) == false;
		}
	}, MINOR {
		public final boolean evaluate( Value left, Value right ) {
			if ( left.isDouble() ) {
				return ( left.doubleValue() < right.doubleValue() );
			} else {
				return ( left.intValue() < right.intValue() );
			}
		}
	}, MAJOR {
		public final boolean evaluate( Value left, Value right ) {
			if ( left.isDouble() ) {
				return ( left.doubleValue() > right.doubleValue() );
			} else {
				return ( left.intValue() > right.intValue() );
			}
		}
	}, MINOR_OR_EQUAL {
		public final boolean evaluate( Value left, Value right ) {
			if ( left.isDouble() ) {
				return ( left.doubleValue() <= right.doubleValue() );
			} else {
				return ( left.intValue() <= right.intValue() );
			}
		}
	}, MAJOR_OR_EQUAL {
		public final boolean evaluate( Value left, Value right ) {
			if ( left.isDouble() ) {
				return ( left.doubleValue() >= right.doubleValue() );
			} else {
				return ( left.intValue() >= right.intValue() );
			}
		}
	};

	public abstract boolean evaluate( Value left, Value right );
}<commit_msg>bug fix,  type checking of long missed<commit_after>/***************************************************************************
 *   Copyright 2009 (C) by <NAME>                                     *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU Library General Public License as       *
 *   published by the Free Software Foundation; either version 2 of the    *
 *   License, or (at your option) any later version.                       *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU Library General Public     *
 *   License along with this program; if not, write to the                 *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 *                                                                         *
 *   For details about the authors of this software, see the AUTHORS file. *
 ***************************************************************************/

package jolie.runtime;

/**
 * A CompareOperator performs some kind of boolean comparison between two values.
 * @author <NAME>
 */
public enum CompareOperator
{
	EQUAL {
		public final boolean evaluate( Value left, Value right ) {
			return left.equals( right );
		}
	}, NOT_EQUAL {
		public final boolean evaluate( Value left, Value right ) {
			return EQUAL.evaluate( left, right ) == false;
		}
	}, MINOR {
		public final boolean evaluate( Value left, Value right ) {
			if ( left.isDouble() ) {
				return ( left.doubleValue() < right.doubleValue() );
			} if ( left.isLong() ) {
                                return ( left.longValue() < right.longValue() );
                        } else {
				return ( left.intValue() < right.intValue() );
			}
		}
	}, MAJOR {
		public final boolean evaluate( Value left, Value right ) {
			if ( left.isDouble() ) {
				return ( left.doubleValue() > right.doubleValue() );
			} if ( left.isLong() ) {
                                return ( left.longValue() > right.longValue() );
                        } else {
				return ( left.intValue() > right.intValue() );
			}
		}
	}, MINOR_OR_EQUAL {
		public final boolean evaluate( Value left, Value right ) {
			if ( left.isDouble() ) {
				return ( left.doubleValue() <= right.doubleValue() );
			} if ( left.isLong() ) {
                                return ( left.longValue() <= right.longValue() );
                        } else {
				return ( left.intValue() <= right.intValue() );
			}
		}
	}, MAJOR_OR_EQUAL {
		public final boolean evaluate( Value left, Value right ) {
			if ( left.isDouble() ) {
				return ( left.doubleValue() >= right.doubleValue() );
			} if ( left.isLong() ) {
                                return ( left.longValue() >= right.longValue() );
                        } else {
				return ( left.intValue() >= right.intValue() );
			}
		}
	};

	public abstract boolean evaluate( Value left, Value right );
}
{'fraction_non_alphanumeric': 0.13938087170799324, 'fraction_numerical': 0.005852456491606346, 'mean_word_length': 1.7103505843071787, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 28, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5991251', 'n_tokens_mistral': 1723, 'n_tokens_neox': 1527, 'n_words': 540}