Skip to content

Commit 61ddaf8

Browse files
committed
add javadocs for new temporal methods
1 parent 12892e7 commit 61ddaf8

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed

src/main/java/com/marklogic/client/query/StructuredQueryBuilder.java

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2707,6 +2707,13 @@ private EditableNamespaceContext makeNamespaces() {
27072707
return newNamespaces;
27082708
}
27092709

2710+
/**
2711+
* The Allen and ISO SQL 2011 temporal operators available for use in
2712+
* {@link #temporalPeriodRange temporalPeriodRange}
2713+
* or {@link #temporalPeriodCompare temporalPeriodCompare} queries.
2714+
* @see <a href="http://docs.marklogic.com/guide/temporal/searching#id_78584">
2715+
* Temporal Developer's Guide -&gt; Period Comparison Operators</a>
2716+
*/
27102717
public enum TemporalOperator {
27112718
ALN_EQUALS,
27122719
ALN_CONTAINS,
@@ -2729,17 +2736,49 @@ public enum TemporalOperator {
27292736
ISO_IMM_PRECEDES,
27302737
ISO_EQUALS;
27312738
};
2739+
/**
2740+
* An axis for use in {@link #temporalPeriodRange temporalPeriodRange}
2741+
* or {@link #temporalPeriodCompare temporalPeriodCompare} queries.
2742+
*/
27322743
public interface Axis {};
2744+
/**
2745+
* A temporal period for use in {@link #temporalPeriodRange temporalPeriodRange}
2746+
* queries.
2747+
*/
27332748
public interface Period {};
27342749

2750+
/**
2751+
* Identify an axis for use in {@link #temporalPeriodRange temporalPeriodRange}
2752+
* or {@link #temporalPeriodCompare temporalPeriodCompare} queries.
2753+
* @param name the name of the axis as configured in the server
2754+
*/
27352755
public StructuredQueryBuilder.Axis axis(String name) {
27362756
return new TemporalAxis(name);
27372757
}
27382758

2759+
/**
2760+
* Construct a temporal period for use in {@link #temporalPeriodRange temporalPeriodRange}
2761+
* queries.
2762+
* @param start the start date/time for this period
2763+
* @param end the end date/time for this period
2764+
*/
27392765
public StructuredQueryBuilder.Period period(Calendar start, Calendar end) {
27402766
return new TemporalPeriod(start, end);
27412767
}
27422768

2769+
/**
2770+
* Matches documents that have a value in the specified axis that matches the specified
2771+
* period using the specified operator.
2772+
* @param axis the axis of document temporal values used to determine which documents have
2773+
* values that match this query
2774+
* @param operator the operator used to determine if values in the axis match the specified period
2775+
* @param period the period considered using the operator
2776+
* @param options string options from the list for
2777+
* <a href="http://docs.marklogic.com/cts:period-range-query">cts:period-range-query calls</a>
2778+
* @see <a href="http://docs.marklogic.com/cts:period-range-query">cts:period-range-query</a>
2779+
* @see <a href="http://docs.marklogic.com/guide/search-dev/structured-query#id_91434">
2780+
* Structured Queries: period-range-query</a>
2781+
*/
27432782
public StructuredQueryDefinition temporalPeriodRange(Axis axis, TemporalOperator operator,
27442783
Period period, String... options)
27452784
{
@@ -2748,6 +2787,18 @@ public StructuredQueryDefinition temporalPeriodRange(Axis axis, TemporalOperator
27482787
return temporalPeriodRange(new Axis[] {axis}, operator, new Period[] {period}, options);
27492788
}
27502789

2790+
/**
2791+
* @param axes the set of axes of document temporal values used to determine which documents have
2792+
* values that match this query
2793+
* @param operator the operator used to determine if values in the axis match the specified period
2794+
* @param periods the periods considered using the operator. When multiple periods are specified,
2795+
* the query matches if a value matches any period.
2796+
* @param options string options from the list for
2797+
* <a href="http://docs.marklogic.com/cts:period-range-query">cts:period-range-query calls</a>
2798+
* @see <a href="http://docs.marklogic.com/cts:period-range-query">cts:period-range-query</a>
2799+
* @see <a href="http://docs.marklogic.com/guide/search-dev/structured-query#id_91434">
2800+
* Structured Queries: period-range-query</a>
2801+
*/
27512802
public StructuredQueryDefinition temporalPeriodRange(Axis[] axes, TemporalOperator operator,
27522803
Period[] periods, String... options)
27532804
{
@@ -2757,6 +2808,19 @@ public StructuredQueryDefinition temporalPeriodRange(Axis[] axes, TemporalOperat
27572808
return new TemporalPeriodRangeQuery(axes, operator, periods, options);
27582809
}
27592810

2811+
/**
2812+
* Matches documents that have a relevant pair of period values. Values from axis1 must match
2813+
* values from axis2 using the specified operator.
2814+
* @param axis1 the first axis of document temporal values
2815+
* values that match this query
2816+
* @param operator the operator used to determine if values in the axis match the specified period
2817+
* @param axis2 the second axis of document temporal values
2818+
* @param options string options from the list for
2819+
* <a href="http://docs.marklogic.com/cts:period-compare-query">cts:period-compare-query calls</a>
2820+
* @see <a href="http://docs.marklogic.com/cts:period-compare-query">cts:period-compare-query</a>
2821+
* @see <a href="http://docs.marklogic.com/guide/search-dev/structured-query#id_19798">
2822+
* Structured Queries: period-compare-query</a>
2823+
*/
27602824
public StructuredQueryDefinition temporalPeriodCompare(Axis axis1, TemporalOperator operator,
27612825
Axis axis2, String... options)
27622826
{
@@ -2766,6 +2830,17 @@ public StructuredQueryDefinition temporalPeriodCompare(Axis axis1, TemporalOpera
27662830
return new TemporalPeriodCompareQuery(axis1, operator, axis2, options);
27672831
}
27682832

2833+
/**
2834+
* Matches documents with LSQT prior to timestamp
2835+
* @param temporalCollection the temporal collection to query
2836+
* @param timestamp documents with lsqt prior to this timestamp will match
2837+
* @param weight the weight for for this query
2838+
* @param options string options from the list for
2839+
* <a href="http://docs.marklogic.com/cts:lsqt-query">cts:lsqt-query calls</a>
2840+
* @see <a href="http://docs.marklogic.com/cts:lsqt-query">cts:lsqt-query</a>
2841+
* @see <a href="http://docs.marklogic.com/guide/search-dev/structured-query#id_85930">
2842+
* Structured Queries: lsqt-query</a>
2843+
*/
27692844
public StructuredQueryDefinition temporalLsqtQuery(String temporalCollection, Calendar timestamp,
27702845
double weight, String... options)
27712846
{

0 commit comments

Comments
 (0)