More documentation.

This commit is contained in:
Jindra Petřík
2024-08-08 19:27:14 +02:00
parent 5c1811582a
commit f219b49372
394 changed files with 13018 additions and 552 deletions
@@ -32,35 +32,79 @@ public class AS2Cache {
private final Cache<ASMSource, ActionList> pcodeCache = Cache.getInstance(true, true, "as2pcode", false);
/**
* Constructor.
*/
public AS2Cache() {
}
/**
* Clears the cache.
*/
public void clear() {
pcodeCache.clear();
cache.clear();
}
/**
* Checks if the source is cached.
* @param src Source
* @return True if the source is cached
*/
public boolean isCached(ASMSource src) {
return cache.contains(src);
}
/**
* Checks if the PCode is cached.
* @param src Source
* @return True if the PCode is cached
*/
public boolean isPCodeCached(ASMSource src) {
return pcodeCache.contains(src);
}
/**
* Gets the cached text.
* @param src Source
* @return Cached text
*/
public HighlightedText get(ASMSource src) {
return cache.get(src);
}
/**
* Gets the cached PCode.
* @param src Source
* @return Cached PCode
*/
public ActionList getPCode(ASMSource src) {
return pcodeCache.get(src);
}
/**
* Puts the text into the cache.
* @param src Source
* @param text Text
*/
public void put(ASMSource src, HighlightedText text) {
cache.put(src, text);
}
/**
* Puts the PCode into the cache.
* @param src Source
* @param actionList PCode
*/
public void put(ASMSource src, ActionList actionList) {
pcodeCache.put(src, actionList);
}
/**
* Removes the source from the cache.
* @param src Source
*/
public void remove(ASMSource src) {
if (src != null) {
cache.remove(src);
@@ -29,22 +29,55 @@ public class AS3Cache {
private final Cache<ScriptPack, HighlightedText> cache = Cache.getInstance(true, false, "as3", false);
/**
* Constructor.
*/
public AS3Cache() {
}
/**
* Clears the cache.
*/
public void clear() {
cache.clear();
}
/**
* Checks if the cache contains the specified pack.
*
* @param pack Pack to check
* @return True if the pack is cached, false otherwise
*/
public boolean isCached(ScriptPack pack) {
return cache.contains(pack);
}
/**
* Gets the cached text for the specified pack.
*
* @param pack Pack to get the text for
* @return Cached text for the pack
*/
public HighlightedText get(ScriptPack pack) {
return cache.get(pack);
}
/**
* Puts the specified text into the cache for the specified pack.
*
* @param pack Pack to put the text for
* @param text Text to put
*/
public void put(ScriptPack pack, HighlightedText text) {
cache.put(pack, text);
}
/**
* Removes the specified pack from the cache.
*
* @param pack Pack to remove
*/
public void remove(ScriptPack pack) {
if (pack != null) {
cache.remove(pack);