From: Xuan B. <med...@us...> - 2008-01-21 20:00:30
|
Update of /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/basic In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv29389/src/org/tm4j/topicmap/tmdm/basic Modified Files: BasicOccurrence.java BasicTopic.java TopicMapItems.java.txt package.jdo Log Message: Spelling fix: s/ccurence/ccurrence/ part 2 (found thanks to a code-review by Benjamin Bock <bb-...@bo...>) Index: package.jdo =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/basic/package.jdo,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** package.jdo 21 Jan 2008 11:13:44 -0000 1.1 --- package.jdo 21 Jan 2008 20:00:26 -0000 1.2 *************** *** 9,13 **** </class> <class name="BasicAssociationRole" /> ! <class name="BasicOccurence"> <field persistence-modifier="persistent" name="datatype" /> </class> --- 9,13 ---- </class> <class name="BasicAssociationRole" /> ! <class name="BasicOccurrence"> <field persistence-modifier="persistent" name="datatype" /> </class> *************** *** 26,30 **** <extension vendor-name="jpox" key="is-second-class" value="false" /> </field> ! <field name="occurences"> <extension vendor-name="jpox" key="is-second-class" value="false" /> </field> --- 26,30 ---- <extension vendor-name="jpox" key="is-second-class" value="false" /> </field> ! <field name="occurrences"> <extension vendor-name="jpox" key="is-second-class" value="false" /> </field> Index: BasicTopic.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/basic/BasicTopic.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BasicTopic.java 21 Jan 2008 19:21:15 -0000 1.2 --- BasicTopic.java 21 Jan 2008 20:00:26 -0000 1.3 *************** *** 26,30 **** Thus, the using application has to ensure that these constraints are met. ! We keep some sets (like {@link #subjectLocators}, {@link #subjectIdentifiers}, {@link #occurences}, {@link #rolesPlayed}, {@link #topicNames}) as null if the set to be represented is empty for memory optimization reasons. (Thus, we can pack more topics in RAM and we are faster at disk accesses (and we should be faster even when only doing RAM accesses, as RAM is nowadays slower than CPUs).) --- 26,30 ---- Thus, the using application has to ensure that these constraints are met. ! We keep some sets (like {@link #subjectLocators}, {@link #subjectIdentifiers}, {@link #occurrences}, {@link #rolesPlayed}, {@link #topicNames}) as null if the set to be represented is empty for memory optimization reasons. (Thus, we can pack more topics in RAM and we are faster at disk accesses (and we should be faster even when only doing RAM accesses, as RAM is nowadays slower than CPUs).) *************** *** 42,46 **** Set<Locator> subjectLocators; Set<Locator> subjectIdentifiers; ! Set<BasicOccurence> occurences; /** While rolesPlayed is specified in TMDM, it is redundant from a data completeness point of view. --- 42,46 ---- Set<Locator> subjectLocators; Set<Locator> subjectIdentifiers; ! Set<BasicOccurrence> occurrences; /** While rolesPlayed is specified in TMDM, it is redundant from a data completeness point of view. *************** *** 178,218 **** } ! public BasicOccurence createOccurence(Topic type,Locator datatype,String value) { ! return createOccurence((BasicTopic) type,datatype,value); } ! public BasicOccurence createOccurence(BasicTopic type,Locator datatype,String value) { assert type.getContainingTopicMap()==getContainingTopicMap(); ! BasicOccurence occurence = new BasicOccurence(this,type,datatype,value); ! occurences.add(occurence); ! getEventListener().notifyOccurenceCreated(getContainingTopicMap(),this,occurence); ! return occurence; } ! protected void internalRemove(BasicOccurence occurence) { ! boolean success = occurences.remove(occurence); assert success; ! getEventListener().notifyOccurenceRemoved(getContainingTopicMap(),this,occurence); } ! public void removeAllOccurences() { ! if (occurences!=null) { ! for (Iterator<BasicOccurence> i = occurences.iterator();i.hasNext();) { ! BasicOccurence occurence = i.next(); ! occurence.internalPreRemove(); i.remove(); ! getEventListener().notifyOccurenceRemoved(getContainingTopicMap(),this,occurence); ! occurence.internalPostRemove(); } ! occurences = null; } } --- 178,218 ---- } ! public BasicOccurrence createOccurrence(Topic type,Locator datatype,String value) { ! return createOccurrence((BasicTopic) type,datatype,value); } ! public BasicOccurrence createOccurrence(BasicTopic type,Locator datatype,String value) { assert type.getContainingTopicMap()==getContainingTopicMap(); ! BasicOccurrence occurrence = new BasicOccurrence(this,type,datatype,value); ! occurrences.add(occurrence); ! getEventListener().notifyOccurrenceCreated(getContainingTopicMap(),this,occurrence); ! return occurrence; } ! protected void internalRemove(BasicOccurrence occurrence) { ! boolean success = occurrences.remove(occurrence); assert success; ! getEventListener().notifyOccurrenceRemoved(getContainingTopicMap(),this,occurrence); } ! public void removeAllOccurrences() { ! if (occurrences!=null) { ! for (Iterator<BasicOccurrence> i = occurrences.iterator();i.hasNext();) { ! BasicOccurrence occurrence = i.next(); ! occurrence.internalPreRemove(); i.remove(); ! getEventListener().notifyOccurrenceRemoved(getContainingTopicMap(),this,occurrence); ! occurrence.internalPostRemove(); } ! occurrences = null; } } *************** *** 328,332 **** protected void internalPreRemove() { ! removeAllOccurences(); removeAllSubjectIdentifiers(); removeAllSubjectLocators(); --- 328,332 ---- protected void internalPreRemove() { ! removeAllOccurrences(); removeAllSubjectIdentifiers(); removeAllSubjectLocators(); Index: BasicOccurrence.java =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/basic/BasicOccurrence.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BasicOccurrence.java 21 Jan 2008 19:58:24 -0000 1.1 --- BasicOccurrence.java 21 Jan 2008 20:00:26 -0000 1.2 *************** *** 12,16 **** @author <a href="mailto:xua...@pu...">Xuân Baldauf</a> */ ! public class BasicOccurence extends BasicScopeable implements Occurence { BasicTopic parent; BasicTopic type; --- 12,16 ---- @author <a href="mailto:xua...@pu...">Xuân Baldauf</a> */ ! public class BasicOccurrence extends BasicScopeable implements Occurrence { BasicTopic parent; BasicTopic type; *************** *** 18,22 **** String value; ! protected BasicOccurence(BasicTopic parent,BasicTopic type,Locator datatype,String value) { this.parent = parent; this.type = type; --- 18,22 ---- String value; ! protected BasicOccurrence(BasicTopic parent,BasicTopic type,Locator datatype,String value) { this.parent = parent; this.type = type; *************** *** 43,47 **** // We do not treat cases where the old value equals the new value specially. ! getEventListener().notifyOccurenceTypeChanged(getContainingTopicMap(),getParent(),this,oldType,type); } --- 43,47 ---- // We do not treat cases where the old value equals the new value specially. ! getEventListener().notifyOccurrenceTypeChanged(getContainingTopicMap(),getParent(),this,oldType,type); } *************** *** 58,62 **** // We do not treat cases where the old value equals the new value specially. ! getEventListener().notifyOccurenceDatatypeChanged(getContainingTopicMap(),getParent(),this,oldDatatype,datatype); } --- 58,62 ---- // We do not treat cases where the old value equals the new value specially. ! getEventListener().notifyOccurrenceDatatypeChanged(getContainingTopicMap(),getParent(),this,oldDatatype,datatype); } *************** *** 73,77 **** // We do not treat cases where the old value equals the new value specially. ! getEventListener().notifyOccurenceValueChanged(getContainingTopicMap(),getParent(),this,oldValue,value); } --- 73,77 ---- // We do not treat cases where the old value equals the new value specially. ! getEventListener().notifyOccurrenceValueChanged(getContainingTopicMap(),getParent(),this,oldValue,value); } Index: TopicMapItems.java.txt =================================================================== RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/basic/TopicMapItems.java.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TopicMapItems.java.txt 21 Jan 2008 11:13:44 -0000 1.1 --- TopicMapItems.java.txt 21 Jan 2008 20:00:26 -0000 1.2 *************** *** 27,31 **** Set<Locator> subjectLocators; Set<Locator> subjectIdentifiers; ! Set<BasicOccurence> BasicOccurences; Set<BasicAssociationRole> rolesPlayed; Set<BasicTopicName> BasicTopicNames; --- 27,31 ---- Set<Locator> subjectLocators; Set<Locator> subjectIdentifiers; ! Set<BasicOccurrence> BasicOccurrences; Set<BasicAssociationRole> rolesPlayed; Set<BasicTopicName> BasicTopicNames; *************** *** 58,62 **** } ! public class BasicOccurence extends BasicScopeable { BasicTopic parent; BasicTopic type; --- 58,62 ---- } ! public class BasicOccurrence extends BasicScopeable { BasicTopic parent; BasicTopic type; |