public void UncomputableExpressionsThrow()
        {
            var left  = new NumericValue(5);
            var right = new DurationValue(TimeSpan.FromSeconds(3));
            var expr  = new BinaryExpression(Operator.Divide, left, right);

            Assert.Throws <EvaluationException>(() => ExpressionEvaluator.Evaluate(expr));
        }
Example #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void lowestMustBeLowest()
        internal virtual void LowestMustBeLowest()
        {
            // GEOMETRY
            AssertLowest(PointValue.MIN_VALUE);
            // ZONED_DATE_TIME
            AssertLowest(DateTimeValue.MIN_VALUE);
            // LOCAL_DATE_TIME
            AssertLowest(LocalDateTimeValue.MIN_VALUE);
            // DATE
            AssertLowest(DateValue.MIN_VALUE);
            // ZONED_TIME
            AssertLowest(TimeValue.MIN_VALUE);
            // LOCAL_TIME
            AssertLowest(LocalTimeValue.MIN_VALUE);
            // DURATION (duration, period)
            AssertLowest(DurationValue.duration(Duration.ofSeconds(long.MinValue, 0)));
            AssertLowest(DurationValue.duration(Period.of(int.MinValue, int.MinValue, int.MinValue)));
            // TEXT
            AssertLowest(of(UTF8.decode(new sbyte[0])));
            // BOOLEAN
            AssertLowest(of(false));
            // NUMBER (byte, short, int, long, float, double)
            AssertLowest(of(sbyte.MinValue));
            AssertLowest(of(short.MinValue));
            AssertLowest(of(int.MinValue));
            AssertLowest(of(long.MinValue));
            AssertLowest(of(float.NegativeInfinity));
            AssertLowest(of(double.NegativeInfinity));
            // GEOMETRY_ARRAY
            AssertLowest(pointArray(new PointValue[0]));
            // ZONED_DATE_TIME_ARRAY
            AssertLowest(dateTimeArray(new ZonedDateTime[0]));
            // LOCAL_DATE_TIME_ARRAY
            AssertLowest(localDateTimeArray(new DateTime[0]));
            // DATE_ARRAY
            AssertLowest(dateArray(new LocalDate[0]));
            // ZONED_TIME_ARRAY
            AssertLowest(timeArray(new OffsetTime[0]));
            // LOCAL_TIME_ARRAY
            AssertLowest(localTimeArray(new LocalTime[0]));
            // DURATION_ARRAY (DurationValue, TemporalAmount)
            AssertLowest(durationArray(new DurationValue[0]));
            AssertLowest(durationArray(new TemporalAmount[0]));
            // TEXT_ARRAY
            AssertLowest(of(new string[0]));
            // BOOLEAN_ARRAY
            AssertLowest(of(new bool[0]));
            // NUMBER_ARRAY (byte[], short[], int[], long[], float[], double[])
            AssertLowest(of(new sbyte[0]));
            AssertLowest(of(new short[0]));
            AssertLowest(of(new int[0]));
            AssertLowest(of(new long[0]));
            AssertLowest(of(new float[0]));
            AssertLowest(of(new double[0]));
        }
Example #3
0
        private void assertDurationValue(AttributeValue attr, string value)
        {
            Assert.IsInstanceOfType(attr.getValue(), typeof(PrimitiveObjectBlock));
            PrimitiveObjectBlock pob = (PrimitiveObjectBlock)attr.getValue();

            Assert.IsInstanceOfType(pob.getSimpleValue(), typeof(DurationValue));
            DurationValue actual   = (DurationValue)pob.getSimpleValue();
            DvDuration    expected = new DvDuration(value);

            Assert.AreEqual(actual.getValue(), expected);
        }
Example #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testDurationType()
        public virtual void TestDurationType()
        {
            TemporalAmount duration = DurationValue.duration(57, 57, 57, 57).asObjectCopy();
            string         key      = "dt";

            _node1.setProperty(key, duration);
            NewTransaction();

            object property = _node1.getProperty(key);

            assertEquals(duration, property);
        }
Example #5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldHandleDurations()
        public virtual void ShouldHandleDurations()
        {
            // Given
            DurationValue dvalue = DurationValue.duration(1, 2, 3, 4);

            // When
            dvalue.WriteTo(_converter);

            // Then
            object value = _converter.value();

            assertThat(value, instanceOf(typeof(DurationValue)));
            assertThat(value, equalTo(dvalue.AsObjectCopy()));
        }
        public void EvaluationProceedsRecursively()
        {
            var mulLeft  = new NumericValue(5);
            var mulRight = new NumericValue(3);
            var mulExpr  = new BinaryExpression(Operator.Multiply, mulLeft, mulRight);

            var divLeft = new DurationValue(TimeSpan.FromMinutes(60));
            var divExpr = new BinaryExpression(Operator.Divide, divLeft, mulExpr);

            var result = ExpressionEvaluator.Evaluate(divExpr);
            var actual = Assert.IsType <DurationResult>(result);

            Assert.Equal(TimeSpan.FromMinutes(4), actual.Value);
        }
Example #7
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public org.neo4j.values.AnyValue apply(org.neo4j.kernel.api.proc.Context ctx, org.neo4j.values.AnyValue[] input) throws org.neo4j.internal.kernel.api.exceptions.ProcedureException
            public override AnyValue Apply(Context ctx, AnyValue[] input)
            {
                if (input == null || (input.Length == 2 && (input[0] == NO_VALUE || input[0] == null) || input[1] == NO_VALUE || input[1] == null))
                {
                    return(NO_VALUE);
                }
                else if (input.Length == 2)
                {
                    if (input[0] is TemporalValue && input[1] is TemporalValue)
                    {
                        TemporalValue from = ( TemporalValue )input[0];
                        TemporalValue to   = ( TemporalValue )input[1];
                        return(DurationValue.between(Unit, from, to));
                    }
                }
                throw new ProcedureException(Org.Neo4j.Kernel.Api.Exceptions.Status_Procedure.ProcedureCallFailed, "Invalid call signature for " + this.GetType().Name + ": Provided input was " + Arrays.ToString(input));
            }
