|
From: <lh...@us...> - 2008-08-12 11:41:16
|
Revision: 120
http://tinytim.svn.sourceforge.net/tinytim/?rev=120&view=rev
Author: lheuer
Date: 2008-08-12 11:41:25 +0000 (Tue, 12 Aug 2008)
Log Message:
-----------
- Use consequently CollectionFactory
Modified Paths:
--------------
tinytim/trunk/src/main/java/org/tinytim/index/LiteralIndexImpl.java
tinytim/trunk/src/main/java/org/tinytim/index/ScopedIndexImpl.java
tinytim/trunk/src/main/java/org/tinytim/index/TypeInstanceIndexImpl.java
Modified: tinytim/trunk/src/main/java/org/tinytim/index/LiteralIndexImpl.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/index/LiteralIndexImpl.java 2008-08-12 11:36:58 UTC (rev 119)
+++ tinytim/trunk/src/main/java/org/tinytim/index/LiteralIndexImpl.java 2008-08-12 11:41:25 UTC (rev 120)
@@ -20,7 +20,6 @@
*/
package org.tinytim.index;
-import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
@@ -33,7 +32,7 @@
import org.tinytim.core.ILiteral;
import org.tinytim.core.ILiteralAware;
import org.tinytim.core.Literal;
-import org.tinytim.utils.CollectionFactory;
+import org.tinytim.internal.utils.CollectionFactory;
import org.tmapi.core.Locator;
import org.tmapi.core.Name;
import org.tmapi.core.Occurrence;
@@ -81,7 +80,7 @@
}
Collection<Name> names = _lit2Names.get(literal);
return names == null ? Collections.<Name>emptySet()
- : new ArrayList<Name>(names);
+ : CollectionFactory.createList(names);
}
/* (non-Javadoc)
@@ -114,7 +113,7 @@
}
Collection<Occurrence> occs = _lit2Occs.get(literal);
return occs == null ? Collections.<Occurrence>emptySet()
- : new ArrayList<Occurrence>(occs);
+ : CollectionFactory.createList(occs);
}
/* (non-Javadoc)
@@ -147,7 +146,7 @@
}
Collection<Variant> variants = _lit2Variants.get(literal);
return variants == null ? Collections.<Variant>emptySet()
- : new ArrayList<Variant>(variants);
+ : CollectionFactory.createList(variants);
}
public void clear() {
@@ -159,7 +158,7 @@
private void _index(Map<ILiteral, List<ILiteralAware>> lit2LitAware, ILiteral lit, ILiteralAware litAware) {
List<ILiteralAware> list = lit2LitAware.get(lit);
if (list == null) {
- list = new ArrayList<ILiteralAware>();
+ list = CollectionFactory.createList();
lit2LitAware.put(lit, list);
}
list.add(litAware);
Modified: tinytim/trunk/src/main/java/org/tinytim/index/ScopedIndexImpl.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/index/ScopedIndexImpl.java 2008-08-12 11:36:58 UTC (rev 119)
+++ tinytim/trunk/src/main/java/org/tinytim/index/ScopedIndexImpl.java 2008-08-12 11:41:25 UTC (rev 120)
@@ -20,7 +20,6 @@
*/
package org.tinytim.index;
-import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
@@ -33,7 +32,7 @@
import org.tinytim.core.IEventPublisher;
import org.tinytim.core.IScope;
import org.tinytim.core.IScoped;
-import org.tinytim.utils.CollectionFactory;
+import org.tinytim.internal.utils.CollectionFactory;
import org.tmapi.core.Association;
import org.tmapi.core.Name;
import org.tmapi.core.Occurrence;
@@ -80,7 +79,7 @@
public Collection<Association> getAssociations(Topic theme) {
Collection<Association> assocs = _theme2Assocs.get(theme);
return assocs == null ? Collections.<Association>emptySet()
- : new ArrayList<Association>(assocs);
+ : CollectionFactory.createList(assocs);
}
/* (non-Javadoc)
@@ -107,7 +106,7 @@
* @see org.tmapi.index.ScopedIndex#getAssociationThemes()
*/
public Collection<Topic> getAssociationThemes() {
- List<Topic> themes = new ArrayList<Topic>(_theme2Assocs.keySet());
+ List<Topic> themes = CollectionFactory.createList(_theme2Assocs.keySet());
themes.remove(null);
return themes;
}
@@ -118,7 +117,7 @@
public Collection<Occurrence> getOccurrences(Topic theme) {
Collection<Occurrence> occs = _theme2Occs.get(theme);
return occs == null ? Collections.<Occurrence>emptySet()
- : new ArrayList<Occurrence>(occs);
+ : CollectionFactory.createList(occs);
}
/* (non-Javadoc)
@@ -145,7 +144,7 @@
* @see org.tmapi.index.ScopedIndex#getOccurrenceThemes()
*/
public Collection<Topic> getOccurrenceThemes() {
- List<Topic> themes = new ArrayList<Topic>(_theme2Occs.keySet());
+ List<Topic> themes = CollectionFactory.createList(_theme2Occs.keySet());
themes.remove(null);
return themes;
}
@@ -156,7 +155,7 @@
public Collection<Name> getNames(Topic theme) {
Collection<Name> names = _theme2Names.get(theme);
return names == null ? Collections.<Name>emptySet()
- : new ArrayList<Name>(names);
+ : CollectionFactory.createList(names);
}
/* (non-Javadoc)
@@ -182,7 +181,7 @@
* @see org.tmapi.index.ScopedIndex#getNameThemes()
*/
public Collection<Topic> getNameThemes() {
- List<Topic> themes = new ArrayList<Topic>(_theme2Names.keySet());
+ List<Topic> themes = CollectionFactory.createList(_theme2Names.keySet());
themes.remove(null);
return themes;
}
@@ -193,7 +192,7 @@
public Collection<Variant> getVariants(Topic theme) {
Collection<Variant> vars = _theme2Variants.get(theme);
return vars == null ? Collections.<Variant>emptySet()
- : new ArrayList<Variant>(vars);
+ : CollectionFactory.createList(vars);
}
/* (non-Javadoc)
@@ -219,7 +218,7 @@
* @see org.tmapi.index.ScopedIndex#getVariantThemes()
*/
public Collection<Topic> getVariantThemes() {
- List<Topic> themes = new ArrayList<Topic>(_theme2Variants.keySet());
+ List<Topic> themes = CollectionFactory.createList(_theme2Variants.keySet());
themes.remove(null);
return themes;
}
Modified: tinytim/trunk/src/main/java/org/tinytim/index/TypeInstanceIndexImpl.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/index/TypeInstanceIndexImpl.java 2008-08-12 11:36:58 UTC (rev 119)
+++ tinytim/trunk/src/main/java/org/tinytim/index/TypeInstanceIndexImpl.java 2008-08-12 11:41:25 UTC (rev 120)
@@ -20,7 +20,6 @@
*/
package org.tinytim.index;
-import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
@@ -31,7 +30,7 @@
import org.tinytim.core.IConstruct;
import org.tinytim.core.IEventHandler;
import org.tinytim.core.IEventPublisher;
-import org.tinytim.utils.CollectionFactory;
+import org.tinytim.internal.utils.CollectionFactory;
import org.tmapi.core.Association;
import org.tmapi.core.Name;
import org.tmapi.core.Occurrence;
@@ -86,7 +85,7 @@
* @see org.tinytim.index.ITypeInstanceIndex#getAssociationTypes()
*/
public Collection<Topic> getAssociationTypes() {
- List<Topic> topics = new ArrayList<Topic>(_type2Assocs.keySet());
+ List<Topic> topics = CollectionFactory.createList(_type2Assocs.keySet());
topics.remove(null);
return topics;
}
@@ -97,14 +96,14 @@
public Collection<Association> getAssociations(Topic type) {
List<Association> assocs = _type2Assocs.get(type);
return assocs == null ? Collections.<Association>emptySet()
- : new ArrayList<Association>(assocs);
+ : CollectionFactory.createList(assocs);
}
/* (non-Javadoc)
* @see org.tinytim.index.ITypeInstanceIndex#getRoleTypes()
*/
public Collection<Topic> getRoleTypes() {
- List<Topic> topics = new ArrayList<Topic>(_type2Roles.keySet());
+ List<Topic> topics = CollectionFactory.createList(_type2Roles.keySet());
topics.remove(null);
return topics;
}
@@ -115,14 +114,14 @@
public Collection<Role> getRoles(Topic type) {
List<Role> roles = _type2Roles.get(type);
return roles == null ? Collections.<Role>emptySet()
- : new ArrayList<Role>(roles);
+ : CollectionFactory.createList(roles);
}
/* (non-Javadoc)
* @see org.tinytim.index.ITypeInstanceIndex#getOccurrenceTypes()
*/
public Collection<Topic> getOccurrenceTypes() {
- List<Topic> topics = new ArrayList<Topic>(_type2Occs.keySet());
+ List<Topic> topics = CollectionFactory.createList(_type2Occs.keySet());
topics.remove(null);
return topics;
}
@@ -133,14 +132,14 @@
public Collection<Occurrence> getOccurrences(Topic type) {
List<Occurrence> occs = _type2Occs.get(type);
return occs == null ? Collections.<Occurrence>emptySet()
- : new ArrayList<Occurrence>(occs);
+ : CollectionFactory.createList(occs);
}
/* (non-Javadoc)
* @see org.tinytim.index.ITypeInstanceIndex#getNameTypes()
*/
public Collection<Topic> getNameTypes() {
- List<Topic> topics = new ArrayList<Topic>(_type2Names.keySet());
+ List<Topic> topics = CollectionFactory.createList(_type2Names.keySet());
topics.remove(null);
return topics;
}
@@ -151,14 +150,14 @@
public Collection<Name> getNames(Topic type) {
List<Name> names = _type2Names.get(type);
return names == null ? Collections.<Name>emptySet()
- : new ArrayList<Name>(names);
+ : CollectionFactory.createList(names);
}
/* (non-Javadoc)
* @see org.tinytim.index.ITypeInstanceIndex#getTopicTypes()
*/
public Collection<Topic> getTopicTypes() {
- List<Topic> topics = new ArrayList<Topic>(_type2Topics.keySet());
+ List<Topic> topics = CollectionFactory.createList(_type2Topics.keySet());
topics.remove(null);
return topics;
}
@@ -169,7 +168,7 @@
public Collection<Topic> getTopics(Topic type) {
Set<Topic> topics = _type2Topics.get(type);
return topics == null ? Collections.<Topic>emptySet()
- : new ArrayList<Topic>(topics);
+ : CollectionFactory.createList(topics);
}
/* (non-Javadoc)
@@ -200,7 +199,7 @@
private void _index(Map<Topic, List<Typed>> type2Typed, Topic type, Typed typed) {
List<Typed> list = type2Typed.get(type);
if (list == null) {
- list = new ArrayList<Typed>();
+ list = CollectionFactory.createList();
type2Typed.put(type, list);
}
list.add(typed);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|