|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.gate.yam.depend.Dependencies
class Dependencies
Dependencies keeps track of the link and inclusion dependencies between YamFiles and other Files.
Field Summary | |
---|---|
private Map |
includedBy
A Map of a File path to a Set of all file paths that include it. |
private Map |
includes
A Map of a File path to a Set of all file paths that it includes. |
private Map |
linkedBy
A Map of a File path to a Set of all file paths that link to it. |
private Map |
linksTo
A Map of a File path to a Set of all file paths that it links to. |
private static Logger |
log
Logger |
private static long |
serialVersionUID
UID for stable serialisation |
private static File |
serializationDirectory
The directory to which Dependencies are serialized |
private static String |
serializationFilePrefix
The prefix used for serialized dependency files. |
private static String |
serializationFileSuffix
The suffix used for serialized dependency files. |
private static Map |
wikiDependencies
A Map of wiki area identifiers to Dependencies instances. |
Constructor Summary | |
Dependencies()
|
Method Summary | |
---|---|
static void
|
clear()
Clear out the current Dependencies. |
Set
|
created(File createdFile)
A non-YamFile File has been "created" as far as the wiki is concerned if it has been uploaded. |
Set
|
created(YamFile createdYam)
Given a created YamFile, returns a Set of the canonical paths of those YamFiles that need regenerating, because they depend on the created YamFile. |
Set
|
deleted(File deletedFile)
Given a deleted File, returns a Set of the canonical paths of those YamFiles that need regenerating, because they depend on the deleted File. |
Set
|
deleted(YamFile deletedYam)
Given a deleted YamFile, returns a Set of the canonical paths of those YamFiles that need regenerating, because they depend on the deleted YamFile. |
boolean
|
equals(Object obj)
Are two Dependencies equal? |
static boolean
|
exists(String wikiID)
Do we have the Dependencies for a wiki, either loaded or serialized? |
static Dependencies
|
get(String wikiID)
Get the Dependencies instance for a wiki area. |
static Dependencies
|
get(Long wikiID)
Get Dependencies from a Long id. |
int
|
hashCode()
Returns the hash code value for this Dependencies. |
String
|
includedByAsString()
Create a String representation of the "includedBy" relationships in this Dependencies. |
private void
|
includes(String includingYamPath, List includedPaths)
Update the Dependencies with the fact that a YamFile includes a list of files. |
String
|
includesAsString()
Create a String representation of the "includes" relationships in this Dependencies. |
boolean
|
isEmpty()
Does this Dependencies contain any information about links or includes? |
String
|
linkedByAsString()
Create a String representation of the "linkedBy" relationships in this Dependencies. |
private void
|
linksTo(String linkingYamPath, List linkedPaths)
Update the Dependencies with the fact that a YamFile links to a list of files. |
String
|
linksToAsString()
Create a String representation of the "linksTo" relationships in this Dependencies. |
private void
|
logEventMethodException(String method, String paramString)
Log an Exception caught by one of the event methods |
private String
|
mapToString(Map map)
Create a String representation of a links or includes Map. |
Set
|
modified(YamFile modifiedYam)
Given a modified YamFile, returns a Set of the canonical paths of those YamFiles that need regenerating, because they depend on the modified YamFile. |
static void
|
remove(String wikiID)
Remove the Dependencies for a wiki area. |
private void
|
removeIncludes(String includingYamPath)
Remove all information about includes from a given YamFile path. |
private void
|
removeLinks(String linkingYamPath)
Remove all information about links from a given YamFile path. |
private void
|
renameIncludes(String oldName, String newName)
Rename all keys and values in the includes record of this Dependencies, from an old File name to a new File name. |
private void
|
renameLinks(String oldName, String newName)
Rename all keys and values in the link record of this Dependencies, from an old File name to a new File name. |
Set
|
renamed(File oldFile, File newFile)
Given the old name and new name of a renamed File, returns a Set of the canonical paths of those YamFiles that need regenerating, because they depend on the renamed File. |
Set
|
renamed(YamFile oldYam, YamFile newYam)
Given the old name and new name of a renamed YamFile, returns a Set of the canonical paths of those YamFiles that need regenerating, because they depend on the renamed YamFile. |
static void
|
serialize()
Serialize all Dependencies for every wiki to the serialization directory |
static void
|
serialize(String wikiID)
Serialize the Dependencies for a wiki to the serialization directory serialized |
static void
|
setSerializationDirectory(File directory)
Set the directory to which Dependencies are serialized. |
static void
|
setSerializationFilePrefix(String prefix)
Set the prefix for serialized dependency file names. |
static void
|
setSerializationFileSuffix(String suffix)
Set the suffix for serialized dependency file names. |
String
|
toSortedString()
Sorted string representation |
String
|
toString()
String representation |
Methods inherited from class Object | |
---|---|
wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll |
Field Detail |
---|
private Map includedBy
private Map includes
private Map linkedBy
private Map linksTo
private static final Logger log
private static final long serialVersionUID
private static File serializationDirectory
private static String serializationFilePrefix
private static String serializationFileSuffix
private static Map wikiDependencies
Constructor Detail |
---|
Dependencies()
Method Detail |
---|
public static void clear()
public Set created(File createdFile)
A non-YamFile File has been "created" as far as the wiki is concerned if it has been uploaded.
Given a created File, returns a Set of the canonical paths of those YamFiles that need regenerating, because they depend on the created File. If the created File has a canonical path that causes an IOException, then the files that need regenerating are not defined, and an empty Set is returned.
This method is synchronised internally.
public Set created(YamFile createdYam)
Given a created YamFile, returns a Set of the canonical paths of those YamFiles that need regenerating, because they depend on the created YamFile. If the created YamFile has a canonical path that causes an Exception, then the files that need regenerating are not defined, and an empty Set is returned.
Updates this Dependencies' record of links and includes for YamFile, to take into account the creation.
This method is synchronised internally.
public Set deleted(File deletedFile)
Given a deleted File, returns a Set of the canonical paths of those YamFiles that need regenerating, because they depend on the deleted File. If the deleted File has a canonical path that causes an IOException, then the files that need regenerating are not defined, and an empty Set is returned.
This method is synchronised internally.
public Set deleted(YamFile deletedYam)
Given a deleted YamFile, returns a Set of the canonical paths of those YamFiles that need regenerating, because they depend on the deleted YamFile. If the deleted YamFile has a canonical path that causes an Exception, then the files that need regenerating are not defined, and an empty Set is returned.
Updates this Dependencies' record of links and includes for YamFile, to take into account the deletion.
This method is synchronised internally.
public boolean equals(Object obj)
public static boolean exists(String wikiID)
public static Dependencies get(String wikiID)
public static Dependencies get(Long wikiID)
public int hashCode()
public String includedByAsString()
private void includes(String includingYamPath, List includedPaths)
Update the Dependencies with the fact that a YamFile includes a list of files. This list is taken to be all the includes from the YamFile. Any previously recorded includes for this YamFile are removed.
Transitivity of includes is taken into account internally: the client does not need to provide the transitive closure of includes.
Note that this method is not synchronized: it must be synchonized by calling methods.
public String includesAsString()
public boolean isEmpty()
public String linkedByAsString()
private void linksTo(String linkingYamPath, List linkedPaths)
Update the Dependencies with the fact that a YamFile links to a list of files. This list is taken to be all the links and the only links from the YamFile. Any previously recorded links for this YamFile are removed.
Because the end of a link does not affect the actual content of a linking file, transitivity of links is not considered, and therefore neither is circular linking.
Note that this method is not synchronized: it must be synchonized by calling methods.
public String linksToAsString()
private void logEventMethodException(String method, String paramString)
private String mapToString(Map map)
public Set modified(YamFile modifiedYam)
Given a modified YamFile, returns a Set of the canonical paths of those YamFiles that need regenerating, because they depend on the modified YamFile. If the modified YamFile has a canonical path that causes an Exception, then the files that need regenerating are not defined, and an empty Set is returned.
Updates this Dependencies' record of links and includes for YamFile, to take into account the modification.
This method is synchronised internally.
Note that there is no equivalent modified(File) method for modifying a File that is not a YamFile, as they cannot be modified via the wiki
public static void remove(String wikiID)
private void removeIncludes(String includingYamPath)
Remove all information about includes from a given YamFile path. I.e. remove all includes from that YamFile to others in the includes Map, and remove all inverse "includedBy" Map relations. Doesn't remove includes to the YamFile.
Note that this method is not synchronized: it must be synchonized by calling methods.
private void removeLinks(String linkingYamPath)
Remove all information about links from a given YamFile path. I.e. remove all links from that YamFile to others in the linksTo Map, and remove all inverse "linkedBy" Map relations. Doesn't remove links to the YamFile.
Note that this method is not synchronized: it must be synchonized by calling methods.
private void renameIncludes(String oldName, String newName)
Rename all keys and values in the includes record of this Dependencies, from an old File name to a new File name.
Note that this method is not synchronized: it must be synchonized by calling methods.
private void renameLinks(String oldName, String newName)
Rename all keys and values in the link record of this Dependencies, from an old File name to a new File name.
Note that this method is not synchronized: it must be synchonized by calling methods.
public Set renamed(File oldFile, File newFile)
Given the old name and new name of a renamed File, returns a Set of the canonical paths of those YamFiles that need regenerating, because they depend on the renamed File. If the old or new File has a canonical path that causes an IOException, then the files that need regenerating are not defined, and an empty Set is returned.
Updates this Dependencies' record of links and includes for the File, to take into account the renaming.
This method is synchronised internally.
public Set renamed(YamFile oldYam, YamFile newYam)
Given the old name and new name of a renamed YamFile, returns a Set of the canonical paths of those YamFiles that need regenerating, because they depend on the renamed YamFile. If the old or new YamFile has a canonical path that causes an Exception, then the files that need regenerating are not defined, and an empty Set is returned.
Updates this Dependencies' record of links and includes for YamFile, to take into account the renaming.
This method is synchronised internally.
public static void serialize()
public static void serialize(String wikiID)
public static void setSerializationDirectory(File directory)
public static void setSerializationFilePrefix(String prefix)
public static void setSerializationFileSuffix(String suffix)
public String toSortedString()
public String toString()
Groovy Documentation