Package net.sf.saxon.ma.map
Class Shape
java.lang.Object
net.sf.saxon.ma.map.Shape
A
Shape represents the common structure of a set of ShapedMap objects,
each being a map with the same set of keys but different values. A Shape is essentially
a mapping from keys to integer slot positions.} An instance of a Shape is represented
by a ShapedMap.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final UnicodeStringstatic final Shapestatic final UnicodeString -
Constructor Summary
ConstructorsConstructorDescriptionShape(RecordType recordTypeDefinition) Derive the structure of a Shape from a RecordTest.Shape(UnicodeString... keys) -
Method Summary
Modifier and TypeMethodDescriptiongetKey(int slot) Get the key associated with a particular slot numberintgetSlot(UnicodeString key) Get the integer slot number allocated to a particular key, if anyReturn an iterator over the keys in this Shapemake(GroundedValue... values) Make an instance of this Shapeintsize()Get the number of keys in the Shape
-
Field Details
-
KEY
-
VALUE
-
KEY_VALUE_PAIR
-
-
Constructor Details
-
Shape
-
Shape
Derive the structure of a Shape from a RecordTest.- Parameters:
recordTypeDefinition- - an instance of RecordTest, populated with a list of field names
-
-
Method Details
-
size
public int size()Get the number of keys in the Shape- Returns:
- the number of distinct keys
-
getSlot
Get the integer slot number allocated to a particular key, if any- Parameters:
key- the relevant key- Returns:
- the slot number used for the specified key, or -1 if the key is not recognised
-
getKey
Get the key associated with a particular slot number- Parameters:
slot- the slot number- Returns:
- the associated key value
-
iterateKeys
Return an iterator over the keys in this Shape- Returns:
- an iterator over the keys, retaining the order in which they were originally supplied
-
make
Make an instance of this Shape
-