FileDocCategorySizeDatePackage
LogLSN.javaAPI DocGlassfish v2 API7638Fri May 04 22:36:38 BST 2007com.sun.jts.CosTransactions

LogLSN

public class LogLSN extends Object implements Serializable
A structure containing 2 unsigned integers. extent: the extent file number offset: the offset within the extent file
version
0.01
author
Simon Holdsworth, IBM Corporation
see

Fields Summary
static final LogLSN
HEAD_LSN
Constants for particular LSN values.
static final LogLSN
TAIL_LSN
static final LogLSN
NULL_LSN
static final LogLSN
FIRST_LSN
static final int
SIZEOF
This constant holds the size of the LogRecordEnding object.
int
offset
Internal instance members.
int
extent
Constructors Summary
LogLSN()
Default LogLSN constructor

param
return
see


              
     
        offset = 0;
        extent = 0;
    
LogLSN(int ext, int off)
LogLSN constructor

param
ext Extent for new LSN.
param
off Offset for new LSN.
return
see

        offset = off;
        extent = ext;
    
LogLSN(LogLSN lsn)
LogLSN constructor

param
lsn Other LSN to be copied.
return
see

        offset = lsn.offset;
        extent = lsn.extent;
    
LogLSN(byte[] bytes, int index)
Constructs a LogLSN from the given byte array.

param
bytes The array of bytes from which the LogLSN is to be constructed.
param
index The index in the array where copy is to start.
return
see

        offset =  (bytes[index++]&255) +
            ((bytes[index++]&255) << 8) +
            ((bytes[index++]&255) << 16) +
            ((bytes[index++]&255) << 24);
        extent =  (bytes[index++]&255) +
            ((bytes[index++]&255) << 8) +
            ((bytes[index++]&255) << 16) +
            ((bytes[index++]&255) << 24);
    
Methods Summary
final voidcopy(com.sun.jts.CosTransactions.LogLSN other)
makes the target LSN a copy of the parameter.

param
LogLSN The LSN to be copied.
return
see

        extent = other.extent;
        offset = other.offset;
    
final booleanequals(com.sun.jts.CosTransactions.LogLSN other)
Determines whether the given LSN is equal to the target.

param
other The other LogLSN to be compared.
return
see

        return offset == other.offset && extent == other.extent;
    
final booleangreaterThan(com.sun.jts.CosTransactions.LogLSN other)
Determines whether the target LSN is greater than the parameter.

param
other The other LogLSN to be compared.
return
see

        return ( (offset > other.offset && extent == other.extent) ||
                 extent > other.extent);
    
final booleanisNULL()
Determines whether the target LSN is NULL.

param
return
see

        return offset == 0 && extent == 0;
    
final booleanlessThan(com.sun.jts.CosTransactions.LogLSN other)
Determines whether the target LSN is less than the parameter.

param
other The other LogLSN to be compared.
return
see

        return ( (offset < other.offset && extent == other.extent) ||
                 extent < other.extent);
    
final inttoBytes(byte[] bytes, int index)
Makes a byte representation of the LogLSN.

param
bytes The array of bytes into which the LogLSN is to be copied.
param
index The index in the array where copy is to start.
return
Number of bytes copied.
see

        bytes[index++] = (byte) offset;
        bytes[index++] = (byte)(offset >> 8);
        bytes[index++] = (byte)(offset >> 16);
        bytes[index++] = (byte)(offset >> 24);
        bytes[index++] = (byte) extent;
        bytes[index++] = (byte)(extent >> 8);
        bytes[index++] = (byte)(extent >> 16);
        bytes[index++] = (byte)(extent >> 24);

        return SIZEOF;
    
public final java.lang.StringtoString()
This method is called to direct the object to format its state to a String.

param
return
The formatted representation of the object.
see

        return "LSN(ext="/*#Frozen*/+extent+",off="/*#Frozen*/+offset+")"/*#Frozen*/;