459N/A/*
459N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
459N/A *
721N/A * Copyright (c) 1997-2015 Oracle and/or its affiliates. All rights reserved.
459N/A *
459N/A * The contents of this file are subject to the terms of either the GNU
459N/A * General Public License Version 2 only ("GPL") or the Common Development
459N/A * and Distribution License("CDDL") (collectively, the "License"). You
459N/A * may not use this file except in compliance with the License. You can
459N/A * obtain a copy of the License at
459N/A * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
459N/A * or packager/legal/LICENSE.txt. See the License for the specific
459N/A * language governing permissions and limitations under the License.
459N/A *
459N/A * When distributing the software, include this License Header Notice in each
459N/A * file and include the License file at packager/legal/LICENSE.txt.
459N/A *
459N/A * GPL Classpath Exception:
459N/A * Oracle designates this particular file as subject to the "Classpath"
459N/A * exception as provided by Oracle in the GPL Version 2 section of the License
459N/A * file that accompanied this code.
459N/A *
459N/A * Modifications:
459N/A * If applicable, add the following below the License Header, with the fields
459N/A * enclosed by brackets [] replaced by your own identifying information:
459N/A * "Portions Copyright [year] [name of copyright owner]"
459N/A *
459N/A * Contributor(s):
459N/A * If you wish your version of this file to be governed by only the CDDL or
459N/A * only the GPL Version 2, indicate your decision by adding "[Contributor]
459N/A * elects to include this software in this distribution under the [CDDL or GPL
459N/A * Version 2] license." If you don't indicate a single choice of license, a
459N/A * recipient has the option to distribute your version of this file under
459N/A * either the CDDL, the GPL Version 2 or to extend the choice of license to
459N/A * its licensees as provided above. However, if you add GPL Version 2 code
459N/A * and therefore, elected the GPL Version 2 license, then the option applies
459N/A * only if the new code is made subject to such option by the copyright
459N/A * holder.
459N/A */
459N/A
459N/Apackage com.sun.mail.gimap;
459N/A
459N/Aimport javax.mail.search.SearchTerm;
459N/A
459N/A/**
459N/A * This class implements a long integer search term.
459N/A *
459N/A * @since JavaMail 1.4.6
459N/A * @author Bill Shannon
459N/A */
459N/A
459N/Aabstract class LongTerm extends SearchTerm {
459N/A /**
459N/A * The number.
459N/A *
459N/A * @serial
459N/A */
459N/A protected long number;
459N/A
459N/A private static final long serialVersionUID = 5285147193246128043L;
459N/A
459N/A protected LongTerm(long number) {
459N/A this.number = number;
459N/A }
459N/A
459N/A /**
459N/A * Return the number to compare with.
721N/A *
721N/A * @return the number
459N/A */
459N/A public long getNumber() {
459N/A return number;
459N/A }
459N/A
459N/A protected boolean match(long i) {
459N/A return i == number;
459N/A }
459N/A
459N/A /**
459N/A * Equality comparison.
459N/A */
459N/A public boolean equals(Object obj) {
459N/A if (!(obj instanceof LongTerm))
459N/A return false;
459N/A LongTerm t = (LongTerm)obj;
459N/A return t.number == this.number && super.equals(obj);
459N/A }
459N/A
459N/A /**
459N/A * Compute a hashCode for this object.
459N/A */
459N/A public int hashCode() {
459N/A return (int)number + super.hashCode();
459N/A }
459N/A}