ObjectArrayList<Transition> getTransitions() { if (transitions == null) { transitions = new ObjectArrayList<>(domain.size() * 2); for (DependencyNode node : domain) { if (node.transitions != null) { for (ObjectCursor<Transition> cursor : node.transitionList) { Transition transition = cursor.value; if (transition.filter != null || transition.destination.typeSet != this) { transitions.add(transition); } } } } } return transitions; }
/** * Adds all elements from another iterable. */ public int addAll(Iterable<? extends ObjectCursor<? extends KType>> iterable) { int size = 0; for (ObjectCursor<? extends KType> cursor : iterable) { add(cursor.value); size++; } return size; }
public void add(byte[] bytes) { bytesList.add(bytes); totalSize += bytes.length; }
/** * Vararg-signature method for adding elements at the end of the list. * <p> * <b>This method is handy, but costly if used in tight loops (anonymous array * passing)</b> * </p> */ /* */ @SafeVarargs /* */ public final void add(KType... elements) { add(elements, 0, elements.length); }
/** * Create a list from a variable number of arguments or an array of <code>Object</code>. * The elements are copied from the argument to the internal buffer. */ /* */ @SafeVarargs /* */ public static <KType> ObjectArrayList<KType> from(KType... elements) { final ObjectArrayList<KType> list = new ObjectArrayList<KType>(elements.length); list.add(elements); return list; } }
/** * Adds all elements from another container. */ public int addAll(ObjectContainer<? extends KType> container) { final int size = container.size(); ensureBufferSpace(size); for (ObjectCursor<? extends KType> cursor : container) { add(cursor.value); } return size; }
/** * Adds all elements from another iterable. */ public int addAll(Iterable<? extends ObjectCursor<? extends KType>> iterable) { int size = 0; for (ObjectCursor<? extends KType> cursor : iterable) { add(cursor.value); size++; } return size; }
public void add(byte[] bytes) { bytesList.add(bytes); totalSize += bytes.length; }
public void add(byte[] bytes) { bytesList.add(bytes); totalSize += bytes.length; }
public void add(final byte[] bytes) { bytesList.add(bytes); totalSize += bytes.length; }
public void add(byte[] bytes) { bytesList.add(bytes); totalSize += bytes.length; }
public void add(byte[] bytes) { bytesList.add(bytes); totalSize += bytes.length; }
/** * Vararg-signature method for adding elements at the end of the list. * <p> * <b>This method is handy, but costly if used in tight loops (anonymous array * passing)</b> * </p> */ /* */ @SafeVarargs /* */ public final void add(KType... elements) { add(elements, 0, elements.length); }
/** * Create a list from a variable number of arguments or an array of <code>Object</code>. * The elements are copied from the argument to the internal buffer. */ /* */ @SafeVarargs /* */ public static <KType> ObjectArrayList<KType> from(KType... elements) { final ObjectArrayList<KType> list = new ObjectArrayList<KType>(elements.length); list.add(elements); return list; } }
/** * Adds all elements from another container. */ public int addAll(ObjectContainer<? extends KType> container) { final int size = container.size(); ensureBufferSpace(size); for (ObjectCursor<? extends KType> cursor : container) { add(cursor.value); } return size; }
private void relax(int nodeId) { IntHashSet connected = new IntHashSet(); int w; do { w = stack.pop(); onStack.clear(w); connected.add(w); } while (w != nodeId); connectedComponents.add(connected); int size = connected.size(); if (size < minSetSize) { minSetSize = size; } if (size > maxSetSize) { maxSetSize = size; } }
private void relax(int nodeId) { IntHashSet connected = new IntHashSet(); int w; do { w = stack.pop(); onStack.clear(w); connected.add(w); } while (w != nodeId); connectedComponents.add(connected); int size = connected.size(); if (size < minSetSize) { minSetSize = size; } if (size > maxSetSize) { maxSetSize = size; } }
/** * Deletes the given indices from the tests cluster. If no index name is passed to this method * all indices are removed. */ public void wipeIndices(String... indices) { assert indices != null && indices.length > 0; if (size() > 0) { try { assertAcked(client().admin().indices().prepareDelete(indices)); } catch (IndexNotFoundException e) { // ignore } catch (IllegalArgumentException e) { // Happens if `action.destructive_requires_name` is set to true // which is the case in the CloseIndexDisableCloseAllTests if ("_all".equals(indices[0])) { ClusterStateResponse clusterStateResponse = client().admin().cluster().prepareState().execute().actionGet(); ObjectArrayList<String> concreteIndices = new ObjectArrayList<>(); for (IndexMetaData indexMetaData : clusterStateResponse.getState().metaData()) { concreteIndices.add(indexMetaData.getIndex().getName()); } if (!concreteIndices.isEmpty()) { assertAcked(client().admin().indices().prepareDelete(concreteIndices.toArray(String.class))); } } } } }