changeset 35:9d248304be96

added StringConcatTest
author shoshi
date Tue, 07 Dec 2010 18:42:51 +0900
parents b8b751a9fafb
children 9663c816e370
files src/treecms/proto/cassandra/CassandraNode.java src/treecms/proto/gui/GraphicalMonotonicTreeEditor.java src/treecms/proto/simple/RandomSimpleTreeBuilder.java src/treecms/proto/simple/SimpleEditor.java src/treecms/proto/test/StringConcatTest.java
diffstat 5 files changed, 54 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/src/treecms/proto/cassandra/CassandraNode.java	Mon Nov 29 19:45:42 2010 +0900
+++ b/src/treecms/proto/cassandra/CassandraNode.java	Tue Dec 07 18:42:51 2010 +0900
@@ -1,9 +1,8 @@
 package treecms.proto.cassandra;
 
-import org.apache.thrift.*;
+
 import org.apache.thrift.transport.*;
 import org.apache.thrift.protocol.*;
-import org.apache.cassandra.*;
 import org.apache.cassandra.thrift.Cassandra;
 
 import java.util.Iterator;
--- a/src/treecms/proto/gui/GraphicalMonotonicTreeEditor.java	Mon Nov 29 19:45:42 2010 +0900
+++ b/src/treecms/proto/gui/GraphicalMonotonicTreeEditor.java	Tue Dec 07 18:42:51 2010 +0900
@@ -140,6 +140,7 @@
 			setColumnIdentifiers(new String[]{"Key","Value"});
 		}
 		
+		@SuppressWarnings("unused")
 		public NodeEditorTableModel(Node _node)
 		{
 			this();
@@ -311,7 +312,7 @@
 			
 			if(source.equals(m_addButton)){
 				Node newNode = m_editor.edit(tableModel.getNode());
-				Node child = newNode.addChild(new SimpleNode());
+				newNode.addChild(new SimpleNode());
 				
 				ContentsViewerTreeModel treeModel = (ContentsViewerTreeModel)m_tree.getModel();
 				treeModel.setRootNode(m_editor.getUncommited(),true);
--- a/src/treecms/proto/simple/RandomSimpleTreeBuilder.java	Mon Nov 29 19:45:42 2010 +0900
+++ b/src/treecms/proto/simple/RandomSimpleTreeBuilder.java	Tue Dec 07 18:42:51 2010 +0900
@@ -35,12 +35,11 @@
 		return builder.generate();
 	}
 	
-	private int m_minRow,m_minCol;
+	private int m_minCol;
 	private int m_maxRow,m_maxCol;
 	
 	private RandomSimpleTreeBuilder(int _minRow,int _minCol,int _maxRow,int _maxCol)
 	{
-		m_minRow = _minRow;
 		m_minCol = _minCol;
 		m_maxRow = _maxRow;
 		m_maxCol = _maxCol;
--- a/src/treecms/proto/simple/SimpleEditor.java	Mon Nov 29 19:45:42 2010 +0900
+++ b/src/treecms/proto/simple/SimpleEditor.java	Tue Dec 07 18:42:51 2010 +0900
@@ -185,15 +185,5 @@
 		{
 			return m_right;
 		}
-		
-		public void setLeft(L _left)
-		{
-			m_left = _left;
-		}
-		
-		public void setRight(R _right)
-		{
-			m_right = _right;
-		}
 	}
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/treecms/proto/test/StringConcatTest.java	Tue Dec 07 18:42:51 2010 +0900
@@ -0,0 +1,50 @@
+package treecms.proto.test;
+
+import java.nio.CharBuffer;
+
+import org.junit.Test;
+import org.junit.runner.JUnitCore;
+
+
+public class StringConcatTest
+{
+	public static void main(String _args[])
+	{
+		JUnitCore.main(StringConcatTest.class.getName());
+	}
+	
+	private String m_str = "123456789012345678901234567890";
+	
+	@Test
+	public void testCharBuffer()
+	{
+		for(int j = 0;j < 1000;j ++){
+			CharBuffer buffer = CharBuffer.allocate(1000*30);
+			for(int i = 0;i < 1000;i ++){
+				buffer.append(m_str);
+			}
+		}
+	}
+	
+	@Test
+	public void testStringBuffer()
+	{
+		for(int j = 0;j < 1000;j ++){
+			StringBuffer tmp = new StringBuffer();
+			for(int i = 0;i < 1000;i ++){
+				tmp.append(m_str);
+			}
+		}
+	}
+	
+	@Test
+	public void testString()
+	{
+		for(int j = 0;j < 10;j ++){
+			String tmp = "";
+			for(int i = 0;i < 1000;i ++){
+				tmp += m_str; //Iketenai!!!!
+			}
+		}
+	}
+}