Java Code Examples for java.lang.Comparable

The following are top voted examples for showing how to use java.lang.Comparable. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: wava   File: TestTypeSpec.java   View source code 6 votes vote down vote up
@Test
public void typeVariableWithBounds()
{
    AnnotationSpec a = AnnotationSpec.builder(ClassName.get("com.squareup.tacos", "A")).build();
    TypeVariableName p = TypeVariableName.get("P", Number.class);
    TypeVariableName q = (TypeVariableName) TypeVariableName.get("Q", Number.class).annotated(a);
    TypeSpec typeSpec = TypeSpec.classBuilder("Location")
            .addTypeVariable(p.withBounds(Comparable.class))
            .addTypeVariable(q.withBounds(Comparable.class))
            .addField(p, "x")
            .addField(q, "y")
            .build();
    assertThat(toString(typeSpec)).isEqualTo(""
            + "package com.squareup.tacos;\n"
            + "\n"
            + "import java.lang.Comparable;\n"
            + "import java.lang.Number;\n"
            + "\n"
            + "class Location<P extends Number & Comparable, Q extends Number & Comparable> {\n"
            + "  P x;\n"
            + "\n"
            + "  @A Q y;\n"
            + "}\n");
}
 
Example 2
Project: wava   File: TestTypeSpec.java   View source code 6 votes vote down vote up
@Test
public void classImplementsExtends()
        throws Exception
{
    ClassName taco = ClassName.get(tacosPackage, "Taco");
    ClassName food = ClassName.get("com.squareup.tacos", "Food");
    TypeSpec typeSpec = TypeSpec.classBuilder("Taco")
            .addModifiers(Modifier.ABSTRACT)
            .superclass(ParameterizedTypeName.get(ClassName.get(AbstractSet.class), food))
            .addSuperinterface(Serializable.class)
            .addSuperinterface(ParameterizedTypeName.get(ClassName.get(Comparable.class), taco))
            .build();
    assertThat(toString(typeSpec)).isEqualTo(""
            + "package com.squareup.tacos;\n"
            + "\n"
            + "import java.io.Serializable;\n"
            + "import java.lang.Comparable;\n"
            + "import java.util.AbstractSet;\n"
            + "\n"
            + "abstract class Taco extends AbstractSet<Food> "
            + "implements Serializable, Comparable<Taco> {\n"
            + "}\n");
}
 
Example 3
Project: wava   File: TestTypeSpec.java   View source code 6 votes vote down vote up
@Test
public void classImplementsExtendsSameName()
        throws Exception
{
    ClassName javapoetTaco = ClassName.get(tacosPackage, "Taco");
    ClassName tacoBellTaco = ClassName.get("com.taco.bell", "Taco");
    ClassName fishTaco = ClassName.get("org.fish.taco", "Taco");
    TypeSpec typeSpec = TypeSpec.classBuilder("Taco")
            .superclass(fishTaco)
            .addSuperinterface(ParameterizedTypeName.get(ClassName.get(Comparable.class), javapoetTaco))
            .addSuperinterface(tacoBellTaco)
            .build();
    assertThat(toString(typeSpec)).isEqualTo(""
            + "package com.squareup.tacos;\n"
            + "\n"
            + "import java.lang.Comparable;\n"
            + "\n"
            + "class Taco extends org.fish.taco.Taco "
            + "implements Comparable<Taco>, com.taco.bell.Taco {\n"
            + "}\n");
}
 
Example 4
Project: wava   File: TestTypeSpec.java   View source code 6 votes vote down vote up
@Test
public void interfaceExtends()
        throws Exception
{
    ClassName taco = ClassName.get(tacosPackage, "Taco");
    TypeSpec typeSpec = TypeSpec.interfaceBuilder("Taco")
            .addSuperinterface(Serializable.class)
            .addSuperinterface(ParameterizedTypeName.get(ClassName.get(Comparable.class), taco))
            .build();
    assertThat(toString(typeSpec)).isEqualTo(""
            + "package com.squareup.tacos;\n"
            + "\n"
            + "import java.io.Serializable;\n"
            + "import java.lang.Comparable;\n"
            + "\n"
            + "interface Taco extends Serializable, Comparable<Taco> {\n"
            + "}\n");
}
 
