|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gedcomx.util.DocMap
public class DocMap
Utility class for simplifying the lookup of Person, SourceDescription, RecordDescription or Agent objects in a GedcomX document. Each object can be looked up by its local 'id' (with or without a preceding "#"), using a String or URI. Persons can also be looked up by any of their identifiers, and SourceDescriptions can be looked up by any of the identifiers of the entity they are describing. User: Randy Wilson Date: 6/9/14 Time: 3:53 PM
| Constructor Summary | |
|---|---|
DocMap(Gedcomx doc)
Constructor. |
|
| Method Summary | |
|---|---|
Agent |
getAgent(String agentId)
Find the Agent with the given local id. |
Agent |
getAgent(URI agentId)
Find the Agent with the given local id. |
static Map<String,Agent> |
getAgentMap(Gedcomx doc)
Create a map of local id (and "#" + id) to the Agent that has that id. |
Gedcomx |
getDocument()
Get the Gedcomx document that was used to create this DocMap. |
Person |
getMainPerson()
Get the Person described by the main SourceDescription. |
SourceDescription |
getMainSourceDescription()
Get the SourceDescription referenced by the GedcomX document's descriptionRef. |
Person |
getPerson(ResourceReference resourceReference)
Get the person from the GedcomX document that has the id given in the URI of the given ResourceReference. |
Person |
getPerson(String idOrUrl)
Get the person from the GedcomX document that has the given id (with or without "#") or an identifier that matches the given idOrUrl. |
Person |
getPerson(URI uri)
Get the person from the GedcomX document that has the given id (with or without "#") or identifier. |
static Map<String,Person> |
getPersonMap(Gedcomx doc)
Create a map of local id (and "#" + id) as well as all person identifiers to the local Person object with that id or identifier. |
PlaceDescription |
getPlaceDescription(PlaceReference placeReference)
Find the PlaceDescription with the given PlaceReference. |
PlaceDescription |
getPlaceDescription(String idOrUri)
Find the PlaceDescription with the given local id (or "#" + local id) or the given URI. |
PlaceDescription |
getPlaceDescription(URI placeDescriptionUri)
Find the PlaceDescription with the given local id (or "#" + local id) or the given URI. |
static Map<String,PlaceDescription> |
getPlaceMap(Gedcomx doc)
Create a map of local id (and "#" + id) and identifier URIs to the PlaceDescription that has that id or URL. |
RecordDescriptor |
getRecordDescriptor(String recordDescriptorIdOrUrl)
Find the RecordDescriptor referenced by the given id (with or without a "#"), or URL (with "#" and a local id). |
RecordDescriptor |
getRecordDescriptor(URI recordDescriptorId)
Find the RecordDescriptor referenced by the given id (with or without a "#"). |
static Map<String,RecordDescriptor> |
getRecordDescriptorMap(Gedcomx doc)
Create a map of local id (and "#" + id) to the RecordDescriptor that has that id. |
SourceDescription |
getSourceDescription(SourceReference sourceReference)
Get the SourceDescription referenced by the given SourceReference. |
SourceDescription |
getSourceDescription(String idOrUrl)
Get the SourceDescription from the GedcomX document that has the given id (with or without "#") or an identifier that matches the given idOrUrl. |
SourceDescription |
getSourceDescription(URI uri)
Get the SourceDescription from the GedcomX document that has the given id (with or without "#") or an identifier that matches the given idOrUrl. |
static Map<String,SourceDescription> |
getSourceDescriptionMap(Gedcomx doc)
Create a map of id (and "#" + id) and all identifier URI strings to SourceDescription with that ID, to make it easier to look up SourceDescriptions that are referenced elsewhere. |
void |
update(Gedcomx doc)
Update the maps with the given GedcomX document (e.g., when the document has changed). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DocMap(Gedcomx doc)
doc - - GedcomX document to build maps for.| Method Detail |
|---|
public void update(Gedcomx doc)
doc - - GedcomX document to rebuild maps for.public Gedcomx getDocument()
public SourceDescription getMainSourceDescription()
public Person getMainPerson()
public Person getPerson(String idOrUrl)
idOrUrl - - local person id (with or without "#") or any person identifier
public Person getPerson(URI uri)
uri - - local person id (with or without "#") or any person identifier
public Person getPerson(ResourceReference resourceReference)
resourceReference - - local person id (with or without "#") or any person identifier
public SourceDescription getSourceDescription(String idOrUrl)
idOrUrl - - local person id (with or without "#") or any person identifier
public SourceDescription getSourceDescription(URI uri)
uri - - local source description id (with or without "#") or any identifier in the source description.
public SourceDescription getSourceDescription(SourceReference sourceReference)
sourceReference - - SourceReference that points to a SourceDescription.
public RecordDescriptor getRecordDescriptor(String recordDescriptorIdOrUrl)
recordDescriptorIdOrUrl - - local id of a RecordDescriptor (with or without a "#"), or URL of recordDescriptor (with "#" + local id at end).
public RecordDescriptor getRecordDescriptor(URI recordDescriptorId)
recordDescriptorId - - URI containing the local id of a RecordDescriptor (with or without a "#").
public Agent getAgent(String agentId)
agentId - - id of an agent (with or without an initial "#").
public Agent getAgent(URI agentId)
agentId - - URI containing the id of an agent (with or without an initial "#").
public PlaceDescription getPlaceDescription(String idOrUri)
idOrUri - - local id (with or without "#") or full identifier URI of a PlaceDescription.
public PlaceDescription getPlaceDescription(URI placeDescriptionUri)
placeDescriptionUri - - local id (with or without "#") or full identifier URI of a PlaceDescription.
public PlaceDescription getPlaceDescription(PlaceReference placeReference)
placeReference - - PlaceReference that contains the (probably local) id of a PlaceDescription.
public static Map<String,SourceDescription> getSourceDescriptionMap(Gedcomx doc)
doc - - GedcomX document to create a map for.
public static Map<String,Person> getPersonMap(Gedcomx doc)
doc - - GedcomX document to create a map for.
public static Map<String,Agent> getAgentMap(Gedcomx doc)
doc - - document to find agents for
public static Map<String,RecordDescriptor> getRecordDescriptorMap(Gedcomx doc)
doc - - document to find record descriptors for
public static Map<String,PlaceDescription> getPlaceMap(Gedcomx doc)
doc - - document to find place descriptions for
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||