[Abora-cvs] abora-ash/src/org/abora/ash/content BeCollectionHolder.java,1.1,1.2 BeContentElement.jav
Status: Alpha
Brought to you by:
dgjones
From: <dg...@us...> - 2003-05-08 13:53:14
|
Update of /cvsroot/abora/abora-ash/src/org/abora/ash/content In directory sc8-pr-cvs1:/tmp/cvs-serv11397/src/org/abora/ash/content Modified Files: BeCollectionHolder.java BeContentElement.java BeDataHolder.java Log Message: -STart leaf tests Index: BeCollectionHolder.java =================================================================== RCS file: /cvsroot/abora/abora-ash/src/org/abora/ash/content/BeCollectionHolder.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BeCollectionHolder.java 4 May 2003 18:32:06 -0000 1.1 --- BeCollectionHolder.java 8 May 2003 13:53:09 -0000 1.2 *************** *** 11,13 **** --- 11,83 ---- public class BeCollectionHolder extends BeContentElement { + private final byte[] collection; + + // "Filed out from Dolphin Smalltalk 2002 release 5.00"! + // + // BeContentElement subclass: #BeCollectionHolder + // instanceVariableNames: 'collection' + // classVariableNames: '' + // poolDictionaries: '' + // classInstanceVariableNames: ''! + // BeCollectionHolder guid: (GUID fromString: '{46785AAF-450D-4C62-8737-3DFC64C37622}')! + // BeCollectionHolder comment: ''! + // !BeCollectionHolder categoriesForClass!Kernel-Objects! ! + // !BeCollectionHolder methodsFor! + // + // collection + // ^collection! + // + // collection: setCollection + // self ensureValidCollection: setCollection. + // + // collection := setCollection.! + // + + public int count() { + return collection.length; + } + + // createNodeAt: position for: forRevision + // ^CollectionLeaf + // branch: forRevision + // startPosition: position + // collection: self! + // + // ensureValidCollection: potentialCollection + // #todo "ensure that contents is either all integer or all float". + // ((potentialCollection isKindOf: Array) and: [potentialCollection allSatisfy: [:a | a isInteger]]) ifTrue: [^self]. + // + // Error signal: 'invalid element to insert into ent'. + // ! + // + // printOn: aStream + // self basicPrintOn: aStream. + // aStream nextPutAll: '('. + // self collection displayOn: aStream. + // aStream nextPutAll: ')'! ! + // !BeCollectionHolder categoriesFor: #collection!accessing!private! ! + // !BeCollectionHolder categoriesFor: #collection:!accessing!private! ! + // !BeCollectionHolder categoriesFor: #createNodeAt:for:!public! ! + // !BeCollectionHolder categoriesFor: #ensureValidCollection:!accessing!private! ! + // !BeCollectionHolder categoriesFor: #printOn:!public! ! + // + // !BeCollectionHolder class methodsFor! + // + + public BeCollectionHolder(byte[] collection) { + super(); + this.collection = collection; + } + + public byte[] getCollection() { + return collection; + } + + // collection: array + // ^(self new) + // collection: array; + // yourself! ! + // !BeCollectionHolder class categoriesFor: #collection:!public! ! + // + } Index: BeContentElement.java =================================================================== RCS file: /cvsroot/abora/abora-ash/src/org/abora/ash/content/BeContentElement.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BeContentElement.java 4 May 2003 18:32:06 -0000 1.1 --- BeContentElement.java 8 May 2003 13:53:09 -0000 1.2 *************** *** 7,15 **** --- 7,119 ---- package org.abora.ash.content; + import java.util.HashSet; + import java.util.Set; + import org.abora.ash.engine.AboraObject; + import org.abora.ash.ent.LeafNode; /** */ public class BeContentElement extends AboraObject { + + protected Set parents; + + protected BeContentElement() { + parents = new HashSet(); + } + + // "Filed out from Dolphin Smalltalk 2002 release 5.00"! + // + // AboraObject subclass: #BeContentElement + // instanceVariableNames: 'parents' + // classVariableNames: '' + // poolDictionaries: '' + // classInstanceVariableNames: ''! + // BeContentElement guid: (GUID fromString: '{29FCADDE-72E1-4551-88EA-D8C71B0A338A}')! + // BeContentElement comment: ''! + // !BeContentElement categoriesForClass!Kernel-Objects! ! + // !BeContentElement methodsFor! + // + + public void addParent(LeafNode node) { + parents.add(node); + } + + // addParent: parent + // parents add: parent! + // + // createNodeAt: position for: forRevision + // ^ContentLeaf + // branch: forRevision + // startPosition: position + // contentElement: self! + // + // filterTransclusions: editions by: filter + // ^editions select: [:edition | filter allSatisfy: [:requiredEdition | edition endorsements includes: requiredEdition]].! + // + // initialize + // super initialize. + // + // parents := OrderedCollection new.! + // + // makeFeProxy + // self subclassResponsibility! + // + + public Set getParents() { + return parents; + } + + // parents + // ^parents! + // + + public void removeParent(LeafNode parent) { + parents.remove(parent); + } + + // removeParent: parent + // parents remove: parent! + // + // stbSaveOn: anSTBOutFiler + // (anSTBOutFiler context isKindOf: BeSession) + // ifTrue: + // [anSTBOutFiler context addFeContentElementFor: self. + // anSTBOutFiler saveObject: self as: (STBBeContentElementForFE for: self)] + // ifFalse: + // [self assert: [anSTBOutFiler context ~~ #forBe]. + // "self halt." + // super stbSaveOn: anSTBOutFiler]! + // + // transclusionsDirect + // "return an edition" + // + // | editions | + // #todo. + // editions := IdentitySet new. + // self parents do: [:leaf | editions addAll: leaf allEditions]. + // editions remove: self + // ifAbsent: + // ["ignore" + // + // ]. + // ^editions! + // + // transclusionsDirectFilteredBy: filter + // | editions | + // editions := self transclusionsDirect. + // ^self filterTransclusions: editions by: filter + // ! ! + // !BeContentElement categoriesFor: #addParent:!must not strip!public! ! + // !BeContentElement categoriesFor: #createNodeAt:for:!must not strip!public! ! + // !BeContentElement categoriesFor: #filterTransclusions:by:!must not strip!public! ! + // !BeContentElement categoriesFor: #initialize!private! ! + // !BeContentElement categoriesFor: #makeFeProxy!private! ! + // !BeContentElement categoriesFor: #parents!must not strip!public! ! + // !BeContentElement categoriesFor: #removeParent:!must not strip!public! ! + // !BeContentElement categoriesFor: #stbSaveOn:!private! ! + // !BeContentElement categoriesFor: #transclusionsDirect!must not strip!public! ! + // !BeContentElement categoriesFor: #transclusionsDirectFilteredBy:!must not strip!public! ! + // } Index: BeDataHolder.java =================================================================== RCS file: /cvsroot/abora/abora-ash/src/org/abora/ash/content/BeDataHolder.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BeDataHolder.java 4 May 2003 18:32:06 -0000 1.1 --- BeDataHolder.java 8 May 2003 13:53:09 -0000 1.2 *************** *** 9,13 **** /** */ ! public class BeDataHolder { } --- 9,62 ---- /** */ ! public class BeDataHolder extends BeContentElement { ! ! private final BeContentElement value; ! ! public BeDataHolder(BeContentElement value) { ! super(); ! this.value = value; ! } ! ! public BeContentElement getValue() { ! return value; ! } ! ! ! ! // "Filed out from Dolphin Smalltalk 2002 release 5.00"! ! // ! // BeContentElement subclass: #BeDataHolder ! // instanceVariableNames: 'value' ! // classVariableNames: '' ! // poolDictionaries: '' ! // classInstanceVariableNames: ''! ! // BeDataHolder guid: (GUID fromString: '{E7A180D5-EAC0-4DEB-B9E0-6ACDFA73FB06}')! ! // BeDataHolder comment: ''! ! // !BeDataHolder categoriesForClass!Kernel-Objects! ! ! // !BeDataHolder methodsFor! ! // ! // printOn: aStream ! // self basicPrintOn: aStream. ! // aStream nextPutAll: '('. ! // self value displayOn: aStream. ! // aStream nextPutAll: ')'! ! // ! // value ! // ^value! ! // ! // value: anObject ! // value := anObject! ! ! // !BeDataHolder categoriesFor: #printOn:!public! ! ! // !BeDataHolder categoriesFor: #value!accessing!private! ! ! // !BeDataHolder categoriesFor: #value:!accessing!private! ! ! // ! // !BeDataHolder class methodsFor! ! // ! // value: dataValue ! // ^(self new) ! // value: dataValue; ! // yourself! ! ! // !BeDataHolder class categoriesFor: #value:!public! ! ! // } |