Java 类java.lang.UnsupportedOperationException 实例源码

项目:teabag-ml    文件:DataCollector.java   
public static void startEvent(String type, long startTime) throws UnsupportedOperationException {
String key = type + String.valueOf(startTime);
if (eventMap.containsKey(key)) {
    // event exists, try to start a new one
    if ((eventMap.get(key))[2] != 0) {
    // there is an unfinished event
    throw new UnsupportedOperationException();
    } else {
    (eventMap.get(key))[2] = System.currentTimeMillis();
    }
} else {
    // new event, try to create
    Long[] newTuple = new Long[3];
    newTuple[0] = (long)0;
    newTuple[1] = (long)0;
    newTuple[2] = System.currentTimeMillis();
    eventMap.put(key, newTuple);
}
System.out.println("START: " + key + "," + String.valueOf((eventMap.get(key))[0]) + "," + String.valueOf((eventMap.get(key))[1]));
   }
项目:teabag-ml    文件:DataCollector.java   
public static void endEvent(String type, long startTime) throws UnsupportedOperationException {
String key = type + String.valueOf(startTime);
if (eventMap.containsKey(key)) {
    // end the event
    if ((eventMap.get(key))[2] != 0) {
    // try to finish the event
    (eventMap.get(key))[0] += 1; // counts increased by 1
    (eventMap.get(key))[1] += (System.currentTimeMillis() - (eventMap.get(key))[2]); // total time increased by the duration
    (eventMap.get(key))[2] = (long)0; // reset the time buffer
    } else {
    // the event has not been started
    throw new UnsupportedOperationException();
    }
} else {
    // the event does not exist
    throw new UnsupportedOperationException();
}
System.out.println("END:" + key + "," + String.valueOf((eventMap.get(key))[0]) + "," + String.valueOf((eventMap.get(key))[1]));
if (type.equals("score"))
    scoringCalls++;
   }
