/** * Returns the number of elements in this list. * * @return the number of elements in this list. */ public int size() { return content.size(); } }
/** * Returns the number of elements in this list. * * @return the number of elements in this list. */ public int size() { return content.size(); } }
/** * Returns a <code>java.util.ArrayList</code> containing all the elements in * the receiver. */ public java.util.ArrayList toList() { int mySize = size(); Object[] theElements = elements; java.util.ArrayList list = new java.util.ArrayList(mySize); for (int i = 0; i < mySize; i++) list.add(theElements[i]); return list; }
/** * Returns a <code>java.util.ArrayList</code> containing all the elements in the receiver. */ public java.util.ArrayList toList() { int mySize = size(); Object[] theElements = elements; java.util.ArrayList list = new java.util.ArrayList(mySize); for (int i=0; i < mySize; i++) list.add(theElements[i]); return list; } /**
/** * Returns a <code>java.util.ArrayList</code> containing all the elements in the receiver. */ public java.util.ArrayList toList() { int mySize = size(); Object[] theElements = elements; java.util.ArrayList list = new java.util.ArrayList(mySize); for (int i=0; i < mySize; i++) list.add(theElements[i]); return list; } /**
/** * Trims the capacity of the receiver to be the receiver's current * size. Releases any superfluos internal memory. An application can use this operation to minimize the * storage of the receiver. */ public void trimToSize() { elements = cern.colt.Arrays.trimToCapacity(elements,size()); } }
/** * Trims the capacity of the receiver to be the receiver's current * size. Releases any superfluos internal memory. An application can use this operation to minimize the * storage of the receiver. */ public void trimToSize() { elements = cern.colt.Arrays.trimToCapacity(elements,size()); } }
/** * Trims the capacity of the receiver to be the receiver's current size. * Releases any superfluos internal memory. An application can use this * operation to minimize the storage of the receiver. */ public void trimToSize() { elements = (T[]) cern.colt.Arrays.trimToCapacity(elements, size()); } }
private static boolean isValidHSSRoute(ObjectArrayList route) { for (int i = 0; i < route.size(); i++) { if (route.get(i) == null) { return false; } } return true; }
/** * Adds all elements of the specified list to the receiver. * @param list the list of which all elements shall be added. */ public void addAllOf(ObjectArrayList list) { int listSize = list.size(); if (this.size + listSize >= this.capacity) flush(); this.target.addAllOf(list); } /**
private static void clear(ObjectArrayList cts) { for (int i = 0; i < cts.size(); i++) { ((ICompactTripletsStructure) cts.get(i)).clear(); } }
/** * Returns a list which is a concatenation of <code>times</code> times the receiver. * @param times the number of times the receiver shall be copied. */ public ObjectArrayList times(int times) { ObjectArrayList newList = new ObjectArrayList(times*size); for (int i=times; --i >= 0; ) { newList.addAllOfFromTo(this,0,size()-1); } return newList; } /**
/** * Adds all elements of the specified list to the receiver. * @param list the list of which all elements shall be added. */ public void addAllOf(ObjectArrayList list) { int listSize = list.size(); if (this.size + listSize >= this.capacity) flush(); this.target.addAllOf(list); } /**
/** * Returns a list which is a concatenation of <code>times</code> times the receiver. * @param times the number of times the receiver shall be copied. */ public ObjectArrayList times(int times) { ObjectArrayList newList = new ObjectArrayList(times*size); for (int i=times; --i >= 0; ) { newList.addAllOfFromTo(this,0,size()-1); } return newList; } /**
public int getClausesCount() { int clausesCount = 0; for (int i = 0; i < tiers.size(); i++) { ITier tier = (ITier) tiers.get(i); clausesCount += tier.size(); } return clausesCount; }
/** * Returns a string representation of the receiver, containing * the String representation of each element. */ public String toString() { return cern.colt.Arrays.toString(partFromTo(0, size()-1).elements()); } /**
/** * Returns a string representation of the receiver, containing * the String representation of each element. */ public String toString() { return cern.colt.Arrays.toString(partFromTo(0, size()-1).elements()); } /**
private int getCacheKey(ObjectArrayList cts) { int result = 1; for (int i = 0; i < cts.size(); i++) { IPermutation permutation = ((ICompactTripletsStructureHolder) cts.get(i)).getCTS().getPermutation(); // See Arrays.hashCode(int[]) result = 31 * result + permutation.elementsHash(); } return result; }
public IVertex getBottomVertex2() { return (!bottom2Empty) && (tierIndex < hyperStructure.getTiers().size() - 1) ? (IVertex) ((OpenIntObjectHashMap) hyperStructure.getTiers().get(tierIndex + 1)).get(tripletValue.getAdjoinRightTarget2().getTierKey()) : null; } public IVertex getTopVertex1()
public IVertex getBottomVertex1() { return (!bottom1Empty) && (tierIndex < hyperStructure.getTiers().size() - 1) ? (IVertex) ((OpenIntObjectHashMap) hyperStructure.getTiers().get(tierIndex + 1)).get(tripletValue.getAdjoinRightTarget1().getTierKey()) : null; } public IVertex getBottomVertex2()