5046N/A/*
5046N/A * CDDL HEADER START
5046N/A *
5046N/A * The contents of this file are subject to the terms of the
5046N/A * Common Development and Distribution License, Version 1.0 only
5046N/A * (the "License"). You may not use this file except in compliance
5046N/A * with the License.
5046N/A *
5046N/A * You can obtain a copy of the license at
5046N/A * trunk/opends/resource/legal-notices/OpenDS.LICENSE
5046N/A * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
5046N/A * See the License for the specific language governing permissions
5046N/A * and limitations under the License.
5046N/A *
5046N/A * When distributing Covered Code, include this CDDL HEADER in each
5046N/A * file and include the License file at
5046N/A * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
5046N/A * add the following below this CDDL HEADER, with the fields enclosed
5046N/A * by brackets "[]" replaced with your own identifying information:
5046N/A * Portions Copyright [yyyy] [name of copyright owner]
5046N/A *
5046N/A * CDDL HEADER END
5046N/A *
5046N/A *
5046N/A * Copyright 2010 Sun Microsystems, Inc.
5046N/A */
5046N/A
5046N/A
5046N/Aclass CSN implements Comparable<CSN> {
5046N/A
5046N/A String value;
5046N/A
5046N/A public CSN (String value) {
5046N/A this.value = value;
5046N/A }
5046N/A
5046N/A public int compareTo (CSN anotherCSN) {
5046N/A
5046N/A if (this.value.equals(anotherCSN.value)) // same CSN value
5046N/A return 0;
5046N/A
5046N/A Long i = Long.valueOf(this.value.substring(0,12),16 );
5046N/A Long l = Long.valueOf(anotherCSN.value.substring(0,12),16 );
5046N/A
5046N/A return(i.compareTo(l));
5046N/A }
5046N/A
5046N/A public boolean equals(Object anotherCSN) {
5046N/A if (this.value.equals(anotherCSN))
5046N/A return true;
5046N/A else
5046N/A return false;
5046N/A }
5046N/A
5046N/A public String getValue (){
5046N/A return(value);
5046N/A }
5046N/A
5046N/A public String toString (){
5046N/A return(value);
5046N/A }
5046N/A}