当前位置: 首页>>代码示例>>C#>>正文


C# Vector.addElement方法代码示例

本文整理汇总了C#中Vector.addElement方法的典型用法代码示例。如果您正苦于以下问题:C# Vector.addElement方法的具体用法?C# Vector.addElement怎么用?C# Vector.addElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Vector的用法示例。


在下文中一共展示了Vector.addElement方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: checkIgnorePushObjects

	    void checkIgnorePushObjects()//throws Exception
	    {
	        // ignore changes in pending creates
	        {
	            IDBResult res = getDB().executeSQL("SELECT distinct(object) FROM changed_values where source_id=? and sent>=2", getID() );
	            for( ; !res.isEnd(); res.next() )
	            {
	                String strObject = res.getStringByIdx(0);
	                m_hashIgnorePushObjects.put(strObject, 1);
	            }
	        }

	        //check for belongs_to
	        String strAttribQuests = "";
            Vector<Object> arValues = new Vector<Object>();
	        arValues.addElement(getID());

            Hashtable<String,int>.Enumerator hashEnum = m_hashBelongsTo.GetEnumerator();
            while (hashEnum.MoveNext())
            {
	            if ( strAttribQuests.length() > 0 )
	                strAttribQuests += ",";

	            strAttribQuests += "?";
	            arValues.addElement(hashEnum.Current.Key);
	        }

	        if ( strAttribQuests.length() > 0 )
	        {
	            IDBResult res = getDB().executeSQLEx( "SELECT object, attrib, value FROM changed_values where source_id=? and sent<=1 and attrib IN ( " + strAttribQuests + " )",  
	        		    arValues );

	            for( ; !res.isEnd(); res.next() )
	            {
	                String strObject = res.getStringByIdx(0);
	                String strAttrib = res.getStringByIdx(1);
	                String strValue = res.getStringByIdx(2);

	                IDBResult res2 = getDB().executeSQL(
	                    "SELECT object FROM changed_values where source_id=? and sent>=2 and object=? LIMIT 1 OFFSET 0", 
	                    getBelongsToSrcID(strAttrib), strValue );
	            
	                if (!res2.isEnd())
	                    m_hashIgnorePushObjects.put(strObject, 1 );

	            }
	        }
	    }
开发者ID:douglaslise,项目名称:rhodes,代码行数:48,代码来源:SyncSource.cs