Example 5
Project: Cugar   File: QuickSort.java   View source code 6 votes vote down vote up
/**
 * gibt das mittlere Element des (umgeordneten Arrays) zur�ck
 */

private static int partition(ArrayList<Comparable> list, int m, int n)
{
    Comparable x = list.get(m);  // Pivot-Element
    int j = n + 1;
    int i = m - 1;
    
    while (true)
    {
        j--;
        while (list.get(j).compareTo(x) > 0) j--;
        i++;
        while (list.get(i).compareTo(x) < 0) i++;
        if (i < j) exchange(list, i, j);
        else return j;
    }
}
 
Example 6
Project: tools-idea   File: ManyClasses.java   View source code 6 votes vote down vote up
public void foo() {
  Runnable r = new Runnable() {
    @Override
    public void run() {
      Comparable<Integer> c = new Comparable<Integer>() {
        @Override
        public int compareTo(Integer o) {
          return 0;
        }
      };
    }
  };
  
  class FooLocal {
    Runnable r = new Runnable() {
      @Override
      public void run() {
      }
    };
  }
}
 
Example 7
Project: dijkstra-performance   File: FibonacciHeap.java   View source code 6 votes vote down vote up
public static <T extends Comparable<T>> Node<T> mergeLists(
        Node<T> a, Node<T> b) {

    if (a == null && b == null) {
        return null;
    }
    if (a == null) {
        return b;
    }
    if (b == null) {
        return a;
    }

    Node<T> temp = a.next;
    a.next = b.next;
    a.next.prev = a;
    b.next = temp;
    b.next.prev = b;

    return a.compareTo(b) < 0 ? a : b;
}
 
Example 8
Project: growing-with-the-web   File: FibonacciHeap.java   View source code 6 votes vote down vote up
public static <T extends Comparable<T>> Node<T> mergeLists(
        Node<T> a, Node<T> b) {

    if (a == null && b == null) {
        return null;
    }
    if (a == null) {
        return b;
    }
    if (b == null) {
        return a;
    }

    Node<T> temp = a.next;
    a.next = b.next;
    a.next.prev = a;
    b.next = temp;
    b.next.prev = b;

    return a.compareTo(b) < 0 ? a : b;
}
 
Example 9
Project: javapoet   File: JavaFileTest.java   View source code 6 votes vote down vote up
@Test public void superclassReferencesSelf() throws Exception {
  String source = JavaFile.builder("com.squareup.tacos",
      TypeSpec.classBuilder("Taco")
          .superclass(ParameterizedTypeName.get(
              ClassName.get(Comparable.class), ClassName.get("com.squareup.tacos", "Taco")))
          .build())
      .build()
      .toString();
  assertThat(source).isEqualTo(""
      + "package com.squareup.tacos;\n"
      + "\n"
      + "import java.lang.Comparable;\n"
      + "\n"
      + "class Taco extends Comparable<Taco> {\n"
      + "}\n");
}
 
Example 10
Project: javapoet   File: TypeSpecTest.java   View source code 6 votes vote down vote up
@Test public void typeVariableWithBounds() {
  AnnotationSpec a = AnnotationSpec.builder(ClassName.get("com.squareup.tacos", "A")).build();
  TypeVariableName p = TypeVariableName.get("P", Number.class);
  TypeVariableName q = (TypeVariableName) TypeVariableName.get("Q", Number.class).annotated(a);
  TypeSpec typeSpec = TypeSpec.classBuilder("Location")
      .addTypeVariable(p.withBounds(Comparable.class))
      .addTypeVariable(q.withBounds(Comparable.class))
      .addField(p, "x")
      .addField(q, "y")
      .build();
  assertThat(toString(typeSpec)).isEqualTo(""
      + "package com.squareup.tacos;\n"
      + "\n"
      + "import java.lang.Comparable;\n"
      + "import java.lang.Number;\n"
      + "\n"
      + "class Location<P extends Number & Comparable, @A Q extends Number & Comparable> {\n"
      + "  P x;\n"
      + "\n"
      + "  @A Q y;\n"
      + "}\n");
}
 
