Example #1
0
        /// <summary>
        /// Get the value of the identifier from the cached data row. The
        /// name of the identifier must correspond to the name of a column
        /// in the data row.
        /// </summary>
        /// <param name="identifier">Identifier.</param>
        /// <param name="correlation">Correlation data (ignored).</param>
        /// <returns>Column data.</returns>
        public Object getValue(Identifier identifier, Object correlation)
        {
            String columnName = identifier.getIdentifier();
            object val = row[columnName];

            if ((val is System.Decimal))
                return new NumericValue((System.Decimal) val);

            if ((val is System.Int32))
                return new NumericValue((System.Int32) val);

            if ((val is System.Single))
                return new NumericValue((System.Single) val);

            if ((val is System.Double))
                return new NumericValue((System.Double) val);

            if ((val is System.Int64))
                return new NumericValue((System.Int64) val);

            if ((val is System.Int16))
                return new NumericValue((System.Int16) val);

            if ((val is System.Byte))
                return new NumericValue((System.Byte) val);

            return val;
        }
Example #2
0
        /// <summary> Factory.</summary>
        /// <param name="id">Identifier name.
        /// </param>
        /// <returns> Instance.
        /// @throws IllegalArgumentException Invalid identifier name.
        /// </returns>
        //UPGRADE_NOTE: Synchronized keyword was removed from method 'valueOf'. Lock expression was added. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1027"'
        public static Identifier valueOf(System.String id)
        {
            lock (typeof(CodeStreet.Selector.Parser.Identifier))
            {
                if (reservedNamesSet_.Contains(id))
                    throw new System.ArgumentException("Identifier name cannot be a reserved name: " + id);

                //UPGRADE_TODO: Method 'java.util.Map.get' was converted to 'System.Collections.IDictionary.Item' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_javautilMapget_javalangObject"'
                Identifier instance = (Identifier) idMap_[id];
                if (instance == null)
                {
                    instance = new Identifier(id);
                    object tempObject;
                    tempObject = instance;
                    idMap_[id] = tempObject;
                    System.Object generatedAux = tempObject;
                }
                return instance;
            }
        }