• R/O
  • SSH
  • HTTPS

cadencii: コミット


コミットメタ情報

リビジョン1770 (tree)
日時2011-11-12 21:41:53
作者kbinani

ログメッセージ

[luavsq] getCountメソッドの名前をsizesに変更

変更サマリ

差分

--- luavsq/trunk/EventList.lua (revision 1769)
+++ luavsq/trunk/EventList.lua (revision 1770)
@@ -169,7 +169,7 @@
169169
170170 ---
171171 -- @return [int]
172- function this:getCount()
172+ function this:size()
173173 return #self._events;
174174 end
175175
--- luavsq/trunk/Event.lua (revision 1769)
+++ luavsq/trunk/Event.lua (revision 1770)
@@ -78,10 +78,10 @@
7878 return false;
7979 end
8080 if( self.id.lyricHandle ~= nil and item.id.lyricHandle ~= nil )then
81- if( self.id.lyricHandle:getCount() ~= item.id.lyricHandle:getCount() )then
81+ if( self.id.lyricHandle:size() ~= item.id.lyricHandle:size() )then
8282 return false;
8383 end
84- local count = self.id.lyricHandle:getCount();
84+ local count = self.id.lyricHandle:size();
8585 local k;
8686 for k = 0, count - 1, 1 do
8787 if( not self.id.lyricHandle:getLyricAt( k ):equalsForSynth( item.id.lyricHandle:getLyricAt( k ) ) )then
@@ -154,8 +154,8 @@
154154 return false;
155155 end
156156 if( vibRateThis ~= nil and vibRateItem ~= nil )then
157- local numRateCount = vibRateThis:getCount();
158- if( numRateCount ~= vibRateItem:getCount() )then
157+ local numRateCount = vibRateThis:size();
158+ if( numRateCount ~= vibRateItem:size() )then
159159 return false;
160160 end
161161 local k;
@@ -179,8 +179,8 @@
179179 return false;
180180 end
181181 if( vibDepthThis ~= nil and vibDepthItem ~= nil )then
182- local numDepthCount = vibDepthThis:getCount();
183- if( numDepthCount ~= vibDepthItem:getCount() )then
182+ local numDepthCount = vibDepthThis:size();
183+ if( numDepthCount ~= vibDepthItem:size() )then
184184 return false;
185185 end
186186 local k;
--- luavsq/trunk/VibratoBPList.lua (revision 1769)
+++ luavsq/trunk/VibratoBPList.lua (revision 1770)
@@ -108,7 +108,7 @@
108108
109109 ---
110110 -- @return (integer)
111- function this:getCount()
111+ function this:size()
112112 return #self._list;
113113 end
114114
--- luavsq/trunk/Handle.lua (revision 1769)
+++ luavsq/trunk/Handle.lua (revision 1770)
@@ -297,27 +297,27 @@
297297 result = result .. "Caption=" .. self.caption .. "\n";
298298 result = result .. "Length=" .. self.length .. "\n";
299299 result = result .. "StartDepth=" .. self.startDepth .. "\n";
300- result = result .. "DepthBPNum=" .. self.depthBP:getCount() .. "\n";
301- if( self.depthBP:getCount() > 0 )then
300+ result = result .. "DepthBPNum=" .. self.depthBP:size() .. "\n";
301+ if( self.depthBP:size() > 0 )then
302302 result = result .. "DepthBPX=" .. string.format( "%.6f", self.depthBP:getElement( 0 ).x );
303- for i = 1, self.depthBP:getCount() - 1, 1 do
303+ for i = 1, self.depthBP:size() - 1, 1 do
304304 result = result .. "," .. string.format( "%.6f", self.depthBP:getElement( i ).x );
305305 end
306306 result = result .. "\n" .. "DepthBPY=" .. self.depthBP:getElement( 0 ).y;
307- for i = 1, self.depthBP:getCount() - 1, 1 do
307+ for i = 1, self.depthBP:size() - 1, 1 do
308308 result = result .. "," .. self.depthBP:getElement( i ).y;
309309 end
310310 result = result .. "\n";
311311 end
312312 result = result .. "StartRate=" .. self.startRate .. "\n";
313- result = result .. "RateBPNum=" .. self.rateBP:getCount();
314- if( self.rateBP:getCount() > 0 )then
313+ result = result .. "RateBPNum=" .. self.rateBP:size();
314+ if( self.rateBP:size() > 0 )then
315315 result = result .. "\n" .. "RateBPX=" .. string.format( "%.6f", self.rateBP:getElement( 0 ).x );
316- for i = 1, self.rateBP:getCount() - 1, 1 do
316+ for i = 1, self.rateBP:size() - 1, 1 do
317317 result = result .. "," .. string.format( "%.6f", self.rateBP:getElement( i ).x );
318318 end
319319 result = result .. "\n" .. "RateBPY=" .. self.rateBP:getElement( 0 ).y;
320- for i = 1, self.rateBP:getCount() - 1, 1 do
320+ for i = 1, self.rateBP:size() - 1, 1 do
321321 result = result .. "," .. self.rateBP:getElement( i ).y;
322322 end
323323 end
@@ -346,10 +346,10 @@
346346 result = result .. "EndDyn=" .. self.endDyn .. "\n";
347347 result = result .. "Length=" .. self.length .. "\n";
348348 if( nil ~= self.dynBP )then
349- if( self.dynBP:getCount() <= 0 )then
349+ if( self.dynBP:size() <= 0 )then
350350 result = result .. "DynBPNum=0";
351351 else
352- local c = self.dynBP:getCount();
352+ local c = self.dynBP:size();
353353 result = result .. "DynBPNum=" .. c .. "\n";
354354 result = result .. "DynBPX=" .. string.format( "%.6f", self.dynBP:getElement( 0 ).x );
355355 for i = 1, c - 1, 1 do
--- luavsq/trunk/tool/SourceFilePacker.java (revision 1769)
+++ luavsq/trunk/tool/SourceFilePacker.java (revision 1770)
@@ -71,7 +71,7 @@
7171 "-- See tool/makefile and tool/SourceFilePacker.java.",
7272 "",
7373 "if( nil == luavsq )then",
74- " luavsq = {};",
74+ "\tluavsq = {};",
7575 "end"
7676 };
7777 for( String line : license ){
@@ -146,6 +146,28 @@
146146 source = matcher.replaceAll( "\n" );
147147 }
148148
149+ // インデントをタブでやるようにする
150+ int tabCount = 0;
151+ while( true ){
152+ String patternString = "^";
153+ for( int i = 0; i < tabCount; i++ ){
154+ patternString += "\\t";
155+ }
156+ tabCount++;
157+ patternString += "[ ]{4}";
158+ pattern = Pattern.compile( patternString, Pattern.MULTILINE );
159+ matcher = pattern.matcher( source );
160+ if( matcher.find() ){
161+ String replace = "";
162+ for( int i = 0; i < tabCount; i++ ){
163+ replace += "\t";
164+ }
165+ source = matcher.replaceAll( replace );
166+ }else{
167+ break;
168+ }
169+ }
170+
149171 return source;
150172 }
151173
--- luavsq/trunk/LyricHandle.lua (revision 1769)
+++ luavsq/trunk/LyricHandle.lua (revision 1770)
@@ -65,7 +65,7 @@
6565
6666 ---
6767 -- @return (integer)
68- function this:getCount()
68+ function this:size()
6969 return #self.lyrics;
7070 end
7171
--- luavsq/trunk/test/EventListTest.lua (revision 1769)
+++ luavsq/trunk/test/EventListTest.lua (revision 1770)
@@ -3,7 +3,7 @@
33
44 function testConstruct()
55 local list = luavsq.EventList.new();
6- assert_equal( 0, list:getCount() );
6+ assert_equal( 0, list:size() );
77 end
88
99 function testFindIndexFromId()
@@ -87,12 +87,12 @@
8787 list:add( b, 14 );
8888 list:add( a, 20 );
8989
90- assert_equal( 2, list:getCount() );
90+ assert_equal( 2, list:size() );
9191 assert_equal( 20, list:getElement( 0 ).internalId );
9292
9393 list:clear();
9494
95- assert_equal( 0, list:getCount() );
95+ assert_equal( 0, list:size() );
9696 end
9797
9898 function testIterator()
@@ -138,21 +138,21 @@
138138 list:add( b, 2 );
139139 assert_equal( 100, list:getElement( 0 ).internalId );
140140 assert_equal( 2, list:getElement( 1 ).internalId );
141- assert_equal( 2, list:getCount() );
141+ assert_equal( 2, list:size() );
142142
143143 list:removeAt( 0 );
144144
145- assert_equal( 1, list:getCount() );
145+ assert_equal( 1, list:size() );
146146 assert_equal( 2, list:getElement( 0 ).internalId );
147147 end
148148
149149 function testGetCount()
150150 local list = luavsq.EventList.new();
151- assert_equal( 0, list:getCount() );
151+ assert_equal( 0, list:size() );
152152 local event = luavsq.Event.new( 0, luavsq.Id.new( 0 ) );
153153 event.id.type = luavsq.IdType.Anote;
154154 list:add( event );
155- assert_equal( 1, list:getCount() );
155+ assert_equal( 1, list:size() );
156156 end
157157
158158 function testGetAndSetElement()
--- luavsq/trunk/test/VibratoBPListTest.lua (revision 1769)
+++ luavsq/trunk/test/VibratoBPListTest.lua (revision 1770)
@@ -3,13 +3,13 @@
33
44 function testConstructWithString()
55 local list = luavsq.VibratoBPList.new( "2", "1.0,0.0", "128,1" );
6- assert_equal( 2, list:getCount() );
6+ assert_equal( 2, list:size() );
77 assert_equal( "0=1,1=128", list:getData() );
88 end
99
1010 function testConstructWithArray()
1111 local list = luavsq.VibratoBPList.new( { 1.0, 0.0 }, { 128, 1 } );
12- assert_equal( 2, list:getCount() );
12+ assert_equal( 2, list:size() );
1313 assert_equal( "0=1,1=128", list:getData() );
1414 end
1515
@@ -29,7 +29,7 @@
2929
3030 function testGetCount()
3131 local list = luavsq.VibratoBPList.new( { 0.0, 0.4, 1.0 }, { 1, 64, 128 } );
32- assert_equal( 3, list:getCount() );
32+ assert_equal( 3, list:size() );
3333 end
3434
3535 function testGetElement()
@@ -59,7 +59,7 @@
5959 function testSetData()
6060 local list = luavsq.VibratoBPList.new( {}, {} );
6161 list:setData( "0.4=64,0=1,1=128" );
62- assert_equal( 3, list:getCount() );
62+ assert_equal( 3, list:size() );
6363 assert_equal( 0, list:getElement( 0 ).x );
6464 assert_equal( 1, list:getElement( 0 ).y );
6565 assert_equal( 0.4, list:getElement( 1 ).x );
--- luavsq/trunk/test/HandleTest.lua (revision 1769)
+++ luavsq/trunk/test/HandleTest.lua (revision 1770)
@@ -118,11 +118,11 @@
118118 assert_equal( 1, #handle.lyrics );
119119
120120 assert_not_nil( handle.rateBP );
121- assert_equal( 0, handle.rateBP:getCount() );
121+ assert_equal( 0, handle.rateBP:size() );
122122 assert_not_nil( handle.depthBP );
123- assert_equal( 0, handle.depthBP:getCount() );
123+ assert_equal( 0, handle.depthBP:size() );
124124 assert_not_nil( handle.dynBP );
125- assert_equal( 0, handle.dynBP:getCount() );
125+ assert_equal( 0, handle.dynBP:size() );
126126
127127 local lyric = handle.lyrics[1];
128128 assert_equal( "あ", lyric.phrase );
@@ -171,9 +171,9 @@
171171 local handle = luavsq.Handle.new( stream, index, lastLine );
172172
173173 assert_not_nil( handle.rateBP );
174- assert_equal( 0, handle.rateBP:getCount() );
174+ assert_equal( 0, handle.rateBP:size() );
175175 assert_not_nil( handle.depthBP );
176- assert_equal( 0, handle.depthBP:getCount() );
176+ assert_equal( 0, handle.depthBP:size() );
177177 end
178178
179179 function testConstructSingerFromTextStream()
--- luavsq/trunk/test/LyricHandleTest.lua (revision 1769)
+++ luavsq/trunk/test/LyricHandleTest.lua (revision 1770)
@@ -4,7 +4,7 @@
44 function testConstruct()
55 local handle = luavsq.LyricHandle.new();
66 assert_equal( 0, handle.index );
7- assert_equal( 1, handle:getCount() );
7+ assert_equal( 1, handle:size() );
88 assert_equal( "a", handle:getLyricAt( 0 ).phrase );
99 assert_equal( "a", handle:getLyricAt( 0 ):getPhoneticSymbol() );
1010 end
@@ -12,7 +12,7 @@
1212 function testConstructWithPhrase()
1313 local handle = luavsq.LyricHandle.new( "は", "h a" );
1414 assert_equal( 0, handle.index );
15- assert_equal( 1, handle:getCount() );
15+ assert_equal( 1, handle:size() );
1616 assert_equal( "は", handle:getLyricAt( 0 ).phrase );
1717 assert_equal( "h a", handle:getLyricAt( 0 ):getPhoneticSymbol() );
1818 end
@@ -21,7 +21,7 @@
2121 local handle = luavsq.LyricHandle.new( "は", "h a" );
2222 local lyric = luavsq.Lyric.new( "ら", "4 a" );
2323 handle:setLyricAt( 1, lyric );
24- assert_equal( 2, handle:getCount() );
24+ assert_equal( 2, handle:size() );
2525 assert_true( handle:getLyricAt( 1 ):equals( lyric ) );
2626 end
2727
旧リポジトリブラウザで表示