2013/9/26 hao5ang <waohao@gmail.com>:
I want use list to implement it. Because I want delete one row or delete one
field, such as this in Java:
LinkedList<LinkedList<Integer>> data = new
LinkedList<LinkedList<Integer>>();
for (Iterator<LinkedList<Integer>> o = data.iterator(); o.hasNext();) {
LinkedList<Integer> list = o.next();
for (Iterator<Integer> i = list.iterator(); i.hasNext();) {
Integer value = (Integer) i.next();
if (value == 1) {
o.remove();
}
}
}
I have looked up the document of list in Go. I find it's so different with
Java.
I want use list to implement it. Because I want delete one row or delete one
field, such as this in Java:
LinkedList<LinkedList<Integer>> data = new
LinkedList<LinkedList<Integer>>();
for (Iterator<LinkedList<Integer>> o = data.iterator(); o.hasNext();) {
LinkedList<Integer> list = o.next();
for (Iterator<Integer> i = list.iterator(); i.hasNext();) {
Integer value = (Integer) i.next();
if (value == 1) {
o.remove();
}
}
}
I have looked up the document of list in Go. I find it's so different with
Java.
same data structure as your LinkedList from Java... There's also
http://code.google.com/p/go-wiki/wiki/SliceTricks for ways to
accomplish the same with slices.
//jb
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.