public void testContainsDouble() { JDFNumberList l = new JDFNumberList("1 2.0 3 4 3.0"); Assert.IsTrue(l.Contains(2.0)); Assert.IsTrue(l.Contains(4.00)); Assert.IsTrue(l.Contains(3)); Assert.IsFalse(l.Contains(0)); }
/// /// <summary> * constructs a xy pair with all values set via a JDFNumberList /// * </summary> /// * <param name="nl"> the given number list /// * </param> /// * <exception cref="FormatException"> - if the JDFNumberList has not a valid format </exception> /// public JDFXYPair(JDFNumberList nl) : base(JDFBaseDataTypes_Fields.MAX_XY_DIMENSION) { if (nl.Count != JDFBaseDataTypes_Fields.MAX_XY_DIMENSION) { throw new FormatException("JDFXYPair: can't construct JDFXYPair from this JDFNuberList value"); } m_numList[0] = nl.m_numList[0]; m_numList[1] = nl.m_numList[1]; }
public virtual void testGetDouble() { JDFNumberList nl = new JDFNumberList("1.1 2.2 3.3"); Assert.AreEqual(1.1, nl.doubleAt(0), 0.0); Assert.AreEqual(2.2, nl.doubleAt(1), 0.0); Assert.AreEqual(3.3, nl.doubleAt(2), 0.0); Assert.AreEqual(3.3, nl.doubleAt(-1), 0.0); Assert.AreEqual(0.0, nl.doubleAt(3), 0.0); }
/// /// <summary> * constructs a rectangle with all values set via a JDFNumberList /// * </summary> /// * <param name="nl"> the given number list /// * </param> /// * <exception cref="FormatException"> - if the JDFNumberList has not a valid format </exception> /// public JDFRectangle(JDFNumberList nl) : base(JDFBaseDataTypes_Fields.MAX_RECTANGLE_DIMENSION) { if (nl.Count != JDFBaseDataTypes_Fields.MAX_RECTANGLE_DIMENSION) { throw new FormatException("JDFRectangle: can't construct JDFRectangle from this JDFNuberList value"); } m_numList[0] = nl.m_numList[0]; m_numList[1] = nl.m_numList[1]; m_numList[2] = nl.m_numList[2]; m_numList[3] = nl.m_numList[3]; }
/// /// <summary> * constructs a rectangle with all values set via a JDFNumberList /// * </summary> /// * <param name="nl"> the given number list /// * </param> /// * <exception cref="FormatException"> - if the JDFNumberList has not a valid format </exception> /// public JDFMatrix(JDFNumberList nl) : base(JDFBaseDataTypes_Fields.MAX_MATRIX_DIMENSION) { if (nl.Count != JDFBaseDataTypes_Fields.MAX_MATRIX_DIMENSION) { throw new FormatException("JDFMatrix: can't construct JDFMatrix from this JDFNuberList value"); } m_numList[0] = nl.m_numList[0]; m_numList[1] = nl.m_numList[1]; m_numList[2] = nl.m_numList[2]; m_numList[3] = nl.m_numList[3]; m_numList[4] = nl.m_numList[4]; m_numList[5] = nl.m_numList[5]; }
public void testSetString() { JDFDoc d = new JDFDoc("JDF"); JDFNode n = d.getJDFRoot(); JDFIntegerList il = null; il = new JDFIntegerList("1 2 INF"); n.setAttribute("test", il, null); Assert.AreEqual("1 2 INF", il.ToString(), "il"); JDFNumberList nl = null; nl = new JDFNumberList("-INF 1.1 2.2 INF"); n.setAttribute("test2", nl, null); Assert.AreEqual("-INF 1.1 2.2 INF", nl.ToString(), "nl"); }
/// /// <summary> * constructs a RGB color with all values set via a JDFNumberList /// * </summary> /// * <param name="nl"> the given number list /// * </param> /// * <exception cref="FormatException"> - if the String has not a valid format </exception> /// public JDFRGBColor(JDFNumberList nl) : this(nl.ToString()) { }
/// /// <summary> * add - adds a complete number list to the vector /// * </summary> /// * <param name="nl"> the given JDFNumberList </param> /// public virtual void Add(JDFNumberList nl) { m_numList.AddRange(nl.copyNumList()); }
/// /// <summary> * constructs a CMYK color with a given JDFNumberList /// * </summary> /// * <param name="JDFNumberList"> nl - the given number list /// * </param> /// * <exception cref="FormatException"> - if the String has not a valid format </exception> /// public JDFCMYKColor(JDFNumberList nl) : base(nl) { }