Tabnine Logo
ArrayUtils.indexOf
Code IndexAdd Tabnine to your IDE (free)

How to use
indexOf
method
in
org.glassfish.grizzly.utils.ArrayUtils

Best Java code snippets using org.glassfish.grizzly.utils.ArrayUtils.indexOf (Showing top 20 results out of 315)

origin: org.glassfish.grizzly/grizzly-websockets-server

/**
 * {@inheritDoc}
 */
@Override
public boolean containsAll(Collection<?> collection) {
  if (collection.isEmpty()) {
    return true;
  }
  final Object[] localArray = array;
  for (Object element : collection) {
    if (ArrayUtils.indexOf(localArray, element) == -1) {
      return false;
    }
  }
  return true;
}
origin: javaee/grizzly

/**
 * {@inheritDoc}
 */
@Override
public boolean containsAll(Collection<?> collection) {
  if (collection.isEmpty()) {
    return true;
  }
  final Object[] localArray = array;
  for (Object element : collection) {
    if (ArrayUtils.indexOf(localArray, element) == -1) {
      return false;
    }
  }
  return true;
}
origin: javaee/grizzly

/**
 * {@inheritDoc}
 */
@Override
public boolean containsAll(Collection<?> collection) {
  if (collection.isEmpty()) {
    return true;
  }
  final Object[] localArray = array;
  for (Object element : collection) {
    if (ArrayUtils.indexOf(localArray, element) == -1) {
      return false;
    }
  }
  return true;
}
origin: javaee/grizzly

/**
 * {@inheritDoc}
 */
@Override
public boolean containsAll(Collection<?> collection) {
  if (collection.isEmpty()) {
    return true;
  }
  final Object[] localArray = array;
  for (Object element : collection) {
    if (ArrayUtils.indexOf(localArray, element) == -1) {
      return false;
    }
  }
  return true;
}
origin: javaee/grizzly

/**
 * {@inheritDoc}
 */
@Override
public boolean containsAll(Collection<?> collection) {
  if (collection.isEmpty()) {
    return true;
  }
  final Object[] localArray = array;
  for (Object element : collection) {
    if (ArrayUtils.indexOf(localArray, element) == -1) {
      return false;
    }
  }
  return true;
}
origin: javaee/grizzly

/**
 * {@inheritDoc}
 */
@Override
public boolean containsAll(Collection<?> collection) {
  if (collection.isEmpty()) {
    return true;
  }
  final Object[] localArray = array;
  for (Object element : collection) {
    if (ArrayUtils.indexOf(localArray, element) == -1) {
      return false;
    }
  }
  return true;
}
origin: javaee/grizzly

/**
 * {@inheritDoc}
 */
@Override
public boolean containsAll(Collection<?> collection) {
  if (collection.isEmpty()) {
    return true;
  }
  final Object[] localArray = array;
  for (Object element : collection) {
    if (ArrayUtils.indexOf(localArray, element) == -1) {
      return false;
    }
  }
  return true;
}
origin: javaee/grizzly

/**
 * {@inheritDoc}
 */
@Override
public boolean containsAll(Collection<?> collection) {
  if (collection.isEmpty()) {
    return true;
  }
  final Object[] localArray = array;
  for (Object element : collection) {
    if (ArrayUtils.indexOf(localArray, element) == -1) {
      return false;
    }
  }
  return true;
}
origin: javaee/grizzly

/**
 * {@inheritDoc}
 */
@Override
public boolean containsAll(Collection<?> collection) {
  if (collection.isEmpty()) {
    return true;
  }
  final Object[] localArray = array;
  for (Object element : collection) {
    if (ArrayUtils.indexOf(localArray, element) == -1) {
      return false;
    }
  }
  return true;
}
origin: org.glassfish.grizzly/grizzly-core

/**
 * {@inheritDoc}
 */
@Override
public boolean containsAll(Collection<?> collection) {
  if (collection.isEmpty()) {
    return true;
  }
  final Object[] localArray = array;
  for (Object element : collection) {
    if (ArrayUtils.indexOf(localArray, element) == -1) {
      return false;
    }
  }
  return true;
}
origin: org.mule.glassfish.grizzly/grizzly-framework

/**
 * {@inheritDoc}
 */
@Override
public boolean containsAll(Collection<?> collection) {
  if (collection.isEmpty()) {
    return true;
  }
  final Object[] localArray = array;
  for (Object element : collection) {
    if (ArrayUtils.indexOf(localArray, element) == -1) {
      return false;
    }
  }
  return true;
}
origin: org.glassfish.grizzly/grizzly-http-server-core

/**
 * {@inheritDoc}
 */
@Override
public boolean containsAll(Collection<?> collection) {
  if (collection.isEmpty()) {
    return true;
  }
  final Object[] localArray = array;
  for (Object element : collection) {
    if (ArrayUtils.indexOf(localArray, element) == -1) {
      return false;
    }
  }
  return true;
}
origin: javaee/grizzly

/**
 * Add unique element to the array.
 * @param <T> type of the array element
 * @param array array
 * @param element element to add
 * @param replaceElementIfEquals if passed element is equal to some element
 *              in the array then depending on this parameter it will be
 *              replaced or not with the passed element.
 *
 * @return array, which will contain the new element. Either new array instance, if
 * passed array didn't contain the element, or the same array instance, if the element
 * is already present in the array.
 */