项目:QDrill    文件:ObjectInspectorHelper.java   
public static ObjectInspector getDrillObjectInspector(DataMode mode, MinorType minorType) {
  try {
    if (mode == DataMode.REQUIRED) {
      if (OIMAP_REQUIRED.containsKey(minorType)) {
        return (ObjectInspector) OIMAP_REQUIRED.get(minorType).newInstance();
      }
    } else if (mode == DataMode.OPTIONAL) {
      if (OIMAP_OPTIONAL.containsKey(minorType)) {
        return (ObjectInspector) OIMAP_OPTIONAL.get(minorType).newInstance();
      }
    } else {
      throw new UnsupportedOperationException("Repeated types are not supported as arguement to Hive UDFs");
    }
  } catch(InstantiationException | IllegalAccessException e) {
    throw new RuntimeException("Failed to instantiate ObjectInspector", e);
  }

  throw new UnsupportedOperationException(
      String.format("Type %s[%s] not supported as arguement to Hive UDFs", minorType.toString(), mode.toString()));
}
项目:QDrill    文件:ObjectInspectorHelper.java   
public static MinorType getDrillType(ObjectInspector oi) {
  switch(oi.getCategory()) {
    case PRIMITIVE: {
      PrimitiveObjectInspector poi = (PrimitiveObjectInspector)oi;
      if (TYPE_HIVE2DRILL.containsKey(poi.getPrimitiveCategory())) {
        return TYPE_HIVE2DRILL.get(poi.getPrimitiveCategory());
      }
      throw new UnsupportedOperationException();
    }

    case MAP:
    case LIST:
    case STRUCT:
    default:
      throw new UnsupportedOperationException();
  }
}
项目:dremio-oss    文件:ObjectInspectorHelper.java   
public static MinorType getMinorType(ObjectInspector oi) {
  switch(oi.getCategory()) {
    case PRIMITIVE: {
      PrimitiveObjectInspector poi = (PrimitiveObjectInspector)oi;
      if (TYPE_HIVE2MINOR.containsKey(poi.getPrimitiveCategory())) {
        return TYPE_HIVE2MINOR.get(poi.getPrimitiveCategory());
      }
      throw new UnsupportedOperationException();
    }

    case MAP:
    case LIST:
    case STRUCT:
    default:
      throw new UnsupportedOperationException();
  }
}
项目:drill    文件:ObjectInspectorHelper.java   
public static MinorType getDrillType(ObjectInspector oi) {
  switch(oi.getCategory()) {
    case PRIMITIVE: {
      PrimitiveObjectInspector poi = (PrimitiveObjectInspector)oi;
      if (TYPE_HIVE2DRILL.containsKey(poi.getPrimitiveCategory())) {
        return TYPE_HIVE2DRILL.get(poi.getPrimitiveCategory());
      }
      throw new UnsupportedOperationException();
    }

    case MAP:
    case LIST:
    case STRUCT:
    default:
      throw new UnsupportedOperationException();
  }
}
项目:algorithmia-java    文件:AlgoSuccess.java   
@Override
@SuppressWarnings("unchecked")
protected <T> T as(Class<T> returnClass) {
    if (result == null && resultJson != null) {
        result = gson.toJsonTree(resultJson);
    }
    if(metadata.getContentType() == ContentType.Void) {
        return null;
    } else if(metadata.getContentType() == ContentType.Text) {
        return gson.fromJson(new JsonPrimitive(result.getAsString()), returnClass);
    } else if(metadata.getContentType() == ContentType.Json) {
        return gson.fromJson(result, returnClass);
    } else if(metadata.getContentType() == ContentType.Binary) {
        if(byte[].class == returnClass) {
          return (T)Base64.decodeBase64(result.getAsString());
        } else {
          throw new UnsupportedOperationException("Only support returning as byte[] for Binary data");
        }

    } else {
        throw new UnsupportedOperationException("Unknown ContentType in response: " + metadata.getContentType().toString());
    }

}
项目:algorithmia-java    文件:AlgoSuccess.java   
@Override
@SuppressWarnings("unchecked")
protected <T> T as(Type returnType) {
    if (result == null && resultJson != null) {
        result = gson.toJsonTree(resultJson);
    }

    if(metadata.getContentType() == ContentType.Void) {
        return null;
    } else if(metadata.getContentType() == ContentType.Text) {
        return gson.fromJson(new JsonPrimitive(result.getAsString()), returnType);
    } else if(metadata.getContentType() == ContentType.Json) {
        return gson.fromJson(result, returnType);
    } else if(metadata.getContentType() == ContentType.Binary) {
        if(byteType.equals(returnType)) {
          return (T)Base64.decodeBase64(result.getAsString());
        } else {
          throw new UnsupportedOperationException("Only support returning as byte[] for Binary data");
        }
    } else {
        throw new UnsupportedOperationException("Unknown ContentType in response: " + metadata.getContentType().toString());
    }
}
项目:algorithmia-android    文件:AlgoSuccess.java   
@Override
@SuppressWarnings("unchecked")
protected <T> T as(Class<T> returnClass) {
    if(metadata.getContentType() == ContentType.Void) {
        return null;
    } else if(metadata.getContentType() == ContentType.Text) {
        return gson.fromJson(new JsonPrimitive(result.getAsString()), returnClass);
    } else if(metadata.getContentType() == ContentType.Json) {
        return gson.fromJson(result, returnClass);
    } else if(metadata.getContentType() == ContentType.Binary) {
        if(byte[].class == returnClass) {
          return (T)Base64.decodeBase64(result.getAsString());
        } else {
          throw new UnsupportedOperationException("Only support returning as byte[] for Binary data");
        }

    } else {
        throw new UnsupportedOperationException("Unknown ContentType in response: " + metadata.getContentType().toString());
    }

}
项目:algorithmia-android    文件:AlgoSuccess.java   
@Override
@SuppressWarnings("unchecked")
protected <T> T as(Type returnType) {
    if(metadata.getContentType() == ContentType.Void) {
        return null;
    } else if(metadata.getContentType() == ContentType.Text) {
        return gson.fromJson(new JsonPrimitive(result.getAsString()), returnType);
    } else if(metadata.getContentType() == ContentType.Json) {
        return gson.fromJson(result, returnType);
    } else if(metadata.getContentType() == ContentType.Binary) {
        if(byteType.equals(returnType)) {
          return (T)Base64.decodeBase64(result.getAsString());
        } else {
          throw new UnsupportedOperationException("Only support returning as byte[] for Binary data");
        }
    } else {
        throw new UnsupportedOperationException("Unknown ContentType in response: " + metadata.getContentType().toString());
    }
}
项目:pluotsorbet    文件:constructor.java   
/**
 * Runs the test using the specified harness.
 *
 * @param harness  the test harness (<code>null</code> not permitted).
 */