Example 11
Project: javapoet   File: TypeSpecTest.java   View source code 6 votes vote down vote up
@Test public void classImplementsExtends() throws Exception {
  ClassName taco = ClassName.get(tacosPackage, "Taco");
  ClassName food = ClassName.get("com.squareup.tacos", "Food");
  TypeSpec typeSpec = TypeSpec.classBuilder("Taco")
      .addModifiers(Modifier.ABSTRACT)
      .superclass(ParameterizedTypeName.get(ClassName.get(AbstractSet.class), food))
      .addSuperinterface(Serializable.class)
      .addSuperinterface(ParameterizedTypeName.get(ClassName.get(Comparable.class), taco))
      .build();
  assertThat(toString(typeSpec)).isEqualTo(""
      + "package com.squareup.tacos;\n"
      + "\n"
      + "import java.io.Serializable;\n"
      + "import java.lang.Comparable;\n"
      + "import java.util.AbstractSet;\n"
      + "\n"
      + "abstract class Taco extends AbstractSet<Food> "
      + "implements Serializable, Comparable<Taco> {\n"
      + "}\n");
}
 
Example 12
Project: consulo-java   File: ManyClasses.java   View source code 6 votes vote down vote up
public void foo() {
  Runnable r = new Runnable() {
    @Override
    public void run() {
      Comparable<Integer> c = new Comparable<Integer>() {
        @Override
        public int compareTo(Integer o) {
          return 0;
        }
      };
    }
  };
  
  class FooLocal {
    Runnable r = new Runnable() {
      @Override
      public void run() {
      }
    };
  }
}
 
Example 13
Project: javapoet   File: TypeSpecTest.java   View source code 5 votes vote down vote up
@Test public void typeVariables() throws Exception {
  TypeVariableName t = TypeVariableName.get("T");
  TypeVariableName p = TypeVariableName.get("P", Number.class);
  ClassName location = ClassName.get(tacosPackage, "Location");
  TypeSpec typeSpec = TypeSpec.classBuilder("Location")
      .addTypeVariable(t)
      .addTypeVariable(p)
      .addSuperinterface(ParameterizedTypeName.get(ClassName.get(Comparable.class), p))
      .addField(t, "label")
      .addField(p, "x")
      .addField(p, "y")
      .addMethod(MethodSpec.methodBuilder("compareTo")
          .addAnnotation(Override.class)
          .addModifiers(Modifier.PUBLIC)
          .returns(int.class)
          .addParameter(p, "p")
          .addCode("return 0;\n")
          .build())
      .addMethod(MethodSpec.methodBuilder("of")
          .addModifiers(Modifier.PUBLIC, Modifier.STATIC)
          .addTypeVariable(t)
          .addTypeVariable(p)
          .returns(ParameterizedTypeName.get(location, t, p))
          .addParameter(t, "label")
          .addParameter(p, "x")
          .addParameter(p, "y")
          .addCode("throw new $T($S);\n", UnsupportedOperationException.class, "TODO")
          .build())
      .build();
  assertThat(toString(typeSpec)).isEqualTo(""
      + "package com.squareup.tacos;\n"
      + "\n"
      + "import java.lang.Comparable;\n"
      + "import java.lang.Number;\n"
      + "import java.lang.Override;\n"
      + "import java.lang.UnsupportedOperationException;\n"
      + "\n"
      + "class Location<T, P extends Number> implements Comparable<P> {\n"
      + "  T label;\n"
      + "\n"
      + "  P x;\n"
      + "\n"
      + "  P y;\n"
      + "\n"
      + "  @Override\n"
      + "  public int compareTo(P p) {\n"
      + "    return 0;\n"
      + "  }\n"
      + "\n"
      + "  public static <T, P extends Number> Location<T, P> of(T label, P x, P y) {\n"
      + "    throw new UnsupportedOperationException(\"TODO\");\n"
      + "  }\n"
      + "}\n");
}
 
