java.lang.UnsupportedOperationException Java Examples

The following examples show how to use java.lang.UnsupportedOperationException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ObjectInspectorHelper.java    From dremio-oss with Apache License 2.0 6 votes vote down vote up
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();
  }
}
 
Example #2
Source File: RadarServerController.java    From tds with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
String[] getStations(StationList stations, Double lon, Double lat, Double north, Double south, Double east,
    Double west) {
  if (lat != null && lon != null) {
    // Pull nearest station
    StationList.Station nearest = stations.getNearest(lon, lat);
    if (nearest == null) {
      throw new UnsupportedOperationException("No stations " + "available to search for nearest.");
    }
    return new String[] {nearest.getStid()};
  } else if (north != null && south != null && east != null && west != null) {
    // Pull all stations within box
    List<StationList.Station> inBox = stations.getStations(east, west, north, south);
    List<String> stIds = new ArrayList<>(inBox.size());
    for (StationList.Station s : inBox) {
      stIds.add(s.getStid());
    }
    return stIds.toArray(new String[stIds.size()]);
  } else {
    throw new UnsupportedOperationException("Either station, " + "a lat/lon point, or a box defined by north, "
        + "south, east, and west parameters must be provided.");
  }
}
 
Example #3
Source File: EmulateDisassemblerContext.java    From ghidra with Apache License 2.0 5 votes vote down vote up
@Override
	public void setFutureRegisterValue(Address address, RegisterValue value) {
		Register reg = value.getRegister();
		if (!reg.isProcessorContext()) {
			throw new UnsupportedOperationException();
//			Msg.warn(this, "Setting register " + reg.getName() + " during emulator disassembly ignored!");
//			return;
		}
		RegisterValue registerValue = futureContextMap.get(address);
		if (registerValue != null) {
			value = registerValue.combineValues(value);
		}
		futureContextMap.put(address, value);
	}
 
Example #4
Source File: ShakeMonitor.java    From RoMote with Apache License 2.0 5 votes vote down vote up
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);

}
 
Example #5
Source File: UndertowServletMessages_$bundle.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public final UnsupportedOperationException cannotCallFromProgramaticListener() {
    final UnsupportedOperationException result = new UnsupportedOperationException(String.format(getLoggingLocale(), cannotCallFromProgramaticListener$str()));
    final StackTraceElement[] st = result.getStackTrace();
    result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
    return result;
}
 
Example #6
Source File: SQLServerAuthenticationProviderModule.java    From guacamole-client with Apache License 2.0 5 votes vote down vote up
@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);

}
 
Example #7
Source File: EmulateDisassemblerContext.java    From ghidra with Apache License 2.0 5 votes vote down vote up
@Override
public void setRegisterValue(RegisterValue value) {
	Register reg = value.getRegister();
	if (!reg.isProcessorContext()) {
		throw new UnsupportedOperationException();
	}
	if (contextRegValue == null) {
		contextRegValue = value.getBaseRegisterValue();
	}
	else {
		contextRegValue = contextRegValue.combineValues(value);
	}
}
 
Example #8
Source File: ObjectInspectorHelper.java    From dremio-oss with Apache License 2.0 5 votes vote down vote up
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()));
}
 
Example #9
Source File: EmulateDisassemblerContext.java    From ghidra with Apache License 2.0 5 votes vote down vote up
@Override
public RegisterValue getRegisterValue(Register register) {
	if (!register.isProcessorContext()) {
		throw new UnsupportedOperationException();
	}
	if (register.equals(contextReg)) {
		return contextRegValue;
	}
	return new RegisterValue(register, contextRegValue.toBytes());
}
 
Example #10
Source File: TestFieldPropGenerateStringOverloadsOptionViewModel_.java    From epoxy with Apache License 2.0 4 votes vote down vote up
@Override
public TestFieldPropGenerateStringOverloadsOptionViewModel_ layout(@LayoutRes int arg0) {
  throw new UnsupportedOperationException("Layout resources are unsupported with programmatic views.");
}
 
Example #11
Source File: TestFieldPropIgnoreRequireHashCodeOptionViewModel_.java    From epoxy with Apache License 2.0 4 votes vote down vote up
@Override
public TestFieldPropIgnoreRequireHashCodeOptionViewModel_ layout(@LayoutRes int arg0) {
  throw new UnsupportedOperationException("Layout resources are unsupported with programmatic views.");
}
 
Example #12
Source File: TestFieldPropIgnoreRequireHashCodeOptionViewModel_.java    From epoxy with Apache License 2.0 4 votes vote down vote up
@Override
@LayoutRes
protected int getDefaultLayout() {
  throw new UnsupportedOperationException("Layout resources are unsupported for views created programmatically.");
}
 
Example #13
Source File: TestFieldPropChildViewModel_.java    From epoxy with Apache License 2.0 4 votes vote down vote up
@Override
@LayoutRes
protected int getDefaultLayout() {
  throw new UnsupportedOperationException("Layout resources are unsupported for views created programmatically.");
}
 