public void test(TestHarness harness)
{
    UnsupportedOperationException object1 = new UnsupportedOperationException();
    harness.check(object1 != null);
    harness.check(object1.toString(), "java.lang.UnsupportedOperationException");

    UnsupportedOperationException object2 = new UnsupportedOperationException("nothing happens");
    harness.check(object2 != null);
    harness.check(object2.toString(), "java.lang.UnsupportedOperationException: nothing happens");

    UnsupportedOperationException object3 = new UnsupportedOperationException((String)null);
    harness.check(object3 != null);
    harness.check(object3.toString(), "java.lang.UnsupportedOperationException");

}
项目:mclab    文件:AbstractLocalRewrite.java   
public void caseASTNode( ASTNode node )
{
    int numChild = node.getNumChild();
    for( int i = 0; i<numChild; i++ ){
        rewrite( node.getChild(i) );
        if( newNode != null )
            if( newNode.isSingleNode() )
                node.setChild( newNode.getSingleNode(), i );
            else{
                String msg = "Generic transformation case received non single nodes from " +
                    "transforming a child node. This should only happen when the current " +
                    "case is for a list or otherwise expects this behavior.\n"
                    +"node:\n"+node.getPrettyPrinted()
                    +"\nchild node transform:\n"+newNode.toString();
                throw new UnsupportedOperationException(msg);
            }
    }
    newNode = null;
}
项目:oscm    文件:IdentityServiceStub.java   
@Override
public void revokeUserRoles(VOUser user, List<UserRoleType> roles)
        throws ObjectNotFoundException,
        UserModificationConstraintException, UserActiveException,
        OperationNotPermittedException, UserRoleAssignmentException {
    throw new UnsupportedOperationException();
}
项目:oscm    文件:IdentityServiceStub.java   
@Override
public VOUserDetails createUser(VOUserDetails user,
        List<UserRoleType> roles, String marketplaceId)
        throws NonUniqueBusinessKeyException, MailOperationException,
        ValidationException, UserRoleAssignmentException,
        OperationPendingException {
    throw new UnsupportedOperationException();
}
项目:oscm    文件:IdentityServiceStub.java   
@Override
public VOUserDetails createUser(VOUserDetails user, String marketplaceId)
        throws NonUniqueBusinessKeyException, MailOperationException,
        ValidationException, UserRoleAssignmentException,
        OperationPendingException {
    throw new UnsupportedOperationException();
}
项目:oscm    文件:IdentityServiceStub.java   
@Override
public PlatformUser modifyUserData(PlatformUser existingUser,
        VOUserDetails tempUser, boolean modifyOwnUser, boolean sendMail)
        throws OperationNotPermittedException,
        NonUniqueBusinessKeyException, TechnicalServiceNotAliveException,
        TechnicalServiceOperationException {
    throw new UnsupportedOperationException();
}
项目:oscm    文件:IdentityServiceStub.java   
@Override
public void setUserRoles(VOUser user, List<UserRoleType> roles)
        throws ObjectNotFoundException, OperationNotPermittedException,
        UserModificationConstraintException, UserRoleAssignmentException,
        UserActiveException {
    throw new UnsupportedOperationException();
}
项目:oscm    文件:IdentityServiceStub.java   
@Override
public VOUserDetails createUserWithGroups(VOUserDetails user,
        List<UserRoleType> roles, String marketplaceId,
        Map<Long, UnitUserRole> groups)
        throws NonUniqueBusinessKeyException, MailOperationException,
        ValidationException, UserRoleAssignmentException,
        OperationPendingException {
    throw new UnsupportedOperationException();
}
项目:openjdk-jdk10    文件:JdpController.java   
private static Long getProcessId() {
    try {
        // Get the current process id
        return ProcessHandle.current().pid();
    } catch(UnsupportedOperationException ex) {
        return null;
    }
}
项目:dremio-oss    文件:ObjectInspectorHelper.java   
public static ObjectInspector getObjectInspector(DataMode mode, MinorType minorType, boolean varCharToStringReplacement) {
  try {
    if (mode == DataMode.REQUIRED) {
      if (OIMAP_REQUIRED.containsKey(minorType)) {
        if (varCharToStringReplacement && minorType == MinorType.VARCHAR) {
          return (ObjectInspector) ((Class) OIMAP_REQUIRED.get(minorType).toArray()[1]).newInstance();
        } else {
          return (ObjectInspector) ((Class) OIMAP_REQUIRED.get(minorType).toArray()[0]).newInstance();
        }
      }
    } else if (mode == DataMode.OPTIONAL) {
      if (OIMAP_OPTIONAL.containsKey(minorType)) {
        if (varCharToStringReplacement && minorType == MinorType.VARCHAR) {
          return (ObjectInspector) ((Class) OIMAP_OPTIONAL.get(minorType).toArray()[1]).newInstance();
        } else {
          return (ObjectInspector) ((Class) OIMAP_OPTIONAL.get(minorType).toArray()[0]).newInstance();
        }
      }
    } else {
      throw new UnsupportedOperationException("Repeated types are not supported as arguement to Hive UDFs");
    }
  } catch(InstantiationException | IllegalAccessException e) {
    throw new RuntimeException("Failed to instantiate ObjectInspector", e);
  }

  throw new UnsupportedOperationException(
      String.format("Type %s[%s] not supported as arguement to Hive UDFs", minorType.toString(), mode.toString()));
}
项目:wava    文件:TestTypeSpec.java   
@Test
public void initializerBlockUnsupportedExceptionOnInterface()
{
    TypeSpec.Builder interfaceBuilder = TypeSpec.interfaceBuilder("Taco");

    try {
        interfaceBuilder.addInitializerBlock(CodeBlock.builder().build());
        fail("Exception expected");
    }
    catch (UnsupportedOperationException e) {
    }
}
项目:wava    文件:TestTypeSpec.java   
@Test
public void initializerBlockUnsupportedExceptionOnAnnotation()
{

    TypeSpec.Builder annotationBuilder = TypeSpec.annotationBuilder("Taco");

    try {
        annotationBuilder.addInitializerBlock(CodeBlock.builder().build());
        fail("Exception expected");
    }
    catch (UnsupportedOperationException e) {
    }
}
项目:LegendsBrowser    文件:Application.java   
private static void initWebServer(int port) throws IOException, URISyntaxException {
    WebServer server = new WebServer(port);
    if (!serverMode)
   {
     try
     {
       Desktop.getDesktop().browse(new URI("http://localhost:" + server.getPort()));
     }
     catch (UnsupportedOperationException e)
     {
       LOG.warn("Failed to open web browser for you. You can access LegendBrowser on http://localhost:" + server.getPort());
     }
   }
}
项目:guacamole-client    文件:SQLServerAuthenticationProviderModule.java   
@Override
public void configure(Binder binder) {

    // Bind SQLServer-specific properties with the configured driver.
    switch(sqlServerDriver) {
        case JTDS:
            JdbcHelper.SQL_Server_jTDS.configure(binder);
            break;

        case DATA_DIRECT:
            JdbcHelper.SQL_Server_DataDirect.configure(binder);
            break;

        case MICROSOFT_LEGACY:
            JdbcHelper.SQL_Server_MS_Driver.configure(binder);
            break;

        case MICROSOFT_2005:
            JdbcHelper.SQL_Server_2005_MS_Driver.configure(binder);
            break;

        default:
            throw new UnsupportedOperationException(
                "A driver has been specified that is not supported by this module."
            );
    }

    // Bind MyBatis properties
    Names.bindProperties(binder, myBatisProperties);

    // Bind JDBC driver properties
    binder.bind(Properties.class)
        .annotatedWith(Names.named("JDBC.driverProperties"))
        .toInstance(driverProperties);

}
项目:drill    文件:ObjectInspectorHelper.java   
public static ObjectInspector getDrillObjectInspector(DataMode mode, MinorType minorType, boolean varCharToStringReplacement) {
  try {
    if (mode == DataMode.REQUIRED) {
      if (OIMAP_REQUIRED.containsKey(minorType)) {
        if (varCharToStringReplacement && minorType == MinorType.VARCHAR) {
          return (ObjectInspector) ((Class) OIMAP_REQUIRED.get(minorType).toArray()[1]).newInstance();
        } else {
          return (ObjectInspector) ((Class) OIMAP_REQUIRED.get(minorType).toArray()[0]).newInstance();
        }
      }
    } else if (mode == DataMode.OPTIONAL) {
      if (OIMAP_OPTIONAL.containsKey(minorType)) {
        if (varCharToStringReplacement && minorType == MinorType.VARCHAR) {
          return (ObjectInspector) ((Class) OIMAP_OPTIONAL.get(minorType).toArray()[1]).newInstance();
        } else {
          return (ObjectInspector) ((Class) OIMAP_OPTIONAL.get(minorType).toArray()[0]).newInstance();
        }
      }
    } else {
      throw new UnsupportedOperationException("Repeated types are not supported as arguement to Hive UDFs");
    }
  } catch(InstantiationException | IllegalAccessException e) {
    throw new RuntimeException("Failed to instantiate ObjectInspector", e);
  }

  throw new UnsupportedOperationException(
      String.format("Type %s[%s] not supported as arguement to Hive UDFs", minorType.toString(), mode.toString()));
}
项目:RoMote    文件:ShakeMonitor.java   
public ShakeMonitor(Context context) {
    mContext = context;
    mSensorManager = (SensorManager)mContext.getSystemService(Context.SENSOR_SERVICE);

    if (mSensorManager == null) {
        throw new UnsupportedOperationException("Sensors not supported");
    }

    mAccelerometer = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);

}
项目:development    文件:IdentityServiceStub.java   
@Override
public void revokeUserRoles(VOUser user, List<UserRoleType> roles)
        throws ObjectNotFoundException,
        UserModificationConstraintException, UserActiveException,
        OperationNotPermittedException, UserRoleAssignmentException {
    throw new UnsupportedOperationException();
}
项目:development    文件:IdentityServiceStub.java   
@Override
public VOUserDetails createUser(VOUserDetails user,
        List<UserRoleType> roles, String marketplaceId)
        throws NonUniqueBusinessKeyException, MailOperationException,
        ValidationException, UserRoleAssignmentException,
        OperationPendingException {
    throw new UnsupportedOperationException();
}
项目:development    文件:IdentityServiceStub.java   
@Override
public VOUserDetails createUser(VOUserDetails user, String marketplaceId)
        throws NonUniqueBusinessKeyException, MailOperationException,
        ValidationException, UserRoleAssignmentException,
        OperationPendingException {
    throw new UnsupportedOperationException();
}
项目:development    文件:IdentityServiceStub.java   
@Override
public PlatformUser modifyUserData(PlatformUser existingUser,
        VOUserDetails tempUser, boolean modifyOwnUser, boolean sendMail)
        throws OperationNotPermittedException,
        NonUniqueBusinessKeyException, TechnicalServiceNotAliveException,
        TechnicalServiceOperationException {
    throw new UnsupportedOperationException();
}
项目:development    文件:IdentityServiceStub.java   
@Override
public void setUserRoles(VOUser user, List<UserRoleType> roles)
        throws ObjectNotFoundException, OperationNotPermittedException,
        UserModificationConstraintException, UserRoleAssignmentException,
        UserActiveException {
    throw new UnsupportedOperationException();
}
项目:development    文件:IdentityServiceStub.java   
@Override
public VOUserDetails createUserWithGroups(VOUserDetails user,
        List<UserRoleType> roles, String marketplaceId,
        Map<Long, UnitUserRole> groups)
        throws NonUniqueBusinessKeyException, MailOperationException,
        ValidationException, UserRoleAssignmentException,
        OperationPendingException {
    throw new UnsupportedOperationException();
}
项目:petablox    文件:Node.java   
/**
 * Set the null parent of this to newparent.
 * @throws UnsupportedOperationException if current parent is not null
 */
