예제 #1
0
 public void removeGainLoss(stGainloss remove)
 {
     for (int i = 0; i < mGainlosses.size(); i++)
     {
         stGainloss g = (stGainloss)mGainlosses.elementAt(i);
         if (g == remove)
         {
             mGainlosses.removeElementAt(i);
             break;
         }
     }
 }
예제 #2
0
        public void save()
        {
            xDataOutput o = new xDataOutput(2048);

            o.writeInt(FILE_GAINLOSS_VERSION);

            o.writeInt(mGainlosses.size());
            for (int i = 0; i < mGainlosses.size(); i++)
            {
                stGainloss g = (stGainloss)mGainlosses.elementAt(i);
                o.writeUTF(g.code);
                o.writeInt(g.date);
                o.writeFloat(g.price);
                o.writeInt(g.volume);
            }

            xFileManager.saveFile(o, FILE_GAINLOSS);
        }
예제 #3
0
        public void sortList()
        {
            for (int i = 0; i < mGainlosses.size() - 1; i++)
            {
                stGainloss a           = (stGainloss)mGainlosses.elementAt(i);
                stGainloss smallest    = a;
                int        smallestIDX = i;
                for (int j = i + 1; j < mGainlosses.size(); j++)
                {
                    stGainloss g = (stGainloss)mGainlosses.elementAt(j);
                    if (smallest.code == g.code)
                    {
                        smallest    = g;
                        smallestIDX = j;
                    }
                }

                if (smallestIDX > i)
                {
                    mGainlosses.swap(i, smallestIDX);
                }
            }
        }
예제 #4
0
        public void addGainLoss(string _c, int _d, float _p, int _v)
        {
            stGainloss g = new stGainloss(_c, _d, _p, _v);

            mGainlosses.addElement(g);
        }