name() public method

public name ( ) : string
return string
コード例 #1
0
ファイル: Unit.cs プロジェクト: syatanic/fantom
        public Unit findDiv(Unit a, Unit b)
        {
            // compute dim/scale of a / b
            Dimension dim   = a.m_dim.subtract(b.m_dim).intern();
            double    scale = a.m_scale / b.m_scale;

            // find all the matches
            Unit[] matches = match(dim, scale);
            if (matches.Length == 1)
            {
                return(matches[0]);
            }

            // right how our technique for resolving multiple matches is lame
            string expectedName = a.name() + "_per_" + b.name();

            for (int i = 0; i < matches.Length; ++i)
            {
                if (matches[i].name().Contains(expectedName))
                {
                    return(matches[i]);
                }
            }

            // for now just give up
            throw Err.make("Cannot match to db: " + a + " / " + b).val;
        }
コード例 #2
0
ファイル: Unit.cs プロジェクト: syatanic/fantom
        private static Unit findMult(Unit a, Unit b)
        {
            // compute dim/scale of a * b
            Dimension dim   = a.m_dim.add(b.m_dim).intern();
            double    scale = a.m_scale * b.m_scale;

            // find all the matches
            Unit[] matches = match(dim, scale);
            if (matches.Length == 1)
            {
                return(matches[0]);
            }

            // right how our technique for resolving multiple matches is lame
            string expectedName = a.name() + "_" + b.name();

            for (int i = 0; i < matches.Length; ++i)
            {
                if (matches[i].name() == expectedName)
                {
                    return(matches[i]);
                }
            }

            // for now just give up
            throw Err.make("Cannot match to db: " + a + " * " + b).val;
        }
コード例 #3
0
ファイル: Unit.cs プロジェクト: nomit007/f4
        private static Unit findMult(Unit a, Unit b)
        {
            // compute dim/scale of a * b
              Dimension dim = a.m_dim.add(b.m_dim).intern();
              double scale = a.m_scale * b.m_scale;

              // find all the matches
              Unit[] matches = match(dim, scale);
              if (matches.Length == 1) return matches[0];

              // right how our technique for resolving multiple matches is lame
              string expectedName = a.name() + "_" + b.name();
              for (int i=0; i<matches.Length; ++i)
            if (matches[i].name() == expectedName)
              return matches[i];

              // for now just give up
              throw Err.make("Cannot match to db: " + a + " * " + b).val;
        }
コード例 #4
0
ファイル: Unit.cs プロジェクト: nomit007/f4
        public Unit findDiv(Unit a, Unit b)
        {
            // compute dim/scale of a / b
              Dimension dim = a.m_dim.subtract(b.m_dim).intern();
              double scale = a.m_scale / b.m_scale;

              // find all the matches
              Unit[] matches = match(dim, scale);
              if (matches.Length == 1) return matches[0];

              // right how our technique for resolving multiple matches is lame
              string expectedName = a.name() + "_per_" + b.name();
              for (int i=0; i<matches.Length; ++i)
            if (matches[i].name().Contains(expectedName))
              return matches[i];

              // for now just give up
              throw Err.make("Cannot match to db: " + a + " / " + b).val;
        }