Example 14
Project: javapoet   File: TypeSpecTest.java   View source code 5 votes vote down vote up
@Test public void interfaceExtends() throws Exception {
  ClassName taco = ClassName.get(tacosPackage, "Taco");
  TypeSpec typeSpec = TypeSpec.interfaceBuilder("Taco")
      .addSuperinterface(Serializable.class)
      .addSuperinterface(ParameterizedTypeName.get(ClassName.get(Comparable.class), taco))
      .build();
  assertThat(toString(typeSpec)).isEqualTo(""
      + "package com.squareup.tacos;\n"
      + "\n"
      + "import java.io.Serializable;\n"
      + "import java.lang.Comparable;\n"
      + "\n"
      + "interface Taco extends Serializable, Comparable<Taco> {\n"
      + "}\n");
}
 
Example 15
Project: wava   File: TestTypeSpec.java   View source code 4 votes vote down vote up
@Test
public void typeVariables()
        throws Exception
{
    TypeVariableName t = TypeVariableName.get("T");
    TypeVariableName p = TypeVariableName.get("P", Number.class);
    ClassName location = ClassName.get(tacosPackage, "Location");
    TypeSpec typeSpec = TypeSpec.classBuilder("Location")
            .addTypeVariable(t)
            .addTypeVariable(p)
            .addSuperinterface(ParameterizedTypeName.get(ClassName.get(Comparable.class), p))
            .addField(t, "label")
            .addField(p, "x")
            .addField(p, "y")
            .addMethod(MethodSpec.methodBuilder("compareTo")
                    .addAnnotation(Override.class)
                    .addModifiers(Modifier.PUBLIC)
                    .returns(int.class)
                    .addParameter(p, "p")
                    .addCode("return 0;\n")
                    .build())
            .addMethod(MethodSpec.methodBuilder("of")
                    .addModifiers(Modifier.PUBLIC, Modifier.STATIC)
                    .addTypeVariable(t)
                    .addTypeVariable(p)
                    .returns(ParameterizedTypeName.get(location, t, p))
                    .addParameter(t, "label")
                    .addParameter(p, "x")
                    .addParameter(p, "y")
                    .addCode("throw new $T($S);\n", UnsupportedOperationException.class, "TODO")
                    .build())
            .build();
    assertThat(toString(typeSpec)).isEqualTo(""
            + "package com.squareup.tacos;\n"
            + "\n"
            + "import java.lang.Comparable;\n"
            + "import java.lang.Number;\n"
            + "import java.lang.Override;\n"
            + "import java.lang.UnsupportedOperationException;\n"
            + "\n"
            + "class Location<T, P extends Number> implements Comparable<P> {\n"
            + "  T label;\n"
            + "\n"
            + "  P x;\n"
            + "\n"
            + "  P y;\n"
            + "\n"
            + "  @Override\n"
            + "  public int compareTo(P p) {\n"
            + "    return 0;\n"
            + "  }\n"
            + "\n"
            + "  public static <T, P extends Number> Location<T, P> of(T label, P x, P y) {\n"
            + "    throw new UnsupportedOperationException(\"TODO\");\n"
            + "  }\n"
            + "}\n");
}
 
Example 16
Project: intellij-ce-playground   File: OneLineLambdaValueCompatibleOneLine.java   View source code 4 votes vote down vote up
public void foo() {
    Comparable<String> c = (o) -> ba<caret>r();
}
 
Example 17
Project: intellij-ce-playground   File: OneLineLambdaValueCompatibleToBlock.java   View source code 4 votes vote down vote up
public void foo() {
    Comparable<String> c = (o) -> ba<caret>r();
}
 