public void addParent(Node<T> newparent) throws UnsupportedOperationException {
    if (parent == null) {
        parent = newparent;
    } else {
        throw new UnsupportedOperationException("Tree: Adding new "
                + "parent to Node with non-null parent.");
    }
}
项目:l10n-maven-plugin    文件:Hunspell.java   
/**
 * The instance of the HunspellManager, looks for the native lib in
 * the directory specified.
 *
 * @param libDir Optional absolute directory where the native lib can be found. 
 */
public static Hunspell getInstance(String libDir) throws UnsatisfiedLinkError, UnsupportedOperationException { 
    if (hunspell != null) {
        return hunspell;
    }

    hunspell = new Hunspell(libDir);
    return hunspell;
}
项目:l10n-maven-plugin    文件:Hunspell.java   
/**
   * Calculate the filename of the native hunspell lib.
   * The files have completely different names to allow them to live
   * in the same directory and avoid confusion.
   */
  public static String libName() throws UnsupportedOperationException {
String os = System.getProperty("os.name").toLowerCase();
if (os.startsWith("windows")) {
    return libNameBare()+".dll";

} else if (os.startsWith("mac os x")) {
    //      return libNameBare()+".dylib";
    return libNameBare()+".jnilib";

} else {
    return "lib"+libNameBare()+".so";
}  
  }
