mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v1.9.1.1
This commit is contained in:
38
400_xowa/src_060_utl/gplx/Int_list.java
Normal file
38
400_xowa/src_060_utl/gplx/Int_list.java
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx;
|
||||
public class Int_list {
|
||||
private int[] ary = Int_.Ary_empty; private int ary_len, ary_max;
|
||||
public void Add(int uid) {
|
||||
int new_len = ary_len + 1;
|
||||
if (new_len > ary_max) {
|
||||
ary_max += 16;
|
||||
int[] new_ary = new int[ary_max];
|
||||
Int_.Ary_copy_to(ary, ary_len, new_ary);
|
||||
ary = new_ary;
|
||||
}
|
||||
ary[ary_len] = uid;
|
||||
ary_len = new_len;
|
||||
}
|
||||
public int Len() {return ary_len;}
|
||||
public int Get_at(int i) {return ary[i];}
|
||||
public void Clear() {
|
||||
ary = Int_.Ary_empty;
|
||||
ary_len = ary_max = 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user