All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.dmd.dmc.types.LongVar Maven / Gradle / Ivy

Go to download

The dark-matter project provides mechanism to define concepts associated with Domain Specific Languages (DSLs) and generate code that can be extended with business logic that supports the given DSL purpose.

There is a newer version: 3.1.15
Show newest version
//	---------------------------------------------------------------------------
//	dark-matter-data
//	Copyright (c) 2018 dark-matter-data committers
//	---------------------------------------------------------------------------
//	This program 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 3 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 Lesser General Public License for
//	more details.
//	You should have received a copy of the GNU Lesser General Public License along
//	with this program; if not, see .
//	---------------------------------------------------------------------------
package org.dmd.dmc.types;

/**
 * The LongVar class provides for the storage of a integer value that can be
 * changed. This allows for a reference to an integer to be passed and alterred.
 * It also allows for the alteration of an integer value object without having
 * to create a new Long.
 */

public class LongVar implements Comparable {

    private long   val;

    /**
      * Creates a new integer with a val of 0.
      */
    public LongVar() {
        val = 0;
    }

    /**
      * Creates a new integer with the specified value.
      */
    public LongVar(long i) {
        val = i;
    }

    /**
      * Creates a new integer with the specified value.
      */
    public LongVar(Long i) {
        val = i.longValue();
    }

    /**
     * Compares this object to another LongVar.
     */
    public int compareTo(LongVar i){
        long anotherVal = i.val;
        return (val