示例2: processServerCmd_Ver3_Schema

	    void processServerCmd_Ver3_Schema(String strCmd, String strObject, JSONStructIterator attrIter)
	    {
	        if ( strCmd.compareTo("insert") == 0 )
	        {
	            Vector<Object> vecValues = new Vector<Object>();
                Vector<String> vecAttrs = new Vector<String>();
	            String strCols = "", strQuest = "", strSet = "";
	            for( ; !attrIter.isEnd() && getSync().isContinueSync(); attrIter.next() )
	            {
	                CAttrValue oAttrValue = new CAttrValue(attrIter.getCurKey(),attrIter.getCurString());
	                if ( !processBlob(strCmd,strObject,oAttrValue) )
	                    continue;
	        	
	                if ( strCols.length() > 0 )
	                    strCols += ",";
	                if ( strQuest.length() > 0)
	                    strQuest += ",";
	                if ( strSet.length() > 0)
	                    strSet += ",";

	                strCols += oAttrValue.m_strAttrib;
	                strQuest += "?";
	                strSet += oAttrValue.m_strAttrib + "=?";
	                vecAttrs.addElement(oAttrValue.m_strAttrib);
	                vecValues.addElement(oAttrValue.m_strValue);
	            }
	            vecValues.addElement(strObject);
	            if ( strCols.length() > 0 )
	                strCols += ",";
	            if ( strQuest.length() > 0)
	                strQuest += ",";
	        
	            strCols += "object";
	            strQuest += "?";

	            String strSqlInsert = "INSERT INTO ";
	            strSqlInsert += getName() + " (";
	            strSqlInsert += strCols + ") VALUES(" + strQuest + ")";

	            if ( !getSync().isContinueSync() )
	                return;

	            IDBResult resInsert = getDB().executeSQLReportNonUniqueEx(strSqlInsert, vecValues );
	            if ( resInsert.isNonUnique() )
	            {
	                String strSqlUpdate = "UPDATE ";
	                strSqlUpdate += getName() + " SET " + strSet + " WHERE object=?";
	                getDB().executeSQLEx(strSqlUpdate, vecValues);

	                if ( getSyncType().compareTo("none") != 0 )
	                {
		                // oo conflicts
		                for( int i = 0; i < (int)vecAttrs.size(); i++ )
		                {
		                    getDB().executeSQL("UPDATE changed_values SET sent=4 where object=? and attrib=? and source_id=? and sent>1", 
		                        strObject, vecAttrs.elementAt(i), getID() );
		                }
		                //
	                }
	            }

	            if ( getSyncType().compareTo("none") != 0 )	        
	        	    getNotify().onObjectChanged(getID(),strObject, SyncNotify.enUpdate);
	        
	            m_nInserted++;
	        }else if (strCmd.compareTo("delete") == 0)
	        {
	    	    Vector<String> vecAttrs = new Vector<String>();
	            String strSet = "";
	            for( ; !attrIter.isEnd() && getSync().isContinueSync(); attrIter.next() )
	            {
	        	    CAttrValue oAttrValue = new CAttrValue(attrIter.getCurKey(),attrIter.getCurString());
	        	
	                if ( strSet.length() > 0 )
	                    strSet += ",";

	                vecAttrs.addElement(oAttrValue.m_strAttrib);
	                strSet += oAttrValue.m_strAttrib + "=NULL";
	            }

	            String strSqlUpdate = "UPDATE ";
	            strSqlUpdate += getName() + " SET " + strSet + " WHERE object=?";
	        
	            if ( strSet.length() == 0 || !getSync().isContinueSync() )
	                return;
	        
	            getDB().executeSQL(strSqlUpdate, strObject);
	            //Remove item if all nulls
	            String strSelect = "SELECT * FROM " + getName() + " WHERE object=?";
	            IDBResult res = getDB().executeSQL( strSelect, strObject );
	            if ( !res.isEnd() )
	            {
	                boolean bAllNulls = true;
	                for( int i = 0; i < res.getColCount(); i ++)
	                {
	                    if ( !res.isNullByIdx(i) && res.getColName(i).compareTo("object")!=0 )
	                    {
	                        bAllNulls = false;
	                        break;
	                    }
//.........这里部分代码省略.........
开发者ID:douglaslise,项目名称:rhodes,代码行数:101,代码来源:SyncSource.cs

示例3: pushMultipartData

        public NetResponse pushMultipartData(String strUrl, MultipartItem oItem, IRhoSession oSession, Hashtable<String,String> pHeaders)
        {
            Vector<MultipartItem> arItems = new Vector<MultipartItem>();
            arItems.addElement(oItem);

            return pushMultipartData(strUrl, arItems, oSession, pHeaders);
        }
开发者ID:raulvejar,项目名称:rhodes,代码行数:7,代码来源:NetRequest.cs

示例4: getDBAllPartitionNames

    public static Vector<String> getDBAllPartitionNames()
    {
        Vector<String> vecNames = new Vector<String>();
        Hashtable<String, DBAdapter>.Enumerator hashEnum = m_mapDBPartitions.GetEnumerator();
        while (hashEnum.MoveNext())
        {
            vecNames.addElement(hashEnum.Current.Key);
		}
		
        return vecNames;
    }
开发者ID:Chanic,项目名称:rhodes,代码行数:11,代码来源:DBAdapter.cs

示例5: copyChangedValues

    void copyChangedValues(DBAdapter db)
    {
    	updateAllAttribChanges();    	
        copyTable("changed_values", m_dbStorage, db.m_dbStorage );
        {
            Vector<int> arOldSrcs = new Vector<int>();
            {
                IDBResult resSrc = db.executeSQL( "SELECT DISTINCT(source_id) FROM changed_values" );
                for ( ; !resSrc.isEnd(); resSrc.next() )
                    arOldSrcs.addElement( resSrc.getIntByIdx(0) );
            }
            for( int i = 0; i < arOldSrcs.size(); i++)
            {
                int nOldSrcID = arOldSrcs.elementAt(i);

                IDBResult res = executeSQL("SELECT name from sources WHERE source_id=?", nOldSrcID);
                if ( !res.isEnd() )
                {
                    String strSrcName = res.getStringByIdx(0);
                    IDBResult res2 = db.executeSQL("SELECT source_id from sources WHERE name=?", strSrcName );
                    if ( !res2.isEnd() )
                    {
                        if ( nOldSrcID != res2.getIntByIdx(0) )
                        {
                            db.executeSQL("UPDATE changed_values SET source_id=? WHERE source_id=?", res2.getIntByIdx(0), nOldSrcID);
                        }
                        continue;
                    }
                }

                //source not exist in new partition, remove this changes
                db.executeSQL("DELETE FROM changed_values WHERE source_id=?", nOldSrcID);
            }
        }
    }
开发者ID:Chanic,项目名称:rhodes,代码行数:35,代码来源:DBAdapter.cs

示例6: updateAllAttribChanges

    public void updateAllAttribChanges()
    {
	    //Check for attrib = object
	    IDBResult res = executeSQL("SELECT object, source_id, update_type " +
	        "FROM changed_values where attrib = 'object' and sent=0" );

	    if ( res.isEnd() )
	        return;

	    startTransaction();

	    Vector<String> arObj = new Vector<String>(), arUpdateType = new Vector<String>();
	    Vector<int> arSrcID = new Vector<int>();
	    for( ; !res.isEnd(); res.next() )
	    {
	        arObj.addElement(res.getStringByIdx(0));
	        arSrcID.addElement(res.getIntByIdx(1));
	        arUpdateType.addElement(res.getStringByIdx(2));
	    }
        
        for( int i = 0; i < (int)arObj.size(); i++ )
        {
            IDBResult resSrc = executeSQL("SELECT name, schema FROM sources where source_id=?", arSrcID.elementAt(i) );
            boolean bSchemaSource = false;
            String strTableName = "object_values";
            if ( !resSrc.isEnd() )
            {
                bSchemaSource = resSrc.getStringByIdx(1).length() > 0;
                if ( bSchemaSource )
                    strTableName = resSrc.getStringByIdx(0);
            }

            if (bSchemaSource)
            {
                IDBResult res2 = executeSQL( "SELECT * FROM " + strTableName + " where object=?", arObj.elementAt(i) );
                for( int j = 0; j < res2.getColCount(); j ++)
                {
                    String strAttrib = res2.getColName(j);
                    String value = res2.getStringByIdx(j);
                    String attribType = getAttrMgr().isBlobAttr(arSrcID.elementAt(i), strAttrib) ? "blob.file" : "";

    	            executeSQLReportNonUnique("INSERT INTO changed_values (source_id,object,attrib,value,update_type,attrib_type,sent) VALUES(?,?,?,?,?,?,?)", 
        	                arSrcID.elementAt(i), arObj.elementAt(i), strAttrib, value, arUpdateType.elementAt(i), attribType, 0 );
                }
            }else
            {
                IDBResult res2 = executeSQL( "SELECT attrib, value FROM " + strTableName + " where object=? and source_id=?", 
                    arObj.elementAt(i), arSrcID.elementAt(i) );

    	        for( ; !res2.isEnd(); res2.next() )
    	        {
    	            String strAttrib = res2.getStringByIdx(0);
    	            String value = res2.getStringByIdx(1);
    	            String attribType = getAttrMgr().isBlobAttr(arSrcID.elementAt(i), strAttrib) ? "blob.file" : "";

    	            executeSQLReportNonUnique("INSERT INTO changed_values (source_id,object,attrib,value,update_type,attrib_type,sent) VALUES(?,?,?,?,?,?,?)", 
    	                arSrcID.elementAt(i), arObj.elementAt(i), strAttrib, value, arUpdateType.elementAt(i), attribType, 0 );
    	        }
            }
        }

        executeSQL("DELETE FROM changed_values WHERE attrib='object'"); 

        endTransaction();
    }
开发者ID:Chanic,项目名称:rhodes,代码行数:65,代码来源:DBAdapter.cs

示例7: getControllers

 /**
  * Creates a vector of SampleController plugins.
  *
  * @param properties
  *            The properties with information about the samplers
  * @return The Controllers value
  */
 // TODO - does not appear to be called directly
 public static Vector<Object> getControllers(Properties properties)
 {
     String name = "controller."; // $NON-NLS-1$
     Vector<Object> v = new Vector<Object>();
     Enumeration<?> names = properties.keys();
     while (names.hasMoreElements()) {
         String prop = (String) names.nextElement();
         if (prop.startsWith(name)) {
             Object o = instantiate(properties.getProperty(prop),
                     "org.apache.jmeter.control.SamplerController"); // $NON-NLS-1$
             v.addElement(o);
         }
     }
     return v;
 }
开发者ID:RalphC,项目名称:NetMeter,代码行数:23,代码来源:NetMeterUtils.cs


注:本文中的Vector.addElement方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。