Debian Codegraph @

net/sf/saxon/ma/map/TupleType.java

raw symbols SCIP
1 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2 // Copyright (c) 2018 Saxonica Limited.
3 // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4 // If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 // This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0.
6 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
7
8 package net.sf.saxon.ma.map;
9
10 import net.sf.saxon.type.FunctionItemType;
11 import net.sf.saxon.value.SequenceType;
12
13 /**
14 * An instance of this class represents a specific tuple item type, for example
15 * tuple(x: xs:double, y: element(employee)).
16 *
17 * Tuple types are a Saxon extension introduced in Saxon 9.8. The syntax for constructing
18 * a tuple type requires Saxon-PE or higher, but the supporting code is included in
19 * Saxon-HE for convenience.
20 */
21 public interface TupleType extends FunctionItemType {
22
23 /**
24 * Get the names of all the fields
25 * @return the names of the fields (in arbitrary order)
26 */
27
28 Iterable<String> getFieldNames();
29
30 /**
31 * Get the type of a given field
32 * @param field the name of the field
33 * @return the type of the field if it is defined, or null otherwise
34 */
35
36 SequenceType getFieldType(String field);
37
38 /**
39 * Ask whether a particular field is optional (that is, allowed to be absent from the map)
40 * @param field the name of the field
41 * @return true if the field is optional
42 */
43
44 boolean isOptional(String field);
45
46 /**
47 * Ask whether the tuple type is extensible, that is, whether fields other than those named are permitted
48 * @return true if fields other than the named fields are permitted to appear
49 */
50
51 boolean isExtensible();
52
53
54 }
55
56 // Copyright (c) 2018 Saxonica Limited.