/** Convenience method which takes a pair and returns its index. * @param searchPairName the relative name of the column pair for * which to look * @return the index of the column pair or -1 if not found */ private int getIndexOfColumnPair (String searchPairName) { ArrayList myPairs = getColumnPairNames(); int count = ((myPairs != null) ? myPairs.size() : 0); if (count > 0) { int i; for (i = 0; i < count; i++) { if (myPairs.get(i).equals(searchPairName)) return i; } } return -1; }
/** Convenience method which takes a pair and returns its index. * @param searchPairName the relative name of the column pair for * which to look * @return the index of the column pair or -1 if not found */ private int getIndexOfColumnPair (String searchPairName) { ArrayList myPairs = getColumnPairNames(); int count = ((myPairs != null) ? myPairs.size() : 0); if (count > 0) { int i; for (i = 0; i < count; i++) { if (myPairs.get(i).equals(searchPairName)) return i; } } return -1; }
/** Set the column pairs for this holder. * Previous column pairs are removed. * @param pairs the new column pairs * @throws ModelException if impossible */ public void setColumnPairs (ColumnPairElement[] pairs) throws ModelException { removeColumnPairs(getColumnPairNames()); // remove the old ones addColumnPairs(pairs); // add the new ones }
/** Set the column pairs for this holder. * Previous column pairs are removed. * @param pairs the new column pairs * @throws ModelException if impossible */ public void setColumnPairs (ColumnPairElement[] pairs) throws ModelException { removeColumnPairs(getColumnPairNames()); // remove the old ones addColumnPairs(pairs); // add the new ones }
/** Get all column pairs in this holder. * @return the column pairs */ public ColumnPairElement[] getColumnPairs () { ArrayList pairNames = getColumnPairNames(); TableElement table = getDeclaringTable(); int i, count = ((pairNames != null) ? pairNames.size() : 0); ColumnPairElement[] pairs = new ColumnPairElement[count]; String databaseRoot = getDeclaringClass().getDatabaseRoot(); for (i = 0; i < count; i++) { String absoluteName = NameUtil.getAbsoluteMemberName( databaseRoot, (String)pairNames.get(i)); pairs[i] = (ColumnPairElement)table.getMember( DBIdentifier.create(absoluteName)); } return pairs; }
/** Get all column pairs in this holder. * @return the column pairs */ public ColumnPairElement[] getColumnPairs () { ArrayList pairNames = getColumnPairNames(); TableElement table = getDeclaringTable(); int i, count = ((pairNames != null) ? pairNames.size() : 0); ColumnPairElement[] pairs = new ColumnPairElement[count]; String databaseRoot = getDeclaringClass().getDatabaseRoot(); for (i = 0; i < count; i++) { String absoluteName = NameUtil.getAbsoluteMemberName( databaseRoot, (String)pairNames.get(i)); pairs[i] = (ColumnPairElement)table.getMember( DBIdentifier.create(absoluteName)); } return pairs; }