Class Shape

java.lang.Object
net.sf.saxon.ma.map.Shape

public class Shape extends Object
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 Details

  • Constructor Details

    • Shape

      public Shape(UnicodeString... keys)
    • Shape

      public Shape(RecordType recordTypeDefinition)
      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

      public int getSlot(UnicodeString key)
      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

      public UnicodeString getKey(int slot)
      Get the key associated with a particular slot number
      Parameters:
      slot - the slot number
      Returns:
      the associated key value
    • iterateKeys

      public AtomicIterator 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

      public ShapedMap make(GroundedValue... values)
      Make an instance of this Shape