Codota Logo
DataType.compare
Code IndexAdd Codota 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)

  • Common ways to obtain DataType
private void myMethod () {
DataType d =
  • Codota IconMVMap mVMap;mVMap.getKeyType()
  • Codota IconMVMap mVMap;mVMap.getValueType()
  • Smart code suggestions by Codota
}
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

  • Creating JSON documents from java classes using gson
  • onRequestPermissionsResult (Fragment)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • startActivity (Activity)
  • FileOutputStream (java.io)
    A file output stream is an output stream for writing data to aFile or to a FileDescriptor. Whether
  • PrintStream (java.io)
    A PrintStream adds functionality to another output stream, namely the ability to print representatio
  • ArrayList (java.util)
    Resizable-array implementation of the List interface. Implements all optional list operations, and p
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Stack (java.util)
    The Stack class represents a last-in-first-out (LIFO) stack of objects. It extends class Vector with
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now