Example 18
Project: thesis-disassembler   File: ClassWithMethods.java   View source code 4 votes vote down vote up
public <T extends Comparable> T genericMethod(T genericArg) {
	return genericArg;
}
 
Example 19
Project: PDFReporter   File: ComparableComparator.java   View source code 4 votes vote down vote up
public int compare(Object o1, Object o2) {
    if( (o1 == null) || (o2 == null) ) {
        throw new ClassCastException(
            "There were nulls in the arguments for this method: "+
            "compare("+o1 + ", " + o2 + ")"
            );
    }
    
    if(o1 instanceof Comparable) {
        if(o2 instanceof Comparable) {
            int result1 = ((Comparable)o1).compareTo(o2);
            int result2 = ((Comparable)o2).compareTo(o1);

            // enforce comparable contract
            if(result1 == 0 && result2 == 0) {
                return 0;
            } else
            if(result1 < 0 && result2 > 0) {
                return result1;
            } else
            if(result1 > 0 && result2 < 0) {
                return result1;
            } else {
                // results inconsistent
                throw new ClassCastException("o1 not comparable to o2");
            }
        } else {
            // o2 wasn't comparable
            throw new ClassCastException(
                "The first argument of this method was not a Comparable: " +
                o2.getClass().getName()
                );
        }
    } else 
    if(o2 instanceof Comparable) {
        // o1 wasn't comparable
        throw new ClassCastException(
            "The second argument of this method was not a Comparable: " +
            o1.getClass().getName()
            );
    } else {
        // neither were comparable
        throw new ClassCastException(
            "Both arguments of this method were not Comparables: " +
            o1.getClass().getName() + " and " + o2.getClass().getName()
            );
    }
}
 
Example 20
Project: tools-idea   File: OneLineLambdaValueCompatibleOneLine.java   View source code 4 votes vote down vote up
public void foo() {
    Comparable<String> c = (o) -> ba<caret>r();
}
 
Example 21
Project: tools-idea   File: OneLineLambdaValueCompatibleToBlock.java   View source code 4 votes vote down vote up
public void foo() {
    Comparable<String> c = (o) -> ba<caret>r();
}
 
Example 22
Project: consulo-java   File: OneLineLambdaValueCompatibleOneLine.java   View source code 4 votes vote down vote up
public void foo() {
    Comparable<String> c = (o) -> ba<caret>r();
}
 
Example 23
Project: consulo-java   File: OneLineLambdaValueCompatibleToBlock.java   View source code 4 votes vote down vote up
public void foo() {
    Comparable<String> c = (o) -> ba<caret>r();
}
 
Example 24
Project: waqtsalat-eclipse-plugin   File: LocationsProviderPackageImpl.java   View source code 4 votes vote down vote up
/**
 * Complete the initialization of the package and its meta-model. This method is guarded to have no affect on any
 * invocation but its first. <!-- begin-user-doc --> <!-- end-user-doc -->
 * 
 * @generated
 */
