directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r902554 - in /directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman: Magic.java RecordHeader.java
Date Sun, 24 Jan 2010 12:41:03 GMT
Author: akarasulu
Date: Sun Jan 24 12:41:03 2010
New Revision: 902554

URL: http://svn.apache.org/viewvc?rev=902554&view=rev
Log:
all formatting

Modified:
    directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/Magic.java
    directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/RecordHeader.java

Modified: directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/Magic.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/Magic.java?rev=902554&r1=902553&r2=902554&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/Magic.java (original)
+++ directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/Magic.java Sun Jan 24 12:41:03
2010
@@ -44,13 +44,14 @@
  *
  * $Id: Magic.java,v 1.1 2000/05/06 00:00:31 boisvert Exp $
  */
-
 package jdbm.recman;
 
+
 /**
  *  This interface contains magic cookies.
  */
-public interface Magic {
+public interface Magic 
+{
     /** Magic cookie at start of file */
     public short FILE_HEADER = 0x1350;
 

Modified: directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/RecordHeader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/RecordHeader.java?rev=902554&r1=902553&r2=902554&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/RecordHeader.java (original)
+++ directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/RecordHeader.java Sun Jan 24 12:41:03
2010
@@ -44,11 +44,12 @@
  *
  * $Id: RecordHeader.java,v 1.1 2000/05/06 00:00:31 boisvert Exp $
  */
-
 package jdbm.recman;
 
+
 import org.apache.directory.server.i18n.I18n;
 
+
 /**
  *  The data that comes at the start of a record of data. It stores 
  *  both the current size and the available size for the record - the latter
@@ -56,7 +57,8 @@
  *  needing to be moved and which allows the system to put small records
  *  in larger free spots.
  */
-class RecordHeader {
+class RecordHeader 
+{
     // offsets
     private static final short O_CURRENTSIZE = 0; // int currentSize
     private static final short O_AVAILABLESIZE = Magic.SZ_INT; // int availableSize
@@ -66,42 +68,56 @@
     private BlockIo block;
     private short pos;
 
+    
     /**
      *  Constructs a record header from the indicated data starting at
      *  the indicated position.
      */
-    RecordHeader(BlockIo block, short pos) {
+    RecordHeader( BlockIo block, short pos ) 
+    {
         this.block = block;
         this.pos = pos;
-        if (pos > (RecordFile.BLOCK_SIZE - SIZE))
+        if ( pos > ( RecordFile.BLOCK_SIZE - SIZE ) )
+        {
             throw new Error( I18n.err( I18n.ERR_562, block.getBlockId(), pos ) );
+        }
     }
 
+    
     /** Returns the current size */
-    int getCurrentSize() {
-        return block.readInt(pos + O_CURRENTSIZE);
+    int getCurrentSize() 
+    {
+        return block.readInt( pos + O_CURRENTSIZE );
     }
     
+    
     /** Sets the current size */
-    void setCurrentSize(int value) {
-        block.writeInt(pos + O_CURRENTSIZE, value);
+    void setCurrentSize( int value ) 
+    {
+        block.writeInt( pos + O_CURRENTSIZE, value );
     }
     
+    
     /** Returns the available size */
-    int getAvailableSize() {
-        return block.readInt(pos + O_AVAILABLESIZE);
+    int getAvailableSize() 
+    {
+        return block.readInt( pos + O_AVAILABLESIZE );
     }
     
+    
     /** Sets the available size */
-    void setAvailableSize(int value) {
-        block.writeInt(pos + O_AVAILABLESIZE, value);
+    void setAvailableSize( int value ) 
+    {
+        block.writeInt( pos + O_AVAILABLESIZE, value );
     }
 
+    
     // overrides java.lang.Object
-    public String toString() {
-        return "RH(" + block.getBlockId() + ":" + pos 
-            + ", avl=" + getAvailableSize()
-            + ", cur=" + getCurrentSize() 
-            + ")";
+    public String toString() 
+    {
+        return "RH( " + block.getBlockId() + " : " + pos 
+            + ", avl = " + getAvailableSize()
+            + ", cur = " + getCurrentSize() 
+            + " )";
     }
-}
+}
\ No newline at end of file



Mime
View raw message