// Path: orderly-core/src/main/java/orderly/IntWritableRowKey.java
// public class IntWritableRowKey extends AbstractVarIntRowKey
// {
//   /** Header flags */
//   protected static final byte INT_SIGN   = (byte) 0x80;
//   protected static final byte INT_SINGLE = (byte) 0x40;
//   protected static final byte INT_DOUBLE = (byte) 0x20;
// 
//   /** Header data bits for each header type */
//   protected static final int INT_SINGLE_DATA_BITS = 0x6;
//   protected static final int INT_DOUBLE_DATA_BITS = 0x5;
//   protected static final int INT_EXT_DATA_BITS    = 0x3;
// 
//   /** Extended (3-9) byte length attributes */
//   /** Number of bits in the length field */
//   protected static final int INT_EXT_LENGTH_BITS = 0x2;
// 
//   public IntWritableRowKey() {
//     super(INT_SINGLE, INT_SINGLE_DATA_BITS, INT_DOUBLE,
//         INT_DOUBLE_DATA_BITS, INT_EXT_LENGTH_BITS, 
//         INT_EXT_DATA_BITS);
//   }
// 
//   @Override
//   public Class<?> getSerializedClass() { return IntWritable.class; }
// 
//   @Override
//   Writable createWritable() { return new IntWritable(); }
// 
//   @Override
//   void setWritable(long x, Writable w) { ((IntWritable)w).set((int)x); }
// 
//   @Override
//   long getWritable(Writable w) { return ((IntWritable)w).get(); }
// 
//   @Override
//   long getSign(long l) { return l & Long.MIN_VALUE; }
// 
//   @Override
//   protected byte initHeader(boolean sign) {
//     return sign ? 0 : INT_SIGN; /* sign bit is negated in header */
//   }
// 
//   @Override
//   protected byte getSign(byte h) { 
//     return (h & INT_SIGN) != 0 ? 0 : Byte.MIN_VALUE;
//   }
// }
// 
// Path: orderly-core/src/main/java/orderly/IntegerRowKey.java
// public class IntegerRowKey extends IntWritableRowKey 
// {
//   private IntWritable iw;
// 
//   @Override
//   public Class<?> getSerializedClass() { return Integer.class; }
// 
//   protected Object toIntWritable(Object o) {
//     if (o == null || o instanceof IntWritable)
//       return o;
//     if (iw == null)
//       iw = new IntWritable();
//     iw.set((Integer)o);
//     return iw;
//   }
// 
//   @Override
//   public int getSerializedLength(Object o) throws IOException {
//     return super.getSerializedLength(toIntWritable(o));
//   }
// 
//   @Override
//   public void serialize(Object o, ImmutableBytesWritable w) throws IOException {
//     super.serialize(toIntWritable(o), w);
//   }
// 
//   @Override
//   public Object deserialize(ImmutableBytesWritable w) throws IOException {
//     IntWritable iw = (IntWritable) super.deserialize(w);
//     if (iw == null)
//       return iw;
// 
//     return Integer.valueOf(iw.get());
//   }
// }
// 
// Path: orderly-core/src/main/java/orderly/Order.java
// public enum Order
// { 
//   ASCENDING((byte)0), 
//   DESCENDING((byte)0xff);
// 
//   private final byte mask;
// 
//   Order(byte mask) { this.mask = mask; }
// 
//   /** Gets the byte mask associated with the sort order. When a 
//    * serialized byte is XOR'd with the mask, the result is the same byte 
//    * but sorted in the direction specified by the Order object. 
//    * @see RowKey#serialize
//    */
//   byte mask() { return mask; }
// 
// }


import orderly.IntWritableRowKey;
import orderly.IntegerRowKey;
import orderly.Order;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
/*  Licensed to the Apache Software Foundation (ASF) under one
 *  or more contributor license agreements.  See the NOTICE file
 *  distributed with this work for additional information
 *  regarding copyright ownership.  The ASF licenses this file
 *  to you under the Apache License, Version 2.0 (the
 *  License"); you may not use this file except in compliance
 *  with the License.  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing,
 *  software distributed under the License is distributed on an
 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 *  KIND, either express or implied.  See the License for the
 *  specific language governing permissions and limitations
 *  under the License.
 */

package orderly.example;