Example #8
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void highestMustBeHighest()
        internal virtual void HighestMustBeHighest()
        {
            // GEOMETRY
            AssertHighest(PointValue.MAX_VALUE);
            // ZONED_DATE_TIME
            AssertHighest(DateTimeValue.MAX_VALUE);
            // LOCAL_DATE_TIME
            AssertHighest(LocalDateTimeValue.MAX_VALUE);
            // DATE
            AssertHighest(DateValue.MAX_VALUE);
            // ZONED_TIME
            AssertHighest(TimeValue.MAX_VALUE);
            // LOCAL_TIME
            AssertHighest(LocalTimeValue.MAX_VALUE);
            // DURATION (duration, period)
            AssertHighest(DurationValue.duration(Duration.ofSeconds(long.MaxValue, 999_999_999)));
            AssertHighest(DurationValue.duration(Period.of(int.MaxValue, int.MaxValue, int.MaxValue)));
            // TEXT
            AssertHighestString();
            // BOOLEAN
            AssertHighest(of(true));
            // NUMBER (byte, short, int, long, float, double)
            AssertHighest(of(sbyte.MaxValue));
            AssertHighest(of(short.MaxValue));
            AssertHighest(of(int.MaxValue));
            AssertHighest(of(long.MaxValue));
            AssertHighest(of(float.PositiveInfinity));
            AssertHighest(of(double.PositiveInfinity));
            // GEOMETRY_ARRAY
            AssertHighest(pointArray(new PointValue[] { PointValue.MAX_VALUE }));
            // ZONED_DATE_TIME_ARRAY
            AssertHighest(dateTimeArray(new ZonedDateTime[] { DateTimeValue.MAX_VALUE.asObjectCopy() }));
            // LOCAL_DATE_TIME_ARRAY
            AssertHighest(localDateTimeArray(new DateTime[] { LocalDateTimeValue.MAX_VALUE.asObjectCopy() }));
            // DATE_ARRAY
            AssertHighest(dateArray(new LocalDate[] { DateValue.MAX_VALUE.asObjectCopy() }));
            // ZONED_TIME_ARRAY
            AssertHighest(timeArray(new OffsetTime[] { TimeValue.MAX_VALUE.asObjectCopy() }));
            // LOCAL_TIME_ARRAY
            AssertHighest(localTimeArray(new LocalTime[] { LocalTimeValue.MAX_VALUE.asObjectCopy() }));
            // DURATION_ARRAY (DurationValue, TemporalAmount)
            AssertHighest(durationArray(new DurationValue[] { DurationValue.duration(Duration.ofSeconds(long.MaxValue, 999_999_999)) }));
Example #9
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testDurationArray()
        public virtual void TestDurationArray()
        {
            TemporalAmount[] array = new TemporalAmount[] { DurationValue.duration(57, 57, 57, 57).asObjectCopy(), DurationValue.duration(-40, -189, -6247, -1).asObjectCopy() };
            string           key   = "testarray";

            _node1.setProperty(key, array);
            NewTransaction();

            TemporalAmount[] propertyValue = ( TemporalAmount[] )_node1.getProperty(key);
            assertEquals(array.Length, propertyValue.Length);
            for (int i = 0; i < array.Length; i++)
            {
                assertEquals(array[i], propertyValue[i]);
            }

            _node1.removeProperty(key);
            NewTransaction();

            assertTrue(!_node1.hasProperty(key));
        }
Example #10
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public org.neo4j.values.AnyValue apply(org.neo4j.kernel.api.proc.Context ctx, org.neo4j.values.AnyValue[] input) throws org.neo4j.internal.kernel.api.exceptions.ProcedureException
        public override AnyValue Apply(Context ctx, AnyValue[] input)
        {
            if (input == null)
            {
                return(NO_VALUE);
            }
            else if (input.Length == 1)
            {
                if (input[0] == NO_VALUE || input[0] == null)
                {
                    return(NO_VALUE);
                }
                else if (input[0] is TextValue)
                {
                    return(DurationValue.parse(( TextValue )input[0]));
                }
                else if (input[0] is MapValue)
                {
                    MapValue map = ( MapValue )input[0];
                    return(DurationValue.build(map));
                }
            }
            throw new ProcedureException(Org.Neo4j.Kernel.Api.Exceptions.Status_Procedure.ProcedureCallFailed, "Invalid call signature for " + this.GetType().Name + ": Provided input was " + Arrays.ToString(input));
        }
Example #11
0
 protected internal override bool Extract0(char[] data, int offset, int length, CSVHeaderInformation optionalData)
 {
     ValueConflict = DurationValue.parse(CharBuffer.wrap(data, offset, length));
     return(true);
 }
Example #12
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void setup()
        public virtual void Setup()
        {
            _values = new List <Value>();
            // ZONED_DATE_TIME_ARRAY
            _values.Add(Values.dateTimeArray(new ZonedDateTime[] { ZonedDateTime.of(2018, 10, 9, 8, 7, 6, 5, ZoneId.of("UTC")), ZonedDateTime.of(2017, 9, 8, 7, 6, 5, 4, ZoneId.of("UTC")) }));
            // LOCAL_DATE_TIME_ARRAY
            _values.Add(Values.localDateTimeArray(new DateTime[]
            {
                new DateTime(2018, 10, 9, 8, 7, 6, 5),
                new DateTime(2018, 10, 9, 8, 7, 6, 5)
            }));
            // DATE_ARRAY
            _values.Add(Values.dateArray(new LocalDate[] { LocalDate.of(1, 12, 28), LocalDate.of(1, 12, 28) }));
            // ZONED_TIME_ARRAY
            _values.Add(Values.timeArray(new OffsetTime[] { OffsetTime.of(19, 8, 7, 6, ZoneOffset.UTC), OffsetTime.of(19, 8, 7, 6, ZoneOffset.UTC) }));
            // LOCAL_TIME_ARRAY
            _values.Add(Values.localTimeArray(new LocalTime[] { LocalTime.of(19, 28), LocalTime.of(19, 28) }));
            // DURATION_ARRAY
            _values.Add(Values.durationArray(new DurationValue[] { DurationValue.duration(99, 10, 10, 10), DurationValue.duration(99, 10, 10, 10) }));
            // TEXT_ARRAY
            _values.Add(Values.of(new string[] { "someString1", "someString2" }));
            // BOOLEAN_ARRAY
            _values.Add(Values.of(new bool[] { true, true }));
            // NUMBER_ARRAY (byte, short, int, long, float, double)
            _values.Add(Values.of(new sbyte[] { ( sbyte )1, ( sbyte )12 }));
            _values.Add(Values.of(new short[] { 314, 1337 }));
            _values.Add(Values.of(new int[] { 3140, 13370 }));
            _values.Add(Values.of(new long[] { 31400, 133700 }));
            _values.Add(Values.of(new float[] { 0.5654f, 13432.14f }));
            _values.Add(Values.of(new double[] { 432453254.43243, 4354.7888 }));
            _values.Add(Values.of(new char[] { 'a', 'z' }));
            // ZONED_DATE_TIME
            _values.Add(DateTimeValue.datetime(2014, 3, 25, 12, 45, 13, 7474, "UTC"));
            // LOCAL_DATE_TIME
            _values.Add(LocalDateTimeValue.localDateTime(2018, 3, 1, 13, 50, 42, 1337));
            // DATE
            _values.Add(DateValue.epochDate(2));
            // ZONED_TIME
            _values.Add(TimeValue.time(43_200_000_000_000L, ZoneOffset.UTC));
            // LOCAL_TIME
            _values.Add(LocalTimeValue.localTime(100000));
            // DURATION
            _values.Add(DurationValue.duration(10, 20, 30, 40));
            // TEXT
            _values.Add(Values.of("string1"));
            // BOOLEAN
            _values.Add(Values.of(true));
            // NUMBER (byte, short, int, long, float, double)
            _values.Add(Values.of(sbyte.MaxValue));
            _values.Add(Values.of(short.MaxValue));
            _values.Add(Values.of(int.MaxValue));
            _values.Add(Values.of(long.MaxValue));
            _values.Add(Values.of(float.MaxValue));
            _values.Add(Values.of(double.MaxValue));
            _values.Add(Values.of(char.MaxValue));
            // GEOMETRY
            _values.Add(Values.pointValue(CoordinateReferenceSystem.WGS84, 12.78, 56.7));
            _values.Add(Values.pointArray(new PointValue[] { Values.pointValue(CoordinateReferenceSystem.WGS84, 12.7566548, 56.7163465), Values.pointValue(CoordinateReferenceSystem.WGS84, 12.13413478, 56.1343457) }));
            _values.Add(Values.pointValue(CoordinateReferenceSystem.WGS84_3D, 12.78, 56.7, 666));
            _values.Add(Values.pointArray(new PointValue[] { Values.pointValue(CoordinateReferenceSystem.WGS84_3D, 12.7566548, 56.7163465, 666), Values.pointValue(CoordinateReferenceSystem.WGS84_3D, 12.13413478, 56.1343457, 555) }));
            _values.Add(Values.pointValue(CoordinateReferenceSystem.Cartesian, 0.0000043, -0.0000000012341025786543));
            _values.Add(Values.pointArray(new PointValue[] { Values.pointValue(CoordinateReferenceSystem.Cartesian, 0.0000043, -0.0000000012341025786543), Values.pointValue(CoordinateReferenceSystem.Cartesian, 0.2000043, -0.0300000012341025786543) }));
            _values.Add(Values.pointValue(CoordinateReferenceSystem.Cartesian_3D, 0.0000043, -0.0000000012341025786543, 666));
            _values.Add(Values.pointArray(new PointValue[] { Values.pointValue(CoordinateReferenceSystem.Cartesian_3D, 0.0000043, -0.0000000012341025786543, 666), Values.pointValue(CoordinateReferenceSystem.Cartesian_3D, 0.2000043, -0.0300000012341025786543, 555) }));
        }
 public override void WriteDuration(long months, long days, long seconds, int nanos)
 {
     WriteValue(DurationValue.duration(months, days, seconds, nanos));
 }
Example #14
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldEncodeArrays()
        public virtual void ShouldEncodeArrays()
        {
            AssertEncoding("D1.0|2.0|3.0|", new int[] { 1, 2, 3 });
            AssertEncoding("Ztrue|false|", new bool[] { true, false });
            AssertEncoding("LYWxp|YXJl|eW91|b2s=|", new string[] { "ali", "are", "you", "ok" });
            AssertEncoding("", new string[] {});
            AssertEncoding("P1:4326:1.234;2.567|1:4326:2.345;5.678|2:9157:3.0;4.0;5.0|", new Point[] { Values.pointValue(CoordinateReferenceSystem.WGS84, 1.234, 2.567), Values.pointValue(CoordinateReferenceSystem.WGS84, 2.345, 5.678), Values.pointValue(CoordinateReferenceSystem.Cartesian_3D, 3, 4, 5) });
            AssertEncoding("T1991-03-05|1992-04-06|", new LocalDate[] { DateValue.date(1991, 3, 5).asObjectCopy(), DateValue.date(1992, 4, 6).asObjectCopy() });
            AssertEncoding("T12:45:13.000008676|05:04:50.000000076|", new LocalTime[] { LocalTimeValue.localTime(12, 45, 13, 8676).asObjectCopy(), LocalTimeValue.localTime(5, 4, 50, 76).asObjectCopy() });
            AssertEncoding("T1991-03-05T12:45:13.000008676|1992-04-06T05:04:50.000000076|", new DateTime[] { LocalDateTimeValue.localDateTime(1991, 3, 5, 12, 45, 13, 8676).asObjectCopy(), LocalDateTimeValue.localDateTime(1992, 4, 6, 5, 4, 50, 76).asObjectCopy() });
            AssertEncoding("T02:45:13.000008676Z|01:05:00.0000003+01:00|05:04:50.000000076+05:00|", new OffsetTime[] { TimeValue.time(2, 45, 13, 8676, UTC).asObjectCopy(), TimeValue.time(OffsetTime.ofInstant(Instant.ofEpochSecond(300, 300), ZoneId.of("Europe/Stockholm"))).asObjectCopy(), TimeValue.time(5, 4, 50, 76, "+05:00").asObjectCopy() });
            AssertEncoding("T1991-03-05T02:45:13.000008676Z|1991-03-05T02:45:13.000008676+01:00[Europe/Stockholm]|1992-04-06T05:04:50.000000076+05:00|", new ZonedDateTime[] { DateTimeValue.datetime(1991, 3, 5, 2, 45, 13, 8676, UTC).asObjectCopy(), DateTimeValue.datetime(1991, 3, 5, 2, 45, 13, 8676, ZoneId.of("Europe/Stockholm")).asObjectCopy(), DateTimeValue.datetime(1992, 4, 6, 5, 4, 50, 76, "+05:00").asObjectCopy() });
            AssertEncoding("AP165Y11M3DT5.000000012S|P166Y4DT6.000000005S|", new TemporalAmount[] { DurationValue.duration(1991, 3, 5, 12).asObjectCopy(), DurationValue.duration(1992, 4, 6, 5).asObjectCopy() });
        }
Example #15
0
            public Compatibility(IndexProviderCompatibilityTestSuite testSuite, IndexDescriptor descriptor)
            {
                this.TestSuite  = testSuite;
                this.Descriptor = descriptor.WithId(17);
                this.ValueSet1  = AllValues(testSuite.SupportsSpatial(), Arrays.asList(Values.of("string1"), Values.of(42), Values.of(true), Values.of(new char[] { 'a', 'z' }), Values.of(new string[] { "arrayString1", "arraysString2" }), Values.of(new sbyte[] { (sbyte)1, (sbyte)12 }), Values.of(new short[] { 314, 1337 }), Values.of(new int[] { 3140, 13370 }), Values.of(new long[] { 31400, 133700 }), Values.of(new bool[] { true, true })), Arrays.asList(DateValue.epochDate(2), LocalTimeValue.localTime(100000), TimeValue.time(43_200_000_000_000L, ZoneOffset.UTC), TimeValue.time(43_201_000_000_000L, ZoneOffset.UTC), TimeValue.time(43_200_000_000_000L, ZoneOffset.of("+01:00")), TimeValue.time(46_800_000_000_000L, ZoneOffset.UTC), LocalDateTimeValue.localDateTime(2018, 3, 1, 13, 50, 42, 1337), DateTimeValue.datetime(2014, 3, 25, 12, 45, 13, 7474, "UTC"), DateTimeValue.datetime(2014, 3, 25, 12, 45, 13, 7474, "Europe/Stockholm"), DateTimeValue.datetime(2014, 3, 25, 12, 45, 13, 7474, "+05:00"), DateTimeValue.datetime(2015, 3, 25, 12, 45, 13, 7474, "+05:00"), DateTimeValue.datetime(2014, 4, 25, 12, 45, 13, 7474, "+05:00"), DateTimeValue.datetime(2014, 3, 26, 12, 45, 13, 7474, "+05:00"), DateTimeValue.datetime(2014, 3, 25, 13, 45, 13, 7474, "+05:00"), DateTimeValue.datetime(2014, 3, 25, 12, 46, 13, 7474, "+05:00"), DateTimeValue.datetime(2014, 3, 25, 12, 45, 14, 7474, "+05:00"), DateTimeValue.datetime(2014, 3, 25, 12, 45, 13, 7475, "+05:00"), DateTimeValue.datetime(2038, 1, 18, 9, 14, 7, 0, "-18:00"), DateTimeValue.datetime(10000, 100, ZoneOffset.ofTotalSeconds(3)), DateTimeValue.datetime(10000, 101, ZoneOffset.ofTotalSeconds(-3)), DurationValue.duration(10, 20, 30, 40), DurationValue.duration(11, 20, 30, 40), DurationValue.duration(10, 21, 30, 40), DurationValue.duration(10, 20, 31, 40), DurationValue.duration(10, 20, 30, 41), Values.dateTimeArray(new ZonedDateTime[] { ZonedDateTime.of(2018, 10, 9, 8, 7, 6, 5, ZoneId.of("UTC")), ZonedDateTime.of(2017, 9, 8, 7, 6, 5, 4, ZoneId.of("UTC")) }), Values.localDateTimeArray(new DateTime[] { new DateTime(2018, 10, 9, 8, 7, 6, 5), new DateTime(2018, 10, 9, 8, 7, 6, 5) }), Values.timeArray(new OffsetTime[] { OffsetTime.of(20, 8, 7, 6, ZoneOffset.UTC), OffsetTime.of(20, 8, 7, 6, ZoneOffset.UTC) }), Values.dateArray(new LocalDate[] { LocalDate.of(1, 12, 28), LocalDate.of(1, 12, 28) }), Values.localTimeArray(new LocalTime[] { LocalTime.of(9, 28), LocalTime.of(9, 28) }), Values.durationArray(new DurationValue[] { DurationValue.duration(12, 10, 10, 10), DurationValue.duration(12, 10, 10, 10) })), Arrays.asList(Values.pointValue(CoordinateReferenceSystem.Cartesian, 0, 0), Values.pointValue(CoordinateReferenceSystem.WGS84, 12.78, 56.7)));

                this.ValueSet2 = AllValues(testSuite.SupportsSpatial(), Arrays.asList(Values.of("string2"), Values.of(1337), Values.of(false), Values.of(new char[] { 'b', 'c' }), Values.of(new string[] { "someString1", "someString2" }), Values.of(new sbyte[] { (sbyte)9, (sbyte)9 }), Values.of(new short[] { 99, 999 }), Values.of(new int[] { 99999, 99999 }), Values.of(new long[] { 999999, 999999 }), Values.of(new bool[] { false, false })), Arrays.asList(DateValue.epochDate(42), LocalTimeValue.localTime(2000), TimeValue.time(100L, ZoneOffset.UTC), LocalDateTimeValue.localDateTime(2018, 2, 28, 11, 5, 1, 42), DateTimeValue.datetime(1999, 12, 31, 23, 59, 59, 123456789, "Europe/London"), DurationValue.duration(4, 3, 2, 1), Values.dateTimeArray(new ZonedDateTime[] { ZonedDateTime.of(999, 10, 9, 8, 7, 6, 5, ZoneId.of("UTC")), ZonedDateTime.of(999, 9, 8, 7, 6, 5, 4, ZoneId.of("UTC")) }), Values.localDateTimeArray(new DateTime[] { new DateTime(999, 10, 9, 8, 7, 6, 5), new DateTime(999, 10, 9, 8, 7, 6, 5) }), Values.timeArray(new OffsetTime[] { OffsetTime.of(19, 8, 7, 6, ZoneOffset.UTC), OffsetTime.of(19, 8, 7, 6, ZoneOffset.UTC) }), Values.dateArray(new LocalDate[] { LocalDate.of(999, 12, 28), LocalDate.of(999, 12, 28) }), Values.localTimeArray(new LocalTime[] { LocalTime.of(19, 28), LocalTime.of(19, 28) }), Values.durationArray(new DurationValue[] { DurationValue.duration(99, 10, 10, 10), DurationValue.duration(99, 10, 10, 10) })), Arrays.asList(Values.pointValue(CoordinateReferenceSystem.Cartesian, 90, 90), Values.pointValue(CoordinateReferenceSystem.WGS84, 9.21, 9.65)));

                PageCacheAndDependenciesRule = (new PageCacheAndDependenciesRule()).with(new DefaultFileSystemRule()).with(testSuite.GetType());
                Random    = new RandomRule();
                RuleChain = RuleChain.outerRule(PageCacheAndDependenciesRule).around(Random);
            }
Example #16
0
 public override TemporalAmount MapDuration(DurationValue value)
 {
     return(value.AsObjectCopy());
 }
        /// <summary>
        /// Populates this medication instance from the data in the XML.
        /// </summary>
        /// 
        /// <param name="typeSpecificXml">
        /// The XML to get the medication data from.
        /// </param>
        /// 
        /// <exception cref="InvalidOperationException">
        /// If the first node in <paramref name="typeSpecificXml"/> is not
        /// a medication node.
        /// </exception>
        /// 
        protected override void ParseXml(IXPathNavigable typeSpecificXml)
        {
            XPathNavigator itemNav =
                typeSpecificXml.CreateNavigator().SelectSingleNode("medication");

            Validator.ThrowInvalidIfNull(itemNav, "MedicationUnexpectedNode");

            // <name>
            _name =
                XPathHelper.GetOptNavValue(itemNav, "name");

            // <code>
            _code.Clear();
            XPathNodeIterator codeIterator = itemNav.Select("code");
            foreach (XPathNavigator codeNav in codeIterator)
            {
                _code.Add(codeNav.ValueAsInt);
            }

            // <date-discontinued>
            _dateDiscontinued =
                XPathHelper.GetOptNavValue<ApproximateDateTime>(
                    itemNav,
                    "date-discontinued");

            // <date-filled>
            _dateFilled =
                XPathHelper.GetOptNavValue<ApproximateDateTime>(
                    itemNav,
                    "date-filled");

            // <date-prescribed>
            _datePrescribed =
                XPathHelper.GetOptNavValue<ApproximateDateTime>(
                    itemNav,
                    "date-prescribed");

            // <is-prescribed>
            _isPrescribed =
                XPathHelper.GetOptNavValueAsBool(itemNav, "is-prescribed");

            // <indication>
            _indication =
                XPathHelper.GetOptNavValue(itemNav, "indication");

            // <amount-prescribed>
            _amountPrescribed =
                XPathHelper.GetOptNavValue(itemNav, "amount-prescribed");

            // <dose-value>
            _doseValue =
                XPathHelper.GetOptNavValue<DoseValue>(itemNav, "dose-value");

            // <dose-unit>
            _doseUnit =
                XPathHelper.GetOptNavValue<CodableValue>(
                    itemNav,
                    "dose-unit");

            // <strength-value>
            _strengthValue =
                XPathHelper.GetOptNavValueAsInt(itemNav, "strength-value");

            // <strength-unit>
            _strengthUnit =
                XPathHelper.GetOptNavValue<CodableValue>(
                    itemNav,
                    "strength-unit");

            // <frequency>
            _frequency =
                XPathHelper.GetOptNavValue(itemNav, "frequency");

            // <route>
            _route =
                XPathHelper.GetOptNavValue<CodableValue>(
                    itemNav,
                    "route");

            // <duration>
            _duration =
                XPathHelper.GetOptNavValue(
                    itemNav,
                    "duration");

            // <duration-unit>
            _durationUnit =
                XPathHelper.GetOptNavValue<CodableValue>(
                    itemNav,
                    "duration-unit");

            // <refills>
            _refills =
                XPathHelper.GetOptNavValueAsInt(itemNav, "refills");

            // <refills-left>
            _refillsLeft =
                XPathHelper.GetOptNavValueAsInt(itemNav, "refills-left");

            // <days-supply>
            _daysSupply =
                XPathHelper.GetOptNavValueAsInt(itemNav, "days-supply");

            // <prescription-duration>
            _prescriptionDuration =
                XPathHelper.GetOptNavValue<DurationValue>(
                    itemNav,
                    "prescription-duration");

            // <instructions>
            _instructions =
                XPathHelper.GetOptNavValue(itemNav, "instructions");

            // <substitution-permitted>
            _substitutionPermitted =
                XPathHelper.GetOptNavValueAsBool(
                    itemNav,
                    "substitution-permitted");

            // <pharmacy>
            _pharmacy =
                XPathHelper.GetOptNavValue<ContactInfo>(
                    itemNav,
                    "pharmacy");

            // <prescription-number>
            _prescriptionNumber =
                XPathHelper.GetOptNavValue(
                    itemNav,
                    "prescription-number");
        }
        /// <summary>
        /// Populates this medical encounter instance from the data in the XML.
        /// </summary>
        /// 
        /// <param name="typeSpecificXml">
        /// The XML to get the medical encounter data from.
        /// </param>
        /// 
        /// <exception cref="InvalidOperationException">
        /// The first node in <paramref name="typeSpecificXml"/> is not
        /// a medical encounter node.
        /// </exception>
        /// 
        protected override void ParseXml(IXPathNavigable typeSpecificXml)
        {
            XPathNavigator itemNav =
                typeSpecificXml.CreateNavigator().SelectSingleNode("encounter");

            Validator.ThrowInvalidIfNull(itemNav, "EncounterUnexpectedNode");

            // <when>
            _when = new HealthServiceDateTime();
            _when.ParseXml(itemNav.SelectSingleNode("when"));

            // <type>
            _type = XPathHelper.GetOptNavValue(itemNav, "type");

            // <id>
            _id = XPathHelper.GetOptNavValue(itemNav, "id");

            // <duration>
            _duration =
                XPathHelper.GetOptNavValue<DurationValue>(
                    itemNav,
                    "duration");

            // <location>
            _location =
                XPathHelper.GetOptNavValue<Address>(
                    itemNav,
                    "location");

            // <consent-granted>
            _consentGranted =
                XPathHelper.GetOptNavValueAsBool(
                    itemNav,
                    "consent-granted");
        }
Example #19
0
        public static object GetTypedValue(this XPathItem item)
        {
            XPathNavigator nav = item as XPathNavigator;

            if (nav == null)
            {
                return(item.TypedValue);
            }
            IXmlSchemaInfo schemaInfo = nav.SchemaInfo;

            if (schemaInfo == null || schemaInfo.SchemaType == null)
            {
                switch (nav.NodeType)
                {
                case XPathNodeType.Comment:
                case XPathNodeType.ProcessingInstruction:
                case XPathNodeType.Namespace:
                    return(nav.Value);

                default:
                    return(new UntypedAtomic(nav.Value));
                }
            }
            XmlTypeCode typeCode = schemaInfo.SchemaType.TypeCode;

            if (typeCode == XmlTypeCode.AnyAtomicType && schemaInfo.MemberType != null)
            {
                typeCode = schemaInfo.MemberType.TypeCode;
            }
            switch (typeCode)
            {
            case XmlTypeCode.UntypedAtomic:
                return(new UntypedAtomic(nav.Value));

            case XmlTypeCode.Integer:
            case XmlTypeCode.PositiveInteger:
            case XmlTypeCode.NegativeInteger:
            case XmlTypeCode.NonPositiveInteger:
                return((Integer)(decimal)nav.TypedValue);

            case XmlTypeCode.Date:
                return(DateValue.Parse(nav.Value));

            case XmlTypeCode.DateTime:
                return(DateTimeValue.Parse(nav.Value));

            case XmlTypeCode.Time:
                return(TimeValue.Parse(nav.Value));

            case XmlTypeCode.Duration:
                return(DurationValue.Parse(nav.Value));

            case XmlTypeCode.DayTimeDuration:
                return(new DayTimeDurationValue((TimeSpan)nav.TypedValue));

            case XmlTypeCode.YearMonthDuration:
                return(new YearMonthDurationValue((TimeSpan)nav.TypedValue));

            case XmlTypeCode.GDay:
                return(GDayValue.Parse(nav.Value));

            case XmlTypeCode.GMonth:
                return(GMonthValue.Parse(nav.Value));

            case XmlTypeCode.GMonthDay:
                return(GMonthDayValue.Parse(nav.Value));

            case XmlTypeCode.GYear:
                return(GYearValue.Parse(nav.Value));

            case XmlTypeCode.GYearMonth:
                return(GYearMonthValue.Parse(nav.Value));

            case XmlTypeCode.QName:
            case XmlTypeCode.Notation:
            {
                XmlNamespaceManager nsmgr = new XmlNamespaceManager(nav.NameTable);
                ExtFuncs.ScanLocalNamespaces(nsmgr, nav.Clone(), true);
                if (schemaInfo.SchemaType.TypeCode == XmlTypeCode.Notation)
                {
                    return(NotationValue.Parse(nav.Value, nsmgr));
                }
                else
                {
                    return(QNameValue.Parse(nav.Value, nsmgr));
                }
            }

            case XmlTypeCode.AnyUri:
                return(new AnyUriValue(nav.Value));

            case XmlTypeCode.HexBinary:
                return(new HexBinaryValue((byte[])nav.TypedValue));

            case XmlTypeCode.Base64Binary:
                return(new Base64BinaryValue((byte[])nav.TypedValue));

            case XmlTypeCode.Idref:
                if (schemaInfo.SchemaType == SequenceType.XmlSchema.IDREFS)
                {
                    return(new IDREFSValue((string[])nav.TypedValue));
                }
                goto default;

            case XmlTypeCode.NmToken:
                if (schemaInfo.SchemaType == SequenceType.XmlSchema.NMTOKENS)
                {
                    return(new NMTOKENSValue((string[])nav.TypedValue));
                }
                goto default;

            case XmlTypeCode.Entity:
                if (schemaInfo.SchemaType == SequenceType.XmlSchema.ENTITIES)
                {
                    return(new ENTITIESValue((string[])nav.TypedValue));
                }
                goto default;

            default:
                return(nav.TypedValue);
            }
        }
Example #20
0
        public static object ChangeType(XmlSchemaType xmlType, object value, SequenceType type,
                                        XmlNameTable nameTable, XmlNamespaceManager nsmgr)
        {
            if (type.TypeCode == XmlTypeCode.AnyAtomicType || xmlType.TypeCode == type.TypeCode)
            {
                return(value);
            }
            try
            {
                switch (xmlType.TypeCode)
                {
                case XmlTypeCode.String:
                case XmlTypeCode.UntypedAtomic:
                    switch (type.TypeCode)
                    {
                    case XmlTypeCode.UntypedAtomic:
                        return(new UntypedAtomic(value.ToString()));

                    case XmlTypeCode.String:
                        return(value.ToString());

                    case XmlTypeCode.DateTime:
                        return(DateTimeValue.Parse(value.ToString()));

                    case XmlTypeCode.Date:
                        return(DateValue.Parse(value.ToString()));

                    case XmlTypeCode.Time:
                        return(TimeValue.Parse(value.ToString()));

                    case XmlTypeCode.GYearMonth:
                        return(GYearMonthValue.Parse(value.ToString()));

                    case XmlTypeCode.GYear:
                        return(GYearValue.Parse(value.ToString()));

                    case XmlTypeCode.GMonth:
                        return(GMonthValue.Parse(value.ToString()));

                    case XmlTypeCode.GMonthDay:
                        return(GMonthDayValue.Parse(value.ToString()));

                    case XmlTypeCode.GDay:
                        return(GDayValue.Parse(value.ToString()));

                    case XmlTypeCode.Duration:
                        return(DurationValue.Parse(value.ToString()));

                    case XmlTypeCode.QName:
                        if (xmlType.TypeCode == XmlTypeCode.UntypedAtomic)
                        {
                            throw new XPath2Exception("XPTY0004", Properties.Resources.XPTY0004,
                                                      new SequenceType(xmlType, XmlTypeCardinality.One, null), type);
                        }
                        return(QNameValue.Parse(value.ToString(), nsmgr));

                    case XmlTypeCode.Notation:
                        return(NotationValue.Parse(value.ToString(), nsmgr));

                    case XmlTypeCode.AnyUri:
                        return(new AnyUriValue(value.ToString()));

                    default:
                    {
                        string text = value.ToString();
                        object res  = type.SchemaType.Datatype.ParseValue(text, nameTable, nsmgr);
                        switch (type.TypeCode)
                        {
                        case XmlTypeCode.Integer:
                        case XmlTypeCode.PositiveInteger:
                        case XmlTypeCode.NegativeInteger:
                        case XmlTypeCode.NonPositiveInteger:
                        case XmlTypeCode.NonNegativeInteger:
                            return((Integer)Convert.ToDecimal(res));

                        case XmlTypeCode.DayTimeDuration:
                            return(new DayTimeDurationValue((TimeSpan)res));

                        case XmlTypeCode.YearMonthDuration:
                            return(new YearMonthDurationValue((TimeSpan)res));

                        case XmlTypeCode.HexBinary:
                            return(new HexBinaryValue((byte[])res));

                        case XmlTypeCode.Base64Binary:
                            if (text.EndsWith("==") && (text.Length < 3 || "AQgw".IndexOf(text[text.Length - 3]) == -1))
                            {
                                throw new XPath2Exception("FORG0001", Properties.Resources.FORG0001, value);
                            }
                            return(new Base64BinaryValue((byte[])res));

                        case XmlTypeCode.Idref:
                            if (type.SchemaType == SequenceType.XmlSchema.IDREFS)
                            {
                                return(new IDREFSValue((string[])res));
                            }
                            goto default;

                        case XmlTypeCode.NmToken:
                            if (type.SchemaType == SequenceType.XmlSchema.NMTOKENS)
                            {
                                return(new NMTOKENSValue((string[])res));
                            }
                            goto default;

                        case XmlTypeCode.Entity:
                            if (type.SchemaType == SequenceType.XmlSchema.ENTITIES)
                            {
                                return(new ENTITIESValue((string[])res));
                            }
                            goto default;

                        default:
                            return(res);
                        }
                    }
                    }

                case XmlTypeCode.Boolean:
                    switch (type.TypeCode)
                    {
                    case XmlTypeCode.Decimal:
                    case XmlTypeCode.Float:
                    case XmlTypeCode.Double:
                    case XmlTypeCode.Integer:
                    case XmlTypeCode.NonPositiveInteger:
                    case XmlTypeCode.NegativeInteger:
                    case XmlTypeCode.Long:
                    case XmlTypeCode.Int:
                    case XmlTypeCode.Short:
                    case XmlTypeCode.Byte:
                    case XmlTypeCode.NonNegativeInteger:
                    case XmlTypeCode.UnsignedLong:
                    case XmlTypeCode.UnsignedInt:
                    case XmlTypeCode.UnsignedShort:
                    case XmlTypeCode.UnsignedByte:
                    case XmlTypeCode.PositiveInteger:
                        return(ChangeType(value, type.ItemType));

                    case XmlTypeCode.String:
                        return(XPath2Convert.ToString((bool)value));

                    case XmlTypeCode.UntypedAtomic:
                        return(new UntypedAtomic(XPath2Convert.ToString((bool)value)));
                    }
                    break;

                case XmlTypeCode.Integer:
                case XmlTypeCode.NonPositiveInteger:
                case XmlTypeCode.NegativeInteger:
                case XmlTypeCode.Long:
                case XmlTypeCode.Int:
                case XmlTypeCode.Short:
                case XmlTypeCode.Byte:
                case XmlTypeCode.NonNegativeInteger:
                case XmlTypeCode.UnsignedLong:
                case XmlTypeCode.UnsignedInt:
                case XmlTypeCode.UnsignedShort:
                case XmlTypeCode.UnsignedByte:
                case XmlTypeCode.PositiveInteger:
                case XmlTypeCode.Decimal:
                case XmlTypeCode.Float:
                case XmlTypeCode.Double:
                    switch (type.TypeCode)
                    {
                    case XmlTypeCode.String:
                        return(ToString(value));

                    case XmlTypeCode.UntypedAtomic:
                        return(new UntypedAtomic(ToString(value)));

                    case XmlTypeCode.Boolean:
                        return(CoreFuncs.BooleanValue(value));

                    case XmlTypeCode.AnyUri:
                        throw new XPath2Exception("XPTY0004", Properties.Resources.XPTY0004,
                                                  new SequenceType(xmlType, XmlTypeCardinality.One, null), type);

                    default:
                        return(ChangeType(value, type.ItemType));
                    }

                default:
                {
                    IXmlConvertable convert = value as IXmlConvertable;
                    if (convert != null)
                    {
                        return(convert.ValueAs(type, nsmgr));
                    }
                    if (type.TypeCode == XmlTypeCode.String)
                    {
                        return(ToString(value));
                    }
                    if (type.TypeCode == XmlTypeCode.UntypedAtomic)
                    {
                        return(new UntypedAtomic(ToString(value)));
                    }
                    return(type.SchemaType.Datatype.ChangeType(value, type.ValueType));
                }
                }
            }
            catch (XmlSchemaException ex)
            {
                throw new XPath2Exception(ex.Message, ex);
            }
            catch (InvalidCastException)
            {
                throw new XPath2Exception("XPTY0004", Properties.Resources.XPTY0004,
                                          new SequenceType(xmlType, XmlTypeCardinality.One, null), type);
            }
            catch (FormatException)
            {
                throw new XPath2Exception("XPTY0004", Properties.Resources.XPTY0004,
                                          new SequenceType(xmlType, XmlTypeCardinality.One, null), type);
            }
            throw new XPath2Exception("XPTY0004", Properties.Resources.XPTY0004,
                                      new SequenceType(xmlType, XmlTypeCardinality.One, null), type);
        }
Example #21
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void compareGenericKeyState()
        internal virtual void CompareGenericKeyState()
        {
            IList <Value> allValues = Arrays.asList(Values.of("string1"), Values.of(42), Values.of(true), Values.of(new char[] { 'a', 'z' }), Values.of(new string[] { "arrayString1", "arraysString2" }), Values.of(new sbyte[] { ( sbyte )1, ( sbyte )12 }), Values.of(new short[] { 314, 1337 }), Values.of(new int[] { 3140, 13370 }), Values.of(new long[] { 31400, 133700 }), Values.of(new bool[] { false, true }), DateValue.epochDate(2), LocalTimeValue.localTime(100000), TimeValue.time(43_200_000_000_000L, ZoneOffset.UTC), TimeValue.time(43_201_000_000_000L, ZoneOffset.UTC), TimeValue.time(43_200_000_000_000L, ZoneOffset.of("+01:00")), TimeValue.time(46_800_000_000_000L, ZoneOffset.UTC), LocalDateTimeValue.localDateTime(2018, 3, 1, 13, 50, 42, 1337), DateTimeValue.datetime(2014, 3, 25, 12, 45, 13, 7474, "UTC"), DateTimeValue.datetime(2014, 3, 25, 12, 45, 13, 7474, "Europe/Stockholm"), DateTimeValue.datetime(2014, 3, 25, 12, 45, 13, 7474, "+05:00"), DateTimeValue.datetime(2015, 3, 25, 12, 45, 13, 7474, "+05:00"), DateTimeValue.datetime(2014, 4, 25, 12, 45, 13, 7474, "+05:00"), DateTimeValue.datetime(2014, 3, 26, 12, 45, 13, 7474, "+05:00"), DateTimeValue.datetime(2014, 3, 25, 13, 45, 13, 7474, "+05:00"), DateTimeValue.datetime(2014, 3, 25, 12, 46, 13, 7474, "+05:00"), DateTimeValue.datetime(2014, 3, 25, 12, 45, 14, 7474, "+05:00"), DateTimeValue.datetime(2014, 3, 25, 12, 45, 13, 7475, "+05:00"), DateTimeValue.datetime(2038, 1, 18, 9, 14, 7, 0, "-18:00"), DateTimeValue.datetime(10000, 100, ZoneOffset.ofTotalSeconds(3)), DateTimeValue.datetime(10000, 101, ZoneOffset.ofTotalSeconds(-3)), DurationValue.duration(10, 20, 30, 40), DurationValue.duration(11, 20, 30, 40), DurationValue.duration(10, 21, 30, 40), DurationValue.duration(10, 20, 31, 40), DurationValue.duration(10, 20, 30, 41), Values.dateTimeArray(new ZonedDateTime[] { ZonedDateTime.of(2018, 10, 9, 8, 7, 6, 5, ZoneId.of("UTC")), ZonedDateTime.of(2017, 9, 8, 7, 6, 5, 4, ZoneId.of("UTC")) }), Values.localDateTimeArray(new DateTime[] { new DateTime(2018, 10, 9, 8, 7, 6, 5), new DateTime(2018, 10, 9, 8, 7, 6, 5) }), Values.timeArray(new OffsetTime[] { OffsetTime.of(20, 8, 7, 6, ZoneOffset.UTC), OffsetTime.of(20, 8, 7, 6, ZoneOffset.UTC) }), Values.dateArray(new LocalDate[] { LocalDate.of(2018, 12, 28), LocalDate.of(2018, 12, 28) }), Values.localTimeArray(new LocalTime[] { LocalTime.of(9, 28), LocalTime.of(9, 28) }), Values.durationArray(new DurationValue[] { DurationValue.duration(12, 10, 10, 10), DurationValue.duration(12, 10, 10, 10) }));

            allValues.sort(Values.COMPARATOR);

            IList <GenericKey> states = new List <GenericKey>();

            foreach (Value value in allValues)
            {
                GenericKey state = new GenericKey(null);
                state.WriteValue(value, NativeIndexKey.Inclusion.Neutral);
                states.Add(state);
            }
            Collections.shuffle(states);
//JAVA TO C# CONVERTER TODO TASK: Method reference arbitrary object instance method syntax is not converted by Java to C# Converter:
            states.sort(GenericKey::compareValueTo);
//JAVA TO C# CONVERTER TODO TASK: Method reference arbitrary object instance method syntax is not converted by Java to C# Converter:
            IList <Value> sortedStatesAsValues = states.Select(GenericKey::asValue).ToList();

            assertEquals(allValues, sortedStatesAsValues);
        }
 public override AnyValue MapDuration(DurationValue value)
 {
     return(value);
 }
        /// <summary>
        /// Populates this family history instance from the data in the XML.
        /// </summary>
        /// 
        /// <param name="typeSpecificXml">
        /// The XML to get the family history data from.
        /// </param>
        /// 
        /// <exception cref="InvalidOperationException">
        /// The first node in <paramref name="typeSpecificXml"/> is not
        /// a family history node.
        /// </exception>
        /// 
        protected override void ParseXml(IXPathNavigable typeSpecificXml)
        {
            XPathNavigator itemNav =
                typeSpecificXml.CreateNavigator().SelectSingleNode("family-history");

            Validator.ThrowInvalidIfNull(itemNav, "FamilyHistoryUnexpectedNode");

            // <condition>
            _condition = new CodableValue();
            _condition.ParseXml(itemNav.SelectSingleNode("condition"));

            // <relationship>
            _relationship =
                XPathHelper.GetOptNavValue<CodableValue>(
                    itemNav,
                    "relationship");

            // <date-of-birth>
            _dateOfBirth =
                XPathHelper.GetOptNavValue<ApproximateDate>(
                    itemNav,
                    "date-of-birth");

            // <age-of-onset>
            _ageOfOnset =
                XPathHelper.GetOptNavValueAsInt(
                    itemNav,
                    "age-of-onset");

            // <age-of-resolution>
            _ageOfResolution =
                XPathHelper.GetOptNavValueAsInt(
                    itemNav,
                    "age-of-resolution");

            // <duration>
            _duration =
                XPathHelper.GetOptNavValue<DurationValue>(
                    itemNav,
                    "duration");

            // <severity>
            _severity = XPathHelper.GetOptNavValue(itemNav, "severity");

            // <is-recurring>
            _isRecurring =
                XPathHelper.GetOptNavValueAsBool(itemNav, "is-recurring");

            // <status>
            _status =
                XPathHelper.GetOptNavValue<CodableValue>(
                    itemNav,
                    "status");
        }
Example #24
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void writeDuration(long months, long days, long seconds, int nanos) throws RuntimeException
            public override void WriteDuration(long months, long days, long seconds, int nanos)
            {
                Builder.Append(DurationValue.duration(months, days, seconds, nanos).prettyPrint());
                Builder.Append('|');
            }
Example #25
0
 public override ListValue MapDuration(DurationValue value)
 {
     return(null);
 }