Example #14
Source File: TestFieldPropGenerateStringOverloadsOptionViewModel_.java    From epoxy with Apache License 2.0 4 votes vote down vote up
@Override
@LayoutRes
protected int getDefaultLayout() {
  throw new UnsupportedOperationException("Layout resources are unsupported for views created programmatically.");
}
 
Example #15
Source File: TestFieldPropCallbackPropViewModel_.java    From epoxy with Apache License 2.0 4 votes vote down vote up
@Override
@LayoutRes
protected int getDefaultLayout() {
  throw new UnsupportedOperationException("Layout resources are unsupported for views created programmatically.");
}
 
Example #16
Source File: TestFieldPropModelPropViewModel_.java    From epoxy with Apache License 2.0 4 votes vote down vote up
@Override
public TestFieldPropModelPropViewModel_ layout(@LayoutRes int arg0) {
  throw new UnsupportedOperationException("Layout resources are unsupported with programmatic views.");
}
 
Example #17
Source File: StyleableModelViewModel_.java    From epoxy with Apache License 2.0 4 votes vote down vote up
@Override
@LayoutRes
protected int getDefaultLayout() {
  throw new UnsupportedOperationException("Layout resources are unsupported for views created programmatically.");
}
 
Example #18
Source File: TestFieldPropDoNotHashOptionViewModel_.java    From epoxy with Apache License 2.0 4 votes vote down vote up
@Override
public TestFieldPropDoNotHashOptionViewModel_ layout(@LayoutRes int arg0) {
  throw new UnsupportedOperationException("Layout resources are unsupported with programmatic views.");
}
 
Example #19
Source File: TestFieldPropDoNotHashOptionViewModel_.java    From epoxy with Apache License 2.0 4 votes vote down vote up
@Override
@LayoutRes
protected int getDefaultLayout() {
  throw new UnsupportedOperationException("Layout resources are unsupported for views created programmatically.");
}
 
Example #20
Source File: ModelViewSuperClassModel_.java    From epoxy with Apache License 2.0 4 votes vote down vote up
@Override
@LayoutRes
protected int getDefaultLayout() {
  throw new UnsupportedOperationException("Layout resources are unsupported for views created programmatically.");
}
 
Example #21
Source File: StringOutputRecordWriter.java    From dremio-oss with Apache License 2.0 4 votes vote down vote up
public FieldConverter getNewRepeatedListConverter(int fieldId, String fieldName, FieldReader reader) {
  throw new UnsupportedOperationException();
}
 
Example #22
Source File: StringOutputRecordWriter.java    From dremio-oss with Apache License 2.0 4 votes vote down vote up
public FieldConverter getNewRepeatedMapConverter(int fieldId, String fieldName, FieldReader reader) {
  throw new UnsupportedOperationException();
}
 
Example #23
Source File: StringOutputRecordWriter.java    From dremio-oss with Apache License 2.0 4 votes vote down vote up
@Override
public FieldConverter getNewMapConverter(int fieldId, String fieldName, FieldReader reader) {
  throw new UnsupportedOperationException();
}
 
Example #24
Source File: AbstractRowBasedRecordWriter.java    From dremio-oss with Apache License 2.0 4 votes vote down vote up
Converter(int fieldId, String fieldName, FieldReader reader) {
  throw new UnsupportedOperationException("Doesn't support writing 'Nullable${minor.class}'");
}
 
Example #25
Source File: AbstractRowBasedRecordWriter.java    From dremio-oss with Apache License 2.0 4 votes vote down vote up
@Override
public FieldConverter getNewNullConverter(int fieldId, String fieldName, FieldReader reader) {
  throw new UnsupportedOperationException("Doesn't support writing Null");
}
 
Example #26
Source File: AbstractRowBasedRecordWriter.java    From dremio-oss with Apache License 2.0 4 votes vote down vote up
@Override
public FieldConverter getNewListConverter(int fieldId, String fieldName, FieldReader reader) {
  throw new UnsupportedOperationException("Doesn't support writing RepeatedList");
}
 
Example #27
Source File: AbstractRowBasedRecordWriter.java    From dremio-oss with Apache License 2.0 4 votes vote down vote up
@Override
public FieldConverter getNewUnionConverter(int fieldId, String fieldName, FieldReader reader) {
  throw new UnsupportedOperationException("Doesn't support writing Union type'");
}
 
Example #28
Source File: AbstractRowBasedRecordWriter.java    From dremio-oss with Apache License 2.0 4 votes vote down vote up
@Override
public FieldConverter getNewMapConverter(int fieldId, String fieldName, FieldReader reader) {
  throw new UnsupportedOperationException("Doesn't support writing Map'");
}
 
Example #29
Source File: TokensBrowserTopComponent.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public Enumeration children () {
    throw new UnsupportedOperationException ();
}
 
Example #30
Source File: StyleableModelViewModel_.java    From epoxy with Apache License 2.0 4 votes vote down vote up
@Override
public StyleableModelViewModel_ layout(@LayoutRes int arg0) {
  throw new UnsupportedOperationException("Layout resources are unsupported with programmatic views.");
}