1 23 package com.lutris.dods.builder.generator.query; 24 25 33 public class RDBRow { 34 private RDBColumnValue[] values; 35 36 43 public RDBRow(RDBColumnValue[] vals) { 44 if (null == vals) { 45 values = new RDBColumnValue[0]; 46 } else { 47 values = vals; 48 } 49 } 50 51 64 public RDBColumnValue get(int i) 65 throws InvalidRowColumnException { 66 if (!(0 <= i && i < values.length)) { 67 throw new InvalidRowColumnException("" + i); 68 } 69 return values[i]; 70 } 71 72 83 public RDBColumnValue get(RDBColumn col) 84 throws InvalidRowColumnException { 85 if (null == col) { 86 throw new InvalidRowColumnException("Null RDBColumn"); 87 } 88 for (int i = 0; i < values.length; i++) { 89 if (values[i].equals(col)) { 90 return values[i]; 91 } 92 } 93 throw new InvalidRowColumnException(col.getFullColumnName()); 94 } 95 } 96 | Popular Tags |