public void initializePackageContents() {
    if (isInitialized) return;
    isInitialized = true;

    // Initialize package
    setName(eNAME);
    setNsPrefix(eNS_PREFIX);
    setNsURI(eNS_URI);

    // Create type parameters
    addETypeParameter(comparableEClass, "E");

    // Set bounds for type parameters

    // Add supertypes to classes
    EGenericType g1 = createEGenericType(this.getComparable());
    EGenericType g2 = createEGenericType(this.getCountry());
    g1.getETypeArguments().add(g2);
    countryEClass.getEGenericSuperTypes().add(g1);
    g1 = createEGenericType(this.getComparable());
    g2 = createEGenericType(this.getCity());
    g1.getETypeArguments().add(g2);
    cityEClass.getEGenericSuperTypes().add(g1);
    g1 = createEGenericType(this.getComparable());
    g2 = createEGenericType(this.getCoordinates());
    g1.getETypeArguments().add(g2);
    coordinatesEClass.getEGenericSuperTypes().add(g1);

    // Initialize classes, features, and operations; add parameters
    initEClass(countryEClass, Country.class, "Country", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEAttribute(getCountry_Name(), ecorePackage.getEString(), "name", null, 0, 1, Country.class, !IS_TRANSIENT,
            !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getCountry_Cities(), this.getCity(), this.getCity_Country(), "cities", null, 0, -1,
            Country.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES,
            !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getCountry_Code(), ecorePackage.getEString(), "code", null, 0, 1, Country.class, !IS_TRANSIENT,
            !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

    initEClass(cityEClass, City.class, "City", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEAttribute(getCity_Name(), ecorePackage.getEString(), "name", null, 0, 1, City.class, !IS_TRANSIENT,
            !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getCity_Country(), this.getCountry(), this.getCountry_Cities(), "country", null, 0, 1,
            City.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES,
            !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getCity_Coordinates(), this.getCoordinates(), null, "coordinates", null, 0, 1, City.class,
            !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE,
            IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getCity_Region(), ecorePackage.getEString(), "region", null, 0, 1, City.class, !IS_TRANSIENT,
            !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getCity_PostalCode(), ecorePackage.getEString(), "postalCode", null, 0, 1, City.class,
            !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

    initEClass(coordinatesEClass, Coordinates.class, "Coordinates", !IS_ABSTRACT, !IS_INTERFACE,
            IS_GENERATED_INSTANCE_CLASS);
    initEAttribute(getCoordinates_Latitude(), ecorePackage.getEDouble(), "latitude", null, 0, 1, Coordinates.class,
            !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getCoordinates_Longitude(), ecorePackage.getEDouble(), "longitude", null, 0, 1,
            Coordinates.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
            !IS_DERIVED, IS_ORDERED);

    initEClass(comparableEClass, Comparable.class, "Comparable", IS_ABSTRACT, IS_INTERFACE,
            !IS_GENERATED_INSTANCE_CLASS);

    // Create resource
    createResource(eNS_URI);
}
 
Example 25
Project: TotalCrossSDK   File: TreeMap4D.java   View source code 3 votes vote down vote up
/**
 * Compares two elements by the set comparator, or by natural ordering.
 * Package visible for use by nested classes.
 *
 * @param o1 the first object
 * @param o2 the second object
 * @throws ClassCastException if o1 and o2 are not mutually comparable,
 *         or are not Comparable with natural ordering
 * @throws NullPointerException if o1 or o2 is null with natural ordering
 */
final int compare(K o1, K o2)
{
  return (comparator == null
          ? ((Comparable) o1).compareTo(o2)
          : comparator.compare(o1, o2));
}
 
Example 26
Project: OpenJSharp   File: OpenMBeanParameterInfo.java   View source code 2 votes vote down vote up
/**
 * Returns the minimal value for this parameter, if it has one, or
 * <tt>null</tt> otherwise.
 *
 * @return the minimum value.
 */
public Comparable<?> getMinValue() ;
 
Example 27
Project: OpenJSharp   File: OpenMBeanParameterInfo.java   View source code 2 votes vote down vote up
/**
 * Returns the maximal value for this parameter, if it has one, or
 * <tt>null</tt> otherwise.
 *
 * @return the maximum value.
 */
public Comparable<?> getMaxValue() ;
 
Example 28
Project: jdk8u-jdk   File: OpenMBeanParameterInfo.java   View source code 2 votes vote down vote up
/**
 * Returns the minimal value for this parameter, if it has one, or
 * <tt>null</tt> otherwise.
 *
 * @return the minimum value.
 */
public Comparable<?> getMinValue() ;
 
Example 29
Project: jdk8u-jdk   File: OpenMBeanParameterInfo.java   View source code 2 votes vote down vote up
/**
 * Returns the maximal value for this parameter, if it has one, or
 * <tt>null</tt> otherwise.
 *
 * @return the maximum value.
 */
public Comparable<?> getMaxValue() ;
 
Example 30
Project: openjdk-jdk10   File: OpenMBeanParameterInfo.java   View source code 2 votes vote down vote up
/**
 * Returns the minimal value for this parameter, if it has one, or
 * {@code null} otherwise.
 *
 * @return the minimum value.
 */
public Comparable<?> getMinValue() ;
 
Example 31
Project: openjdk-jdk10   File: OpenMBeanParameterInfo.java   View source code 2 votes vote down vote up
/**
 * Returns the maximal value for this parameter, if it has one, or
 * {@code null} otherwise.
 *
 * @return the maximum value.
 */
public Comparable<?> getMaxValue() ;
 
Example 32
Project: openjdk9   File: OpenMBeanParameterInfo.java   View source code 2 votes vote down vote up
/**
 * Returns the minimal value for this parameter, if it has one, or
 * {@code null} otherwise.
 *
 * @return the minimum value.
 */
public Comparable<?> getMinValue() ;
 
Example 33
Project: openjdk9   File: OpenMBeanParameterInfo.java   View source code 2 votes vote down vote up
/**
 * Returns the maximal value for this parameter, if it has one, or
 * {@code null} otherwise.
 *
 * @return the maximum value.
 */
public Comparable<?> getMaxValue() ;
 
Example 34
Project: Java8CN   File: OpenMBeanParameterInfo.java   View source code 2 votes vote down vote up
/**
 * Returns the minimal value for this parameter, if it has one, or
 * <tt>null</tt> otherwise.
 *
 * @return the minimum value.
 */
public Comparable<?> getMinValue() ;
 
Example 35
Project: Java8CN   File: OpenMBeanParameterInfo.java   View source code 2 votes vote down vote up
/**
 * Returns the maximal value for this parameter, if it has one, or
 * <tt>null</tt> otherwise.
 *
 * @return the maximum value.
 */
public Comparable<?> getMaxValue() ;
 
Example 36
Project: jdk8u_jdk   File: OpenMBeanParameterInfo.java   View source code 2 votes vote down vote up
/**
 * Returns the minimal value for this parameter, if it has one, or
 * <tt>null</tt> otherwise.
 *
 * @return the minimum value.
 */
public Comparable<?> getMinValue() ;
 
Example 37
Project: jdk8u_jdk   File: OpenMBeanParameterInfo.java   View source code 2 votes vote down vote up
/**
 * Returns the maximal value for this parameter, if it has one, or
 * <tt>null</tt> otherwise.
 *
 * @return the maximum value.
 */
public Comparable<?> getMaxValue() ;
 
Example 38
Project: lookaside_java-1.8.0-openjdk   File: OpenMBeanParameterInfo.java   View source code 2 votes vote down vote up
/**
 * Returns the minimal value for this parameter, if it has one, or
 * <tt>null</tt> otherwise.
 *
 * @return the minimum value.
 */
public Comparable<?> getMinValue() ;
 
Example 39
Project: lookaside_java-1.8.0-openjdk   File: OpenMBeanParameterInfo.java   View source code 2 votes vote down vote up
/**
 * Returns the maximal value for this parameter, if it has one, or
 * <tt>null</tt> otherwise.
 *
 * @return the maximum value.
 */
public Comparable<?> getMaxValue() ;
 
Example 40
Project: TotalCrossSDK   File: Collections4D.java   View source code 2 votes vote down vote up
/**
 * Compare two objects with or without a Comparator. If c is null, uses the
 * natural ordering. Slightly slower than doing it inline if the JVM isn't
 * clever, but worth it for removing a duplicate of the search code.
 * Note: This code is also used in Arrays (for sort as well as search).
 */
static final <T> int compare(T o1, T o2, Comparator<? super T> c)
{
  return c == null ? ((Comparable) o1).compareTo(o2) : c.compare(o1, o2);
}