Java Utililty Methods Array Region Match

List of utility methods to do Array Region Match

  1. HOME
  2. Java
  3. A
  4. Array Region Match

Description

The list of methods to do Array Region Match are organized into topic(s).

Method

boolean arrayRegionMatches(char[] source, int sourceStart, char[] target, int targetStart, int len)
Convenience utility to compare two char[]s.
int sourceEnd = sourceStart + len;
int delta = targetStart - sourceStart;
for (int i = sourceStart; i < sourceEnd; i++) {
 if (source[i] != target[i + delta])
 return false;
return true;
boolean arrayRegionMatches(Object[] source, int sourceStart, Object[] target, int targetStart, int len)
Convenience utility to compare two Object[]s Ought to be in System.
int sourceEnd = sourceStart + len;
int delta = targetStart - sourceStart;
for (int i = sourceStart; i < sourceEnd; i++) {
 if (!arrayEquals(source[i], target[i + delta]))
 return false;
return true;
boolean arrayRegionMatches(Object[] source, int sourceStart, Object[] target, int targetStart, int len)
Convenience utility to compare two Object[]s Ought to be in System.
int sourceEnd = sourceStart + len;
int delta = targetStart - sourceStart;
for (int i = sourceStart; i < sourceEnd; i++) {
 if (!arrayEquals(source[i], target[i + delta]))
 return false;
return true;
boolean arrayRegionsEqual(boolean[] a, int aoff, int alen, boolean[] b, int boff, int blen)
array Regions Equal
if (alen != blen)
 return false;
else {
 for (int i = 0; i < alen; ++i)
 if (a[aoff + i] != b[boff + i])
 return false;
 return true;

AltStyle によって変換されたページ (->オリジナル) /