//================================= CLASS CONSTRUCTOR ========================================
function QueryValue(iqField)
{
//MEMBER VARIABLES
 this.qField = null;
 this.svrData = null;
 this.data = null;
 this.text = null;

 this.initialize(iqField);
}

//====================================== STATIC ==============================================
//CONSTANTS

//====================================== MEMBERS =============================================
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GETTER/SETTER ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
QueryValue.prototype.getSvrData = function()
{
 return this.svrData;
}

QueryValue.prototype.setSvrData = function(isvrData)
{
 if (this.svrData.localeCompare(isvrData) != 0)
 {
  this.svrData = isvrData;
  this.setModified();
 }
}

QueryValue.prototype.getData = function()
{
 return this.data;
}

QueryValue.prototype.clearData = function()
{
 if (this.data != null)
  this.data = VALUE_clear(this.data,this.qField.getType());
}

QueryValue.prototype.addToData = function(ielement)
{
 if (this.data == null)
  this.data = new Array();
 this.data.push(ielement);
}

QueryValue.prototype.setData = function(idata)
{
 var
  type = this.qField.getType();

 if (this.data != null)
 {
  if (VALUE_compare(this.data,idata,type) == 0)
   return;
  this.data = VALUE_clear(this.data,type);
 }
 this.data = VALUE_copy(idata,type);
}

QueryValue.prototype.getText = function()
{
 return this.text;
}

QueryValue.prototype.setText = function(itext)
{
 this.text = itext;
}

QueryValue.prototype.setModified = function()
{
 if (this.qField != null)
  this.qField.setModified();
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ METHODS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
QueryValue.prototype.initialize = function(iqField)
{
 this.qField = iqField;
 this.svrData = "";
 this.data = VALUE_createVoid(iqField.getType());
 this.text = "";
}

QueryValue.prototype.copyFrom = function(iqueryValue)
{
 this.setSvrData(iqueryValue.getSvrData());
 this.setData(iqueryValue.getData());
 this.setText(iqueryValue.getText());
}

QueryValue.prototype.hasSvrData = function()
{
 if (this.svrData.length == 0)
  return false;
 return true;
}

QueryValue.prototype.getServletData = function()
{
 return this.svrData;
}

QueryValue.prototype.finalize = function()
{
//Finalizing ...
 this.clearData();
//Freeing ...
 this.qField = null;
 this.svrData = null;
 this.data = null;
 this.text = null;
}
