1 6 7 package com.hp.hpl.jena.db.impl; 8 9 import com.hp.hpl.jena.graph.*; 10 import com.hp.hpl.jena.graph.query.Mapping; 11 import com.hp.hpl.jena.shared.JenaException; 12 13 16 17 public class VarDesc { 18 19 Node_Variable var; boolean isArgVar; boolean isBoundToCol; int resIx; int mapIx; int alias; char column; 27 public VarDesc ( Node v, int mapix, int resix ) { 28 var = (Node_Variable) v; 29 isArgVar = true; 30 mapIx = mapix; 31 resIx = resix; 32 isBoundToCol = false; 33 } 34 35 public VarDesc ( Node v, int resix ) { 36 var = (Node_Variable) v; 37 isArgVar = false; 38 mapIx = -1; 39 resIx = resix; 40 isBoundToCol = false; 41 } 42 43 public void bindToVarMap ( Mapping varMap ) { 44 if ( isArgVar ) 45 throw new JenaException("Variable bound twice to argument"); 46 mapIx = varMap.newIndex(var); 47 return; 48 } 49 50 51 public void bindToCol ( int tblAlias, char colId ) { 52 if ( isBoundToCol ) 53 throw new JenaException("Variable bound twice to column"); 54 isBoundToCol = true; 55 alias = tblAlias; 56 column = colId; 57 return; 58 } 59 60 public boolean isBoundToCol() { return isBoundToCol; } 61 public boolean isArgVar() { return isArgVar; } 62 } 63 64 93 | Popular Tags |