Exemple #1
0
        private IScalar getDolphinDBScalarBySystemType(Type stype, object value)
        {
            IScalar data = null;

            if (stype == Type.GetType("System.Boolean"))
            {
                data = new BasicBoolean(Convert.ToBoolean(value));
            }
            else if (stype == Type.GetType("System.Byte"))
            {
                data = new BasicByte(Convert.ToByte(value));
            }
            else if (stype == Type.GetType("System.Double"))
            {
                data = new BasicDouble(Convert.ToDouble(value));
            }
            else if (stype == Type.GetType("System.DateTime"))
            {
                data = new BasicDateTime(Convert.ToDateTime(value));
            }
            else if (stype == Type.GetType("System.TimeSpan"))
            {
                data = new BasicTime((TimeSpan)value);
            }

            else if (stype == Type.GetType("System.Int16"))
            {
                data = new BasicShort(Convert.ToInt16(value));
            }
            else if (stype == Type.GetType("System.Int32"))
            {
                data = new BasicInt(Convert.ToInt32(value));
            }
            else if (stype == Type.GetType("System.Int64"))
            {
                data = new BasicLong(Convert.ToInt64(value));
            }
            else
            {
                data = new BasicString(value.ToString());
            }
            return(data);
        }
Exemple #2
0
 public override void set(int index, string value)
 {
     values[index] = new BasicString(value);
 }
 public override int hashBucket(int index, int buckets)
 {
     return(BasicString.hashBucket(@base.getSymbol(values[index]), buckets));
 }
 public override int hashBucket(int index, int buckets)
 {
     return(BasicString.hashBucket(values[index], buckets));
 }