Description Usage Arguments Format Details Author(s) See Also
Document0
Component class for Document composite in the NLPStudio.
1 |
name |
Character string indicating the name of the document or file. Required for all objects. |
desc |
Character string containing the description of the document. |
parent |
An object of the Lab or DocumentCollection class that represents the parent object. |
visitor |
An object from one of the visitor classes. |
prior |
A Document Family Class object, deserialized from a prior state. |
stateId |
Character string that uniquely identifies an object and its state at a specific point in time. |
An object of class R6ClassGenerator
of length 24.
Document Family of Classes Overview:
The Document family of classes is an implementation of the composite pattern documented in the book "Design Patterns: Elements of Reusable Object-Oriented Software" by Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides (hence Gang of Four). This pattern allows composite and individual objects to be treated uniformly.
The following sections include:
Class Participants: Classes the comprise this composite pattern.
Class Collaborators: Classes which interact with the Document0 class.
Class Methods: Methods included in the interface.
Document Family of Classes Participants: The participants of the Document0 class are:
Document0: This component class specifies an abstract interface for all leaf and composite document classes.
DocumentCollection: The composite class that maintains the hierarchical structure of document collections (composites) and individual documents (leafs).
Document: An "abstract leaf" class defines the interface for DocumentText, DocumentRdata, DocumentCsv, and DocumentXlsx sub-classes.
DocumentText: This "concrete leaf" class for text documents.
DocumentCsv: This "concrete leaf" class for csv documents.
DocumentRdata: This "concrete leaf" class for RData documents.
DocumentXlsx: This "concrete leaf" class for excel documents.
Document Family of Classes Collaborators: The collaborators of the Document family are:
Lab: Class responsible for document collections.
State: Class responsible for saving current and restoring prior states of objects.
Historian: Class responsible for maintaining the history of events on objects.
Curator: Class responsible for maintaining the object hierarchy.
Reader: Class responsible for initiating the document read operation.
Writer: Class responsible for initiating the document write operation.
VReader: Visitor class responsible for performing read operations through the Document hierarchy.
VWriter: Visitor class responsible for performing write operations through the Document hierarchy.
VCurator: Visitor class that fulfills commands from the Curator class.
Document0 Methods: There are six types of methods within the Document0 class and they are:
Core Methods: Core methods shared by both Document and DocumentCollection objects.
Getter/Setter Methods: Active binding methods for getting and setting selected private members.
Composite Methods: Methods implemented by the DocumentCollection class to maintain the document heirarchy.
State Methods: Methods for saving current and restoring prior states of objects .
Visitor Methods: Methods for implementation of and messaging with objects of the visitor classes.
Document0 Core Methods:
new(name, desc)
Base method for instantiating
an object of the Document or DocumentCollection classes.
Specific behaviors implemented in the subclasses.
getName()
Returns the name of the current object.
exposeObject(requester)
Base method for returning the elements of the current object if invoked by an authorized method.
restore(requester, prior)
Base method for restoring an object
to a prior state, as per the object parameter.
Document0 Field Getter/Setter Active Binding Methods:
desc()
Method used to get / set the description variable.
Implemented as an active binding and so the field may be updated
by assignment. This method is concrete and inherited by sub-classes.
Document0 Composite Methods:
addChild(document)
Base method for adding documents to a
collection. Specific behaviors implemented in the DocumentCollection composite
sub-class
getChildren()
Base method for retrieving child objects. Specific behaviors
implemented in the DocumentCollection subclass
removeChild(document)
Base method for removing documents from
a collection. Specific behaviors implemented in the DocumentCollection composite
sub-class
parent(value)
Getter/setter method for the parent field, implemented as an active binding on the private member.
Document0 State Methods:
saveState()
Method for saving the current state of an object to file.
restoreState(prior)
Method for restoring an object to a prior state.
Document0 Visitor Methods:
accept(visitor)
Method for accepting the visitor objects. Subclasses override these methods.
John James, jjames@datasciencesalon.org
Other Document classes: DocumentCollection
,
DocumentCsv
, DocumentRdata
,
DocumentText
, DocumentXlsx
,
Document
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.