项目:pluotsorbet    文件:TryCatch.java   
/**
 * Runs the test using the specified harness.
 *
 * @param harness  the test harness (<code>null</code> not permitted).
 */
public void test(TestHarness harness)
{
    // flag that is set when exception is caught
    boolean caught = false;
    try {
        throw new UnsupportedOperationException("UnsupportedOperationException");
    }
    catch (UnsupportedOperationException e) {
        // correct exception was caught
        caught = true;
    }
    harness.check(caught);
}
项目:SocialGamingClient    文件:ShakeListener.java   
public void resume() {
  this.sensorManager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE);

  if (this.sensorManager == null) {
    throw new UnsupportedOperationException("Sensors not supported");
  }

  accelerationSensor = this.sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);    
  sensorManager.registerListener(this, accelerationSensor, SensorManager.SENSOR_DELAY_NORMAL);

}
项目:arcus-java-client    文件:SingleElementInfiniteIteratorTest.java   
public void testRemove() {
    try {
        iterator.remove();
        fail("Expected UnsupportedOperationException on a remove.");
    }
    catch (UnsupportedOperationException e) {
    }
}
项目:renjin-statet    文件:Native.java   
public static SEXP sexpFromPointer(Object ptr) {
  // Currently, our GCC bridge doesn't support storing values
  // to fields, so we can be confident that no other references
  // to these pointers exist
  if(ptr instanceof DoublePtr) {
    return DoubleArrayVector.unsafe(((DoublePtr) ptr).array);
  } else if(ptr instanceof IntPtr) {
    return new IntArrayVector(((IntPtr) ptr).array);
  } else {
    throw new UnsupportedOperationException(ptr.toString());
  }
}
项目:javapoet    文件:TypeSpecTest.java   
@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");
}