public static <T> T[] addUnique(final T[] array, final T element,
    final boolean replaceElementIfEquals) {
  
  final int idx = indexOf(array, element);
  if (idx == -1) {
    final int length = array.length;
    final T[] newArray = Arrays.copyOf(array, length + 1);
    newArray[length] = element;
    return newArray;
  }
  
  if (replaceElementIfEquals) {
    array[idx] = element;
  }
  
  return array;
}
origin: org.glassfish.grizzly/grizzly-core

/**
 * Add unique element to the array.
 * @param <T> type of the array element
 * @param array array
 * @param element element to add
 * @param replaceElementIfEquals if passed element is equal to some element
 *              in the array then depending on this parameter it will be
 *              replaced or not with the passed element.
 *
 * @return array, which will contain the new element. Either new array instance, if
 * passed array didn't contain the element, or the same array instance, if the element
 * is already present in the array.
 */
public static <T> T[] addUnique(final T[] array, final T element,
    final boolean replaceElementIfEquals) {
  
  final int idx = indexOf(array, element);
  if (idx == -1) {
    final int length = array.length;
    final T[] newArray = Arrays.copyOf(array, length + 1);
    newArray[length] = element;
    return newArray;
  }
  
  if (replaceElementIfEquals) {
    array[idx] = element;
  }
  
  return array;
}
origin: javaee/grizzly

/**
 * Add unique element to the array.
 * @param <T> type of the array element
 * @param array array
 * @param element element to add
 * @param replaceElementIfEquals if passed element is equal to some element
 *              in the array then depending on this parameter it will be
 *              replaced or not with the passed element.
 *
 * @return array, which will contain the new element. Either new array instance, if
 * passed array didn't contain the element, or the same array instance, if the element
 * is already present in the array.
 */
public static <T> T[] addUnique(final T[] array, final T element,
    final boolean replaceElementIfEquals) {
  
  final int idx = indexOf(array, element);
  if (idx == -1) {
    final int length = array.length;
    final T[] newArray = Arrays.copyOf(array, length + 1);
    newArray[length] = element;
    return newArray;
  }
  
  if (replaceElementIfEquals) {
    array[idx] = element;
  }
  
  return array;
}
origin: org.glassfish.grizzly/grizzly-http-server-core

/**
 * Add unique element to the array.
 * @param <T> type of the array element
 * @param array array
 * @param element element to add
 * @param replaceElementIfEquals if passed element is equal to some element
 *              in the array then depending on this parameter it will be
 *              replaced or not with the passed element.
 *
 * @return array, which will contain the new element. Either new array instance, if
 * passed array didn't contain the element, or the same array instance, if the element
 * is already present in the array.
 */
public static <T> T[] addUnique(final T[] array, final T element,
    final boolean replaceElementIfEquals) {
  
  final int idx = indexOf(array, element);
  if (idx == -1) {
    final int length = array.length;
    final T[] newArray = Arrays.copyOf(array, length + 1);
    newArray[length] = element;
    return newArray;
  }
  
  if (replaceElementIfEquals) {
    array[idx] = element;
  }
  
  return array;
}
origin: javaee/grizzly

/**
 * Add unique element to the array.
 * @param <T> type of the array element
 * @param array array
 * @param element element to add
 * @param replaceElementIfEquals if passed element is equal to some element
 *              in the array then depending on this parameter it will be
 *              replaced or not with the passed element.
 *
 * @return array, which will contain the new element. Either new array instance, if
 * passed array didn't contain the element, or the same array instance, if the element
 * is already present in the array.
 */
public static <T> T[] addUnique(final T[] array, final T element,
    final boolean replaceElementIfEquals) {
  
  final int idx = indexOf(array, element);
  if (idx == -1) {
    final int length = array.length;
    final T[] newArray = Arrays.copyOf(array, length + 1);
    newArray[length] = element;
    return newArray;
  }
  
  if (replaceElementIfEquals) {
    array[idx] = element;
  }
  
  return array;
}
origin: org.mule.glassfish.grizzly/grizzly-framework

/**
 * Add unique element to the array.
 * @param <T> type of the array element
 * @param array array
 * @param element element to add
 * @param replaceElementIfEquals if passed element is equal to some element
 *              in the array then depending on this parameter it will be
 *              replaced or not with the passed element.
 *
 * @return array, which will contain the new element. Either new array instance, if
 * passed array didn't contain the element, or the same array instance, if the element
 * is already present in the array.
 */
public static <T> T[] addUnique(final T[] array, final T element,
    final boolean replaceElementIfEquals) {
  
  final int idx = indexOf(array, element);
  if (idx == -1) {
    final int length = array.length;
    final T[] newArray = Arrays.copyOf(array, length + 1);
    newArray[length] = element;
    return newArray;
  }
  
  if (replaceElementIfEquals) {
    array[idx] = element;
  }
  
  return array;
}
origin: org.glassfish.grizzly/grizzly-websockets-server

final int idx = indexOf(array, element);
if (idx != -1) {
  final int length = array.length;
origin: javaee/grizzly

final int idx = indexOf(array, element);
if (idx != -1) {
  final int length = array.length;
org.glassfish.grizzly.utilsArrayUtilsindexOf

Javadoc

Return the element index in the array.

Popular methods of ArrayUtils

  • addUnique
    Add unique element to the array.
  • binarySearch
  • remove
    Removes the element from the array.

Popular in Java

  • Running tasks concurrently on multiple threads
  • putExtra (Intent)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • setContentView (Activity)
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now