protected Vector<String> type() { Vector<String> types = new Vector<String>(); for (int i = 0; i < field.size(); i++) { types.add(fieldType(i)); } return types; }
public void setTargets(Vector pTargets) { for (int i = 0; i < pTargets.size(); i++) { int input2[] = (int[]) pTargets.get(i); // System.out.println("setT(x,y) = (" + input2[0] + "," + input2[1] + ")"); states[input2[0]][input2[1]].isTarget = true; getVal(input2[0], input2[1]).value = 6; getVal(input2[0], input2[1]).pherovalue = (float) 1.0; } this.Targets = pTargets; }
public static void main(String[] args) { // System.out.println( 5 >> 2 ); // System.out.println( (5 & 4) == 4 ); // System.out.println( 10 << 2 ); Vector<Integer> v = new Vector<>(); // ArrayList<Integer> v = new ArrayList<>(); /* long m, p, n; n = System.nanoTime(); for( int i=0; i<100000; i++ ){ v.add( i ); } p = System.nanoTime(); m = p - n; System.out.print( m + " " ); n = System.nanoTime(); for(int i=0; i<100000; i++ ){ v.add(i,-i); } p = System.nanoTime(); m = p - n; System.out.print( m + " " ); n = System.nanoTime(); for(int i=0; i<100000; i++ ){ v.remove(i); // v.remove(i); } p = System.nanoTime(); m = p - n; System.out.print( m ); n = System.nanoTime(); for(int i=0; i<99000; i++ ){ v.remove(0); // v.remove(i); } p = System.nanoTime(); m = p - n; System.out.println( m ); for(int i=0; i<1000; i++ ){ System.out.println( v.get(i)); } */ Integer[] x = new Integer[50]; for (int i = 0; i < x.length; i++) { x[i] = i; } v = new Vector<>(x); for (int i = 0; i < 10; i++) { v.remove(i); } for (int i = 0; i < v.size(); i++) { System.out.println(v.get(i)); } for (Integer k : v) { System.out.println("##" + k); } ArrayCollectionLocation<Integer> loc = new ArrayCollectionLocation<>(4, v); for (Iterator<Integer> iter = v.iterator(loc); iter.hasNext(); ) { System.out.println("#==#" + iter.next()); } }
public int size() { return field.size(); }