phelps.doc

Class RobustLocation

public class RobustLocation extends Object

System support for robust locations. Kinds of locations: id, absolute position in text (sticky pointers), tree walk, perhaps later query/search. See Robust Locations paper.

To do

Version: $Revision: 1.6 $ $Date: 2003/06/01 08:07:10 $

Field Summary
static StringATTR_CONTEXT
static StringATTR_ID
static StringATTR_LENGTH
static StringATTR_TREE
Method Summary
static Markattach(Map<String,Object> attachme, INode toroot)
Given Hastable of descriptors, return corresponding node/offset, robust to change Returns null if couldn't attach (may throw exception in the future)
static MarkattachContent(Node subroot, String content, String pre, String post)
static NodeattachId(String id, String idkey, Node root)
Search tree rooted at root for ID attribute matching id (stored under key idkey, which is usually "id" or "idref").
static voidattachTree(Node n, String[] names, int[] posns, int ni, int fuzz, int depth, RobustLocation.Report sub)
static voiddescriptorFor(Node keepme, int offset, Node docroot, Map<String,Object> map)
Given node, write multiple, redundant location descriptors into passed Map.

Field Detail

ATTR_CONTEXT

public static final String ATTR_CONTEXT

ATTR_ID

public static final String ATTR_ID

ATTR_LENGTH

public static final String ATTR_LENGTH

ATTR_TREE

public static final String ATTR_TREE

Method Detail

attach

public static Mark attach(Map<String,Object> attachme, INode toroot)
Given Hastable of descriptors, return corresponding node/offset, robust to change Returns null if couldn't attach (may throw exception in the future)

attachContent

public static Mark attachContent(Node subroot, String content, String pre, String post)

attachId

public static Node attachId(String id, String idkey, Node root)
Search tree rooted at root for ID attribute matching id (stored under key idkey, which is usually "id" or "idref").

attachTree

public static void attachTree(Node n, String[] names, int[] posns, int ni, int fuzz, int depth, RobustLocation.Report sub)

descriptorFor

public static void descriptorFor(Node keepme, int offset, Node docroot, Map<String,Object> map)
Given node, write multiple, redundant location descriptors into passed Map. Result can be mapped back to tree by RobustLocation.