<commit_before>package org.nakedobjects.object.persistence.defaults;


import org.nakedobjects.object.persistence.Oid;

import java.io.Serializable;


public class SerialOid implements Oid, Serializable {
    private final long serialNo;
   
    public SerialOid(long serialNo) {
        this.serialNo = serialNo;
    }
    
    public boolean equals(Object obj) {
        if (obj == this) {
            return true;
        }
        if (obj instanceof SerialOid) {
            return ((SerialOid) obj).serialNo == serialNo;
        }
        return false;
    }

     public long getSerialNo() {
        return serialNo;
    }

    public int hashCode() {
        return 37 * 17 + (int) (serialNo ^ (serialNo >>> 32));
    }

    public String toString() {
        return "OID#" + Long.toHexString(serialNo).toUpperCase();
    }
}

/*
Naked Objects - a framework that exposes behaviourally complete
business objects directly to the user.
Copyright (C) 2000 - 2005  Naked Objects Group Ltd

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU 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 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<commit_msg>OID interface now requires methods that allow the state of the OID to be changed.<commit_after>package org.nakedobjects.object.persistence.defaults;


import org.nakedobjects.object.persistence.Oid;
import org.nakedobjects.utility.Assert;

import java.io.Serializable;


public class SerialOid implements Oid, Serializable {
    private long serialNo;
    private SerialOid previous;
   
    public SerialOid(long serialNo) {
        this.serialNo = serialNo;
    }
    
    public boolean equals(Object obj) {
        if (obj == this) {
            return true;
        }
        if (obj instanceof SerialOid) {
            return ((SerialOid) obj).serialNo == serialNo;
        }
        return false;
    }

     public long getSerialNo() {
        return serialNo;
    }

    public int hashCode() {
        return 37 * 17 + (int) (serialNo ^ (serialNo >>> 32));
    }

    public String toString() {
        return "OID#" + Long.toHexString(serialNo).toUpperCase();
    }

    public boolean hasPrevious() {
        return previous != null;
    }

    public Oid getPrevious() {
        return previous;
    }

    public void copyFrom(Oid oid) {
        Assert.assertTrue(oid instanceof SerialOid);
        SerialOid from = (SerialOid) oid;
        this.serialNo = from.serialNo;
    }
    
    public void setPrevious(SerialOid previous) {
        Assert.assertNull(previous);
        this.previous = previous;
    }
}

/*
Naked Objects - a framework that exposes behaviourally complete
business objects directly to the user.
Copyright (C) 2000 - 2005  Naked Objects Group Ltd

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU 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 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
{'fraction_non_alphanumeric': 0.06981467377506982, 'fraction_numerical': 0.014724549378014725, 'mean_word_length': 2.959798994974874, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '6273693', 'n_tokens_mistral': 1109, 'n_tokens_neox': 1039, 'n_words': 440}