<commit_before>/***
 * Image/J Plugins
 * Copyright (C) 2002 <NAME>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * Latest release available at http://sourceforge.net/projects/ij-plugins/
 */
package net.sf.ij_plugins.im3d;

/**
 * Represents a 3D point.
 *
 * @author <NAME>
 * @since April 29, 2002
 */
public class Point3DInt {
    /**
     * x coordinate.
     */
    public int x;
    /**
     * y coordinate.
     */
    public int y;
    /**
     * z coordinate.
     */
    public int z;


    /**
     * Constructor for the Point3D object
     */
    public Point3DInt() {
    }


    /**
     * Constructor for the Point3D object
     *
     * @param x x coordinate.
     * @param y y coordinate.
     * @param z z coordinate.
     */
    public Point3DInt(int x, int y, int z) {
        this.x = x;
        this.y = y;
        this.z = z;
    }


    /**
     * Returns a string representing Point3D coordinates: (x,y,z).
     *
     * @return String representing Point3D coordinates.
     */
    @Override
    public String toString() {
        return "(" + x + "," + y + "," + z + ")";
    }
}<commit_msg>Implement Comparable interface for Point3DInt.<commit_after>/*
 * Image/J Plugins
 * Copyright (C) 2002-2009 <NAME>
 * Author's email: jsacha at users dot sourceforge dot net
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * Latest release available at http://sourceforge.net/projects/ij-plugins/
 */
package net.sf.ij_plugins.im3d;

/**
 * Represents a 3D point.
 *
 * @author <NAME>
 * @since April 29, 2002
 */
final public class Point3DInt implements Comparable<Point3DInt> {
    /**
     * x coordinate.
     */
    public int x;
    /**
     * y coordinate.
     */
    public int y;
    /**
     * z coordinate.
     */
    public int z;


    /**
     * Constructor for the Point3D object
     */
    public Point3DInt() {
    }


    /**
     * Constructor for the Point3D object
     *
     * @param x x coordinate.
     * @param y y coordinate.
     * @param z z coordinate.
     */
    public Point3DInt(final int x, final int y, final int z) {
        this.x = x;
        this.y = y;
        this.z = z;
    }


    /**
     * Returns a string representing Point3D coordinates: (x,y,z).
     *
     * @return String representing Point3D coordinates.
     */
    @Override
    public String toString() {
        return "(" + x + "," + y + "," + z + ")";
    }

    @Override
    public boolean equals(final Object obj) {
        return obj instanceof Point3DInt && compareTo((Point3DInt) obj) == 0;
    }


    public int compareTo(final Point3DInt p) {
        if (p == null) {
            throw new IllegalArgumentException("Argument 'p' cannot be null.");
        }

        if (x < p.x) {
            return -1;
        } else if (x > p.x) {
            return 1;
        } else if (y < p.y) {
            return -1;
        } else if (y > p.y) {
            return 1;
        } else if (z < p.z) {
            return -1;
        } else if (z > p.z) {
            return 1;
        } else {
            return 0;
        }
    }
}
{'fraction_non_alphanumeric': 0.10300718132854578, 'fraction_numerical': 0.01952423698384201, 'mean_word_length': 2.101600556715379, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '358460', 'n_tokens_mistral': 1369, 'n_tokens_neox': 1297, 'n_words': 516}