1 21 22 package org.apache.derby.impl.sql.execute; 23 24 import org.apache.derby.iapi.store.access.ColumnOrdering; 25 26 import org.apache.derby.iapi.services.io.StoredFormatIds; 27 import org.apache.derby.iapi.services.io.FormatIdUtil; 28 import org.apache.derby.iapi.services.io.Formatable; 29 30 import java.io.ObjectOutput ; 31 import java.io.ObjectInput ; 32 import java.io.IOException ; 33 40 public class IndexColumnOrder implements ColumnOrdering, Formatable 41 { 42 55 56 int colNum; 57 boolean ascending; 58 59 62 63 66 public IndexColumnOrder() 67 { 68 } 69 70 public IndexColumnOrder(int colNum) { 71 this.colNum = colNum; 72 this.ascending = true; 73 } 74 75 public IndexColumnOrder(int colNum, boolean ascending) { 76 this.colNum = colNum; 77 this.ascending = ascending; 78 } 79 80 83 public int getColumnId() { 84 return colNum; 85 } 86 87 public boolean getIsAscending() { 88 return ascending; 89 } 90 91 103 public void writeExternal(ObjectOutput out) throws IOException 104 { 105 out.writeInt(colNum); 106 out.writeBoolean(ascending); 107 } 108 109 117 public void readExternal(ObjectInput in) 118 throws IOException , ClassNotFoundException 119 { 120 colNum = in.readInt(); 121 ascending = in.readBoolean(); 122 } 123 124 129 public int getTypeFormatId() { return StoredFormatIds.INDEX_COLUMN_ORDER_V01_ID; } 130 } 131 | Popular Tags |