Revision: 17567
http://sourceforge.net/p/gate/code/17567
Author: markagreenwood
Date: 2014-03-06 15:24:27 +0000 (Thu, 06 Mar 2014)
Log Message:
-----------
mostly finished with the generics in here
Modified Paths:
--------------
gate/trunk/src/main/gate/corpora/SerialCorpusImpl.java
Modified: gate/trunk/src/main/gate/corpora/SerialCorpusImpl.java
===================================================================
--- gate/trunk/src/main/gate/corpora/SerialCorpusImpl.java 2014-03-06
15:05:48 UTC (rev 17566)
+++ gate/trunk/src/main/gate/corpora/SerialCorpusImpl.java 2014-03-06
15:24:27 UTC (rev 17567)
@@ -150,9 +150,9 @@
public List getDocumentPersistentIDs() {
List docsIDs = new ArrayList();
if(docDataList == null) return docsIDs;
- Iterator iter = docDataList.iterator();
+ Iterator<DocumentData> iter = docDataList.iterator();
while(iter.hasNext()) {
- DocumentData data = (DocumentData)iter.next();
+ DocumentData data = iter.next();
docsIDs.add(data.getPersistentID());
}
return docsIDs;
@@ -422,7 +422,8 @@
@Override
public synchronized void removeCorpusListener(CorpusListener l) {
if(corpusListeners != null && corpusListeners.contains(l)) {
- Vector v = (Vector)corpusListeners.clone();
+ @SuppressWarnings("unchecked")
+ Vector<CorpusListener> v =
(Vector<CorpusListener>)corpusListeners.clone();
v.removeElement(l);
corpusListeners = v;
}
@@ -654,7 +655,7 @@
}
@Override
- public Object[] toArray(Object[] a) {
+ public <T> T[] toArray(T[] a) {
// there is a problem here, because some docs might not be
// instantiated
throw new MethodNotImplementedException(
@@ -750,8 +751,8 @@
}// findDocument
@Override
- public boolean containsAll(Collection c) {
- Iterator iter = c.iterator();
+ public boolean containsAll(Collection<?> c) {
+ Iterator<?> iter = c.iterator();
while(iter.hasNext()) {
if(!contains(iter.next())) return false;
}
@@ -769,14 +770,14 @@
}
@Override
- public boolean addAll(int index, Collection c) {
+ public boolean addAll(int index, Collection<? extends Document> c) {
throw new UnsupportedOperationException();
}
@Override
- public boolean removeAll(Collection c) {
+ public boolean removeAll(Collection<?> c) {
boolean allRemoved = true;
- Iterator iter = c.iterator();
+ Iterator<?> iter = c.iterator();
while(iter.hasNext()) {
if(!remove(iter.next())) allRemoved = false;
}
@@ -785,7 +786,7 @@
}
@Override
- public boolean retainAll(Collection c) {
+ public boolean retainAll(Collection<?> c) {
throw new UnsupportedOperationException();
}
@@ -905,12 +906,12 @@
}
@Override
- public ListIterator listIterator() {
+ public ListIterator<Document> listIterator() {
throw new gate.util.MethodNotImplementedException();
}
@Override
- public ListIterator listIterator(int index) {
+ public ListIterator<Document> listIterator(int index) {
throw new gate.util.MethodNotImplementedException();
}
@@ -919,7 +920,7 @@
* might no be in memory
*/
@Override
- public List subList(int fromIndex, int toIndex) {
+ public List<Document> subList(int fromIndex, int toIndex) {
throw new gate.util.MethodNotImplementedException();
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works.
Faster operations. Version large binaries. Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs