<< lib/observer/SLObserverSummaryModule.sleela SLeeLa Standard Library Definition. Definition: A drop-in module for the dynamic document observer. The nested class SLObserverSummaryModule.Responder tracks the latest revision, line count and edit mix, and answers the question "summary?". >> #sleela 2.5 material; < Family: observer. Drop-in pattern: a nested Responder holding an > < SLObserverPort; construct it, attach(name), admit portOf(), then pump(). > class SLObserverSummaryModule { < ---- Descriptive metadata (version 1.11 nested-friendly accessors) ---- > << Eleven catalogued attributes with getter/setter pairs, so a GUI, loader, or catalog can read and (where appropriate) override this record. Values are faithful to the subject's real origin where publicly known. >> String metaVersion = "1.0.0"; int metaId = 39205; String metaAuthor = "Kiro Agent"; String metaDate = "2026-11-11"; String metaCopyright = "SLeeLa project"; String metaTrademark = "none"; String metaCorporation = "none"; < metaOrigin: National | | International | Galactic > String metaOrigin = "International"; String metaBirthDate = "2026-11-11"; < metaScienceRating: maturity/robustness on a 1..10 scale > int metaScienceRating = 8; < metaNationalSchedule: a real, citable instrument or "none" > String metaNationalSchedule = "none"; String getMetaVersion() { return metaVersion; } void setMetaVersion(String v) { metaVersion = v; } int getMetaId() { return metaId; } void setMetaId(int v) { metaId = v; } String getAuthor() { return metaAuthor; } void setAuthor(String v) { metaAuthor = v; } String getDate() { return metaDate; } void setDate(String v) { metaDate = v; } String getCopyright() { return metaCopyright; } void setCopyright(String v) { metaCopyright = v; } String getTrademark() { return metaTrademark; } void setTrademark(String v) { metaTrademark = v; } String getCorporation() { return metaCorporation; } void setCorporation(String v) { metaCorporation = v; } String getOrigin() { return metaOrigin; } void setOrigin(String v) { metaOrigin = v; } String getBirthDate() { return metaBirthDate; } void setBirthDate(String v) { metaBirthDate = v; } int getScienceRating() { return metaScienceRating; } void setScienceRating(int v) { metaScienceRating = v; } String getNationalSchedule() { return metaNationalSchedule; } void setNationalSchedule(String v) { metaNationalSchedule = v; } class Responder { SLObserverPort port; int lastRevision; int lines; int inserts; int replaces; int deletes; void attach(String portName) { port = new SLObserverPort(); port.configure(portName); lastRevision = 0; lines = 0; inserts = 0; replaces = 0; deletes = 0; } SLObserverPort portOf() { return port; } int latestRevision() { return lastRevision; } String summary() { return "rev " + lastRevision + ", +" + inserts + " ~" + replaces + " -" + deletes; } int pump() { int n = 0; while (port.hasMail()) { SLObserverMessage m = port.next(); n = n + 1; int k = m.getKind(); if (k == 5) { lastRevision = m.getRevision(); if (m.getOp() == 0) { inserts = inserts + 1; lines = lines + 1; } else if (m.getOp() == 1) { replaces = replaces + 1; } else { deletes = deletes + 1; lines = lines - 1; } } else if (k == 1) { port.reply(m, summary()); } } return n; } } }