Tabnine Logo
DataType.compare
Code IndexAdd Tabnine to your IDE (free)

How to use
compare
method
in
org.h2.mvstore.type.DataType

Best Java code snippets using org.h2.mvstore.type.DataType.compare (Showing top 19 results out of 315)

origin: com.h2database/h2

/**
 * Compare two keys.
 *
 * @param a the first key
 * @param b the second key
 * @return -1 if the first key is smaller, 1 if bigger, 0 if equal
 */
int compare(Object a, Object b) {
  return keyType.compare(a, b);
}
origin: com.h2database/h2

/**
 * Check whether the two values are equal.
 *
 * @param a the first value
 * @param b the second value
 * @return true if they are equal
 */
public boolean areValuesEqual(Object a, Object b) {
  if (a == b) {
    return true;
  } else if (a == null || b == null) {
    return false;
  }
  return valueType.compare(a, b) == 0;
}
origin: com.h2database/h2

@Override
public int compare(Object aObj, Object bObj) {
  if (aObj == bObj) {
    return 0;
  }
  Object[] a = (Object[]) aObj;
  Object[] b = (Object[]) bObj;
  for (int i = 0; i < arrayLength; i++) {
    DataType t = elementTypes[i];
    int comp = t.compare(a[i], b[i]);
    if (comp != 0) {
      return comp;
    }
  }
  return 0;
}
origin: com.h2database/h2

@Override
public int compare(Object aObj, Object bObj) {
  if (aObj == bObj) {
    return 0;
  }
  VersionedValue a = (VersionedValue) aObj;
  VersionedValue b = (VersionedValue) bObj;
  long comp = a.operationId - b.operationId;
  if (comp == 0) {
    return valueType.compare(a.value, b.value);
  }
  return Long.signum(comp);
}
origin: com.h2database/h2

@SuppressWarnings("unchecked")
@Override
public int compare(Object aObj, Object bObj) {
  if (aObj == bObj) {
    return 0;
  }
  DataType ta = getType(aObj);
  DataType tb = getType(bObj);
  if (ta != this || tb != this) {
    if (ta == tb) {
      return ta.compare(aObj, bObj);
    }
    return super.compare(aObj, bObj);
  }
  // TODO ensure comparable type (both may be comparable but not
  // with each other)
  if (aObj instanceof Comparable) {
    if (aObj.getClass().isAssignableFrom(bObj.getClass())) {
      return ((Comparable<Object>) aObj).compareTo(bObj);
    }
  }
  if (bObj instanceof Comparable) {
    if (bObj.getClass().isAssignableFrom(aObj.getClass())) {
      return -((Comparable<Object>) bObj).compareTo(aObj);
    }
  }
  byte[] a = serialize(aObj);
  byte[] b = serialize(bObj);
  return compareNotNull(a, b);
}
origin: com.h2database/h2

if (to != null && map.getKeyType().compare(k, to) > 0) {
  break;
origin: com.h2database/h2-mvstore

/**
 * Compare two keys.
 *
 * @param a the first key
 * @param b the second key
 * @return -1 if the first key is smaller, 1 if bigger, 0 if equal
 */
int compare(Object a, Object b) {
  return keyType.compare(a, b);
}
origin: org.wowtools/h2

/**
 * Compare two keys.
 *
 * @param a the first key
 * @param b the second key
 * @return -1 if the first key is smaller, 1 if bigger, 0 if equal
 */
int compare(Object a, Object b) {
  return keyType.compare(a, b);
}
origin: com.eventsourcing/h2

/**
 * Compare two keys.
 *
 * @param a the first key
 * @param b the second key
 * @return -1 if the first key is smaller, 1 if bigger, 0 if equal
 */
int compare(Object a, Object b) {
  return keyType.compare(a, b);
}
origin: com.h2database/h2-mvstore

/**
 * Check whether the two values are equal.
 *
 * @param a the first value
 * @param b the second value
 * @return true if they are equal
 */
public boolean areValuesEqual(Object a, Object b) {
  if (a == b) {
    return true;
  } else if (a == null || b == null) {
    return false;
  }
  return valueType.compare(a, b) == 0;
}
origin: com.eventsourcing/h2

/**
 * Check whether the two values are equal.
 *
 * @param a the first value
 * @param b the second value
 * @return true if they are equal
 */
public boolean areValuesEqual(Object a, Object b) {
  if (a == b) {
    return true;
  } else if (a == null || b == null) {
    return false;
  }
  return valueType.compare(a, b) == 0;
}
origin: org.wowtools/h2

/**
 * Check whether the two values are equal.
 *
 * @param a the first value
 * @param b the second value
 * @return true if they are equal
 */
public boolean areValuesEqual(Object a, Object b) {
  if (a == b) {
    return true;
  } else if (a == null || b == null) {
    return false;
  }
  return valueType.compare(a, b) == 0;
}
origin: org.wowtools/h2

@Override
public int compare(Object aObj, Object bObj) {
  if (aObj == bObj) {
    return 0;
  }
  Object[] a = (Object[]) aObj;
  Object[] b = (Object[]) bObj;
  for (int i = 0; i < arrayLength; i++) {
    DataType t = elementTypes[i];
    int comp = t.compare(a[i], b[i]);
    if (comp != 0) {
      return comp;
    }
  }
  return 0;
}
origin: com.eventsourcing/h2

@Override
public int compare(Object aObj, Object bObj) {
  if (aObj == bObj) {
    return 0;
  }
  Object[] a = (Object[]) aObj;
  Object[] b = (Object[]) bObj;
  for (int i = 0; i < arrayLength; i++) {
    DataType t = elementTypes[i];
    int comp = t.compare(a[i], b[i]);
    if (comp != 0) {
      return comp;
    }
  }
  return 0;
}
origin: com.eventsourcing/h2

@Override
public int compare(Object aObj, Object bObj) {
  if (aObj == bObj) {
    return 0;
  }
  VersionedValue a = (VersionedValue) aObj;
  VersionedValue b = (VersionedValue) bObj;
  long comp = a.operationId - b.operationId;
  if (comp == 0) {
    return valueType.compare(a.value, b.value);
  }
  return Long.signum(comp);
}
origin: org.wowtools/h2

@Override
public int compare(Object aObj, Object bObj) {
  if (aObj == bObj) {
    return 0;
  }
  VersionedValue a = (VersionedValue) aObj;
  VersionedValue b = (VersionedValue) bObj;
  long comp = a.operationId - b.operationId;
  if (comp == 0) {
    return valueType.compare(a.value, b.value);
  }
  return Long.signum(comp);
}
origin: com.eventsourcing/h2

@SuppressWarnings("unchecked")
@Override
public int compare(Object aObj, Object bObj) {
  if (aObj == bObj) {
    return 0;
  }
  DataType ta = getType(aObj);
  DataType tb = getType(bObj);
  if (ta != this || tb != this) {
    if (ta == tb) {
      return ta.compare(aObj, bObj);
    }
    return super.compare(aObj, bObj);
  }
  // TODO ensure comparable type (both may be comparable but not
  // with each other)
  if (aObj instanceof Comparable) {
    if (aObj.getClass().isAssignableFrom(bObj.getClass())) {
      return ((Comparable<Object>) aObj).compareTo(bObj);
    }
  }
  if (bObj instanceof Comparable) {
    if (bObj.getClass().isAssignableFrom(aObj.getClass())) {
      return -((Comparable<Object>) bObj).compareTo(aObj);
    }
  }
  byte[] a = serialize(aObj);
  byte[] b = serialize(bObj);
  return compareNotNull(a, b);
}
origin: com.h2database/h2-mvstore

@SuppressWarnings("unchecked")
@Override
public int compare(Object aObj, Object bObj) {
  if (aObj == bObj) {
    return 0;
  }
  DataType ta = getType(aObj);
  DataType tb = getType(bObj);
  if (ta != this || tb != this) {
    if (ta == tb) {
      return ta.compare(aObj, bObj);
    }
    return super.compare(aObj, bObj);
  }
  // TODO ensure comparable type (both may be comparable but not
  // with each other)
  if (aObj instanceof Comparable) {
    if (aObj.getClass().isAssignableFrom(bObj.getClass())) {
      return ((Comparable<Object>) aObj).compareTo(bObj);
    }
  }
  if (bObj instanceof Comparable) {
    if (bObj.getClass().isAssignableFrom(aObj.getClass())) {
      return -((Comparable<Object>) bObj).compareTo(aObj);
    }
  }
  byte[] a = serialize(aObj);
  byte[] b = serialize(bObj);
  return compareNotNull(a, b);
}
origin: org.wowtools/h2

@SuppressWarnings("unchecked")
@Override
public int compare(Object aObj, Object bObj) {
  if (aObj == bObj) {
    return 0;
  }
  DataType ta = getType(aObj);
  DataType tb = getType(bObj);
  if (ta != this || tb != this) {
    if (ta == tb) {
      return ta.compare(aObj, bObj);
    }
    return super.compare(aObj, bObj);
  }
  // TODO ensure comparable type (both may be comparable but not
  // with each other)
  if (aObj instanceof Comparable) {
    if (aObj.getClass().isAssignableFrom(bObj.getClass())) {
      return ((Comparable<Object>) aObj).compareTo(bObj);
    }
  }
  if (bObj instanceof Comparable) {
    if (bObj.getClass().isAssignableFrom(aObj.getClass())) {
      return -((Comparable<Object>) bObj).compareTo(aObj);
    }
  }
  byte[] a = serialize(aObj);
  byte[] b = serialize(bObj);
  return compareNotNull(a, b);
}
org.h2.mvstore.typeDataTypecompare

Javadoc

Compare two keys.

Popular methods of DataType

  • getMemory
    Estimate the used memory in bytes.
  • read
    Read a list of objects.
  • write
    Write a list of objects.

Popular in Java

  • Updating database using SQL prepared statement
  • getResourceAsStream (ClassLoader)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • scheduleAtFixedRate (Timer)
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • JFrame (javax.swing)
  • Best plugins for Eclipse
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