Example #1
0
		/// <summary> Removes a value of a nominal or string attribute. Creates a 
		/// fresh list of attribute values before removing it.
		/// 
		/// </summary>
		/// <param name="index">the value's index
		/// </param>
		/// <exception cref="IllegalArgumentException">if the attribute is not nominal
		/// </exception>
		//@ requires isNominal() || isString();
		//@ requires 0 <= index && index < m_Values.size();
		internal void  delete(int index)
		{
			
			if (!Nominal && !String)
				throw new System.ArgumentException("Can only remove value of" + "nominal or string attribute!");
			else
			{
				m_Values = (FastVector) m_Values.copy();
				m_Values.removeElementAt(index);
				System.Collections.Hashtable hash = new System.Collections.Hashtable(m_Hashtable.Count);
				System.Collections.IEnumerator enu = m_Hashtable.Keys.GetEnumerator();
				//UPGRADE_TODO: Method 'java.util.Enumeration.hasMoreElements' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilEnumerationhasMoreElements'"
				while (enu.MoveNext())
				{
					//UPGRADE_TODO: Method 'java.util.Enumeration.nextElement' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilEnumerationnextElement'"
					System.Object string_Renamed = enu.Current;
					System.Int32 valIndexObject = (System.Int32) m_Hashtable[string_Renamed];
					int valIndex = valIndexObject;
					if (valIndex > index)
					{
						hash.Add(string_Renamed, (System.Int32) (valIndex - 1));
						
					}
					else if (valIndex < index)
					{
						hash.Add(string_Renamed, valIndexObject);
					}
				}
				m_Hashtable = hash;
			}
		}