public class IntExample
{
  /* Simple examples showing serialization lengths with Integer Row Key */
  public void lengthExamples() throws Exception {
// Path: orderly-core/src/main/java/orderly/IntWritableRowKey.java
// public class IntWritableRowKey extends AbstractVarIntRowKey
// {
//   /** Header flags */
//   protected static final byte INT_SIGN   = (byte) 0x80;
//   protected static final byte INT_SINGLE = (byte) 0x40;
//   protected static final byte INT_DOUBLE = (byte) 0x20;
// 
//   /** Header data bits for each header type */
//   protected static final int INT_SINGLE_DATA_BITS = 0x6;
//   protected static final int INT_DOUBLE_DATA_BITS = 0x5;
//   protected static final int INT_EXT_DATA_BITS    = 0x3;
// 
//   /** Extended (3-9) byte length attributes */
//   /** Number of bits in the length field */
//   protected static final int INT_EXT_LENGTH_BITS = 0x2;
// 
//   public IntWritableRowKey() {
//     super(INT_SINGLE, INT_SINGLE_DATA_BITS, INT_DOUBLE,
//         INT_DOUBLE_DATA_BITS, INT_EXT_LENGTH_BITS, 
//         INT_EXT_DATA_BITS);
//   }
// 
//   @Override
//   public Class<?> getSerializedClass() { return IntWritable.class; }
// 
//   @Override
//   Writable createWritable() { return new IntWritable(); }
// 
//   @Override
//   void setWritable(long x, Writable w) { ((IntWritable)w).set((int)x); }
// 
//   @Override
//   long getWritable(Writable w) { return ((IntWritable)w).get(); }
// 
//   @Override
//   long getSign(long l) { return l & Long.MIN_VALUE; }
// 
//   @Override
//   protected byte initHeader(boolean sign) {
//     return sign ? 0 : INT_SIGN; /* sign bit is negated in header */
//   }
// 
//   @Override
//   protected byte getSign(byte h) { 
//     return (h & INT_SIGN) != 0 ? 0 : Byte.MIN_VALUE;
//   }
// }
// 
// Path: orderly-core/src/main/java/orderly/IntegerRowKey.java
// public class IntegerRowKey extends IntWritableRowKey 
// {
//   private IntWritable iw;
// 
//   @Override
//   public Class<?> getSerializedClass() { return Integer.class; }
// 
//   protected Object toIntWritable(Object o) {
//     if (o == null || o instanceof IntWritable)
//       return o;
//     if (iw == null)
//       iw = new IntWritable();
//     iw.set((Integer)o);
//     return iw;
//   }
// 
//   @Override
//   public int getSerializedLength(Object o) throws IOException {
//     return super.getSerializedLength(toIntWritable(o));
//   }
// 
//   @Override
//   public void serialize(Object o, ImmutableBytesWritable w) throws IOException {
//     super.serialize(toIntWritable(o), w);
//   }
// 
//   @Override
//   public Object deserialize(ImmutableBytesWritable w) throws IOException {
//     IntWritable iw = (IntWritable) super.deserialize(w);
//     if (iw == null)
//       return iw;
// 
//     return Integer.valueOf(iw.get());
//   }
// }
// 
// Path: orderly-core/src/main/java/orderly/Order.java
// public enum Order
// { 
//   ASCENDING((byte)0), 
//   DESCENDING((byte)0xff);
// 
//   private final byte mask;
// 
//   Order(byte mask) { this.mask = mask; }
// 
//   /** Gets the byte mask associated with the sort order. When a 
//    * serialized byte is XOR'd with the mask, the result is the same byte 
//    * but sorted in the direction specified by the Order object. 
//    * @see RowKey#serialize
//    */
//   byte mask() { return mask; }
// 
// }


// Path: orderly-examples/src/main/java/orderly/example/IntExample.java
import orderly.IntWritableRowKey;
import orderly.IntegerRowKey;
import orderly.Order;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.hbase.io.ImmutableBytesWritable;

/*  Licensed to the Apache Software Foundation (ASF) under one
 *  or more contributor license agreements.  See the NOTICE file
 *  distributed with this work for additional information
 *  regarding copyright ownership.  The ASF licenses this file
 *  to you under the Apache License, Version 2.0 (the
 *  License"); you may not use this file except in compliance
 *  with the License.  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing,
 *  software distributed under the License is distributed on an
 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 *  KIND, either express or implied.  See the License for the
 *  specific language governing permissions and limitations
 *  under the License.
 */

package orderly.example;




public class IntExample
{
  /* Simple examples showing serialization lengths with Integer Row Key */
  public void lengthExamples() throws Exception {
    IntegerRowKey i = new IntegerRowKey();