-
Notifications
You must be signed in to change notification settings - Fork 1
/
ITemporalQuery.xml
129 lines (129 loc) · 8.68 KB
/
ITemporalQuery.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<Type Name="ITemporalQuery" FullName="Java.Time.Temporal.ITemporalQuery">
<TypeSignature Language="C#" Value="public interface ITemporalQuery : Android.Runtime.IJavaObject, IDisposable, Java.Interop.IJavaPeerable" />
<TypeSignature Language="ILAsm" Value=".class public interface auto ansi abstract beforefieldinit ITemporalQuery implements class Android.Runtime.IJavaObject, class Java.Interop.IJavaPeerable, class System.IDisposable" />
<TypeSignature Language="DocId" Value="T:Java.Time.Temporal.ITemporalQuery" />
<TypeSignature Language="F#" Value="type ITemporalQuery = interface
 interface IJavaObject
 interface IDisposable
 interface IJavaPeerable" />
<AssemblyInfo>
<AssemblyName>Mono.Android</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Interfaces>
<Interface>
<InterfaceName>Android.Runtime.IJavaObject</InterfaceName>
</Interface>
<Interface>
<InterfaceName>Java.Interop.IJavaPeerable</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.IDisposable</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<Attribute>
<AttributeName Language="C#">[Android.Runtime.Register("java/time/temporal/TemporalQuery", "", "Java.Time.Temporal.ITemporalQueryInvoker", ApiSince=26)]</AttributeName>
<AttributeName Language="F#">[<Android.Runtime.Register("java/time/temporal/TemporalQuery", "", "Java.Time.Temporal.ITemporalQueryInvoker", ApiSince=26)>]</AttributeName>
</Attribute>
<Attribute>
<AttributeName Language="C#">[Java.Interop.JavaTypeParameters(new System.String[] { "R" })]</AttributeName>
<AttributeName Language="F#">[<Java.Interop.JavaTypeParameters(new System.String[] { "R" })>]</AttributeName>
</Attribute>
</Attributes>
<Docs>
<param name="<R><R>">the type returned from the query</param>
<summary>Strategy for querying a temporal object.</summary>
<remarks>
<para>Strategy for querying a temporal object.</para>
<para>Queries are a key tool for extracting information from temporal objects.
They exist to externalize the process of querying, permitting different
approaches, as per the strategy design pattern.
Examples might be a query that checks if the date is the day before February 29th
in a leap year, or calculates the number of days to your next birthday.</para>
<para>The <c>TemporalField</c> interface provides another mechanism for querying
temporal objects. That interface is limited to returning a <c>long</c>.
By contrast, queries can return any type.</para>
<para>There are two equivalent ways of using a <c>TemporalQuery</c>.
The first is to invoke the method on this interface directly.
The second is to use <c>TemporalAccessor#query(TemporalQuery)</c>:</para>
<code lang="text/java">// these two lines are equivalent, but the second approach is recommended
temporal = thisQuery.queryFrom(temporal);
temporal = temporal.query(thisQuery);
</code>
<para>It is recommended to use the second approach, <c>query(TemporalQuery)</c>,
as it is a lot clearer to read in code.</para>
<para>The most common implementations are method references, such as
<c>LocalDate::from</c> and <c>ZoneId::from</c>.
Additional common queries are provided as static methods in <c>TemporalQueries</c>.</para>
<para>Added in 1.8.</para>
<para>
<format type="text/html">
<a href="https://developer.android.com/reference/java/time/temporal/TemporalQuery" title="Reference documentation">Java documentation for <code>java.time.temporal.TemporalQuery</code>.</a>
</format>
</para>
<para>
Portions of this page are modifications based on work created and shared by the
<format type="text/html"><a href="https://developers.google.com/terms/site-policies" title="Android Open Source Project">Android Open Source Project</a></format>
and used according to terms described in the
<format type="text/html"><a href="https://creativecommons.org/licenses/by/2.5/" title="Creative Commons 2.5 Attribution License">Creative Commons 2.5 Attribution License.</a></format></para>
</remarks>
</Docs>
<Members>
<Member MemberName="QueryFrom">
<MemberSignature Language="C#" Value="public Java.Lang.Object? QueryFrom (Java.Time.Temporal.ITemporalAccessor? temporal);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class Java.Lang.Object QueryFrom(class Java.Time.Temporal.ITemporalAccessor temporal) cil managed" />
<MemberSignature Language="DocId" Value="M:Java.Time.Temporal.ITemporalQuery.QueryFrom(Java.Time.Temporal.ITemporalAccessor)" />
<MemberSignature Language="F#" Value="abstract member QueryFrom : Java.Time.Temporal.ITemporalAccessor -> Java.Lang.Object" Usage="iTemporalQuery.QueryFrom temporal" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Mono.Android</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[Android.Runtime.Register("queryFrom", "(Ljava/time/temporal/TemporalAccessor;)Ljava/lang/Object;", "GetQueryFrom_Ljava_time_temporal_TemporalAccessor_Handler:Java.Time.Temporal.ITemporalQueryInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]</AttributeName>
<AttributeName Language="F#">[<Android.Runtime.Register("queryFrom", "(Ljava/time/temporal/TemporalAccessor;)Ljava/lang/Object;", "GetQueryFrom_Ljava_time_temporal_TemporalAccessor_Handler:Java.Time.Temporal.ITemporalQueryInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]</AttributeName>
</Attribute>
<Attribute>
<AttributeName Language="C#">[System.Runtime.Versioning.SupportedOSPlatform("android26.0")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.Versioning.SupportedOSPlatform("android26.0")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>Java.Lang.Object</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="temporal" Type="Java.Time.Temporal.ITemporalAccessor" />
</Parameters>
<Docs>
<param name="temporal">the temporal object to query, not null</param>
<summary>Queries the specified temporal object.</summary>
<returns>the queried value, may return null to indicate not found</returns>
<remarks>
<para>Queries the specified temporal object.</para>
<para>This queries the specified temporal object to return an object using the logic
encapsulated in the implementing class.
Examples might be a query that checks if the date is the day before February 29th
in a leap year, or calculates the number of days to your next birthday.</para>
<para>There are two equivalent ways of using this method.
The first is to invoke this method directly.
The second is to use <c>TemporalAccessor#query(TemporalQuery)</c>:</para>
<code lang="text/java">// these two lines are equivalent, but the second approach is recommended
temporal = thisQuery.queryFrom(temporal);
temporal = temporal.query(thisQuery);
</code>
<para>It is recommended to use the second approach, <c>query(TemporalQuery)</c>,
as it is a lot clearer to read in code.</para>
<para>
<format type="text/html">
<a href="https://developer.android.com/reference/java/time/temporal/TemporalQuery#queryFrom(java.time.temporal.TemporalAccessor)" title="Reference documentation">Java documentation for <code>java.time.temporal.TemporalQuery.queryFrom(java.time.temporal.TemporalAccessor)</code>.</a>
</format>
</para>
<para>
Portions of this page are modifications based on work created and shared by the
<format type="text/html"><a href="https://developers.google.com/terms/site-policies" title="Android Open Source Project">Android Open Source Project</a></format>
and used according to terms described in the
<format type="text/html"><a href="https://creativecommons.org/licenses/by/2.5/" title="Creative Commons 2.5 Attribution License">Creative Commons 2.5 Attribution License.</a></format></para>
</remarks>
</Docs>
</Member>
</Members>
</Type>