本文整理汇总了Java中org.apache.commons.lang.NotImplementedException类的典型用法代码示例。如果您正苦于以下问题:Java NotImplementedException类的具体用法?Java NotImplementedException怎么用?Java NotImplementedException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NotImplementedException类属于org.apache.commons.lang包,在下文中一共展示了NotImplementedException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: iterable
import org.apache.commons.lang.NotImplementedException; //导入依赖的package包/类
public static <T> Iterable<T> iterable(final T values[]) {
return (new Iterable<T>() {
@Override
public Iterator<T> iterator() {
return new Iterator<T>() {
private int idx = 0;
@Override
public boolean hasNext() {
return (this.idx < values.length);
}
@Override
public T next() {
return (values[this.idx++]);
}
@Override
public void remove() {
throw new NotImplementedException();
}
};
}
});
}
示例2: iterable
import org.apache.commons.lang.NotImplementedException; //导入依赖的package包/类
/**
* Wrap an Iterable around an Enumeration
* @param <T>
* @param e
* @return
*/
public static <T> Iterable<T> iterable(final Enumeration<T> e) {
return (new Iterable<T>() {
@Override
public Iterator<T> iterator() {
return new Iterator<T>() {
@Override
public boolean hasNext() {
return (e.hasMoreElements());
}
@Override
public T next() {
return (e.nextElement());
}
@Override
public void remove() {
throw new NotImplementedException();
}
};
}
});
}
示例3: remove
import org.apache.commons.lang.NotImplementedException; //导入依赖的package包/类
/**
* Removes the table descriptor from the local cache and returns it.
* If not in read only mode, it also deletes the entire table directory(!)
* from the FileSystem.
*/
@Override
public HTableDescriptor remove(final TableName tablename)
throws IOException {
if (fsreadonly) {
throw new NotImplementedException("Cannot remove a table descriptor - in read only mode");
}
Path tabledir = getTableDir(tablename);
if (this.fs.exists(tabledir)) {
if (!this.fs.delete(tabledir, true)) {
throw new IOException("Failed delete of " + tabledir.toString());
}
}
HTableDescriptor descriptor = this.cache.remove(tablename);
if (descriptor == null) {
return null;
} else {
return descriptor;
}
}
示例4: createTableDescriptorForTableDirectory
import org.apache.commons.lang.NotImplementedException; //导入依赖的package包/类
/**
* Create a new HTableDescriptor in HDFS in the specified table directory. Happens when we create
* a new table or snapshot a table.
* @param tableDir table directory under which we should write the file
* @param htd description of the table to write
* @param forceCreation if <tt>true</tt>,then even if previous table descriptor is present it will
* be overwritten
* @return <tt>true</tt> if the we successfully created the file, <tt>false</tt> if the file
* already exists and we weren't forcing the descriptor creation.
* @throws IOException if a filesystem error occurs
*/
public boolean createTableDescriptorForTableDirectory(Path tableDir,
HTableDescriptor htd, boolean forceCreation) throws IOException {
if (fsreadonly) {
throw new NotImplementedException("Cannot create a table descriptor - in read only mode");
}
FileStatus status = getTableInfoPath(fs, tableDir);
if (status != null) {
LOG.debug("Current tableInfoPath = " + status.getPath());
if (!forceCreation) {
if (fs.exists(status.getPath()) && status.getLen() > 0) {
if (readTableDescriptor(fs, status, false).equals(htd)) {
LOG.debug("TableInfo already exists.. Skipping creation");
return false;
}
}
}
}
Path p = writeTableDescriptor(fs, htd, tableDir, status);
return p != null;
}
示例5: iterator
import org.apache.commons.lang.NotImplementedException; //导入依赖的package包/类
@Override
public Iterator<T> iterator() {
return new Iterator<T>() {
private int returned = 0;
@Override
public boolean hasNext() {
return this.returned < 2;
}
@Override
public T next() {
if (++this.returned == 1) return getFirst();
else if (this.returned == 2) return getSecond();
else throw new IllegalAccessError("this.returned=" + this.returned);
}
@Override
public void remove() {
throw new NotImplementedException();
}
};
}
示例6: safeHandle
import org.apache.commons.lang.NotImplementedException; //导入依赖的package包/类
@Override
public AppiumResponse safeHandle(IHttpRequest request) {
try {
int requestedType = getPayload(request).getInt("type");
NetworkConnectionEnum networkType = NetworkConnectionEnum.getNetwork(requestedType);
switch (networkType) {
case WIFI:
return WifiHandler.toggle(true, getSessionId(request));
case DATA:
case AIRPLANE:
case ALL:
case NONE:
return new AppiumResponse(getSessionId(request), WDStatus.UNKNOWN_ERROR, new NotImplementedException("Setting Network Connection to: " + networkType.getNetworkType() + " :is not implemented"));
default:
return new AppiumResponse(getSessionId(request), WDStatus.UNKNOWN_ERROR, new UiAutomator2Exception("Invalid Network Connection type: "+ requestedType));
}
} catch (JSONException e) {
Logger.error("Exception while reading JSON: ", e);
return new AppiumResponse(getSessionId(request), WDStatus.JSON_DECODER_ERROR, e);
}
}
示例7: gen
import org.apache.commons.lang.NotImplementedException; //导入依赖的package包/类
@Override
public Instruction gen(GeneratorContext ctx, Set_stmtContext rule)
throws OrcaException {
if (rule.set_stmt_names() != null) {
return genSetNames(ctx, rule.set_stmt_names());
}
if (rule.set_stmt_character_set() != null) {
return genSetCharSet(ctx, rule.set_stmt_character_set());
}
else if (rule.set_stmt_variable() != null){
return genSetVariables(ctx, rule.set_stmt_variable());
}
else {
throw new NotImplementedException();
}
}
示例8: setColumnDefault
import org.apache.commons.lang.NotImplementedException; //导入依赖的package包/类
private static void setColumnDefault(ColumnAttributes attrs, Column_constraint_defaultContext rule) {
if (rule.literal_value() != null) {
String value = rule.literal_value().getText();
if (value.equalsIgnoreCase("null")) {
attrs.setDefaultValue(null);
}
else {
attrs.setDefaultValue(value);
}
}
else if (rule.signed_number() != null) {
attrs.setDefaultValue(rule.signed_number().getText());
}
else {
throw new NotImplementedException();
}
}
示例9: createParameterNames
import org.apache.commons.lang.NotImplementedException; //导入依赖的package包/类
/**
* Create parameter names for excluding the tags of the query. The returned parameters will
* already be prefixed with a colon.
*
* @param formula
* the formula to process
* @return the comma separated list of parameter names
*/
protected String createParameterNames(LogicalTagFormula formula) {
if (formula.isNegated()) {
throw new NotImplementedException("Negated tag formulas cannot be used"
+ " in a RelatedRankedTagQuery");
}
StringBuilder sb = new StringBuilder();
if (formula instanceof AtomicTagFormula) {
sb.append(":");
sb.append(createParameterName((AtomicTagFormula) formula));
} else {
String prefix = ":";
CompoundTagFormula compoundFormula = (CompoundTagFormula) formula;
for (AtomicTagFormula atom : compoundFormula.getPositiveAtoms()) {
sb.append(prefix);
sb.append(createParameterName(atom));
prefix = ", :";
}
}
return sb.toString();
}
示例10: eval
import org.apache.commons.lang.NotImplementedException; //导入依赖的package包/类
@Override
public long eval(VdmContext ctx, Heap heap, Parameters params, long pRecord) {
long pValue = upstream.eval(ctx, heap, params, pRecord);
if (pValue == 0) {
return 0;
}
int type = Value.getType(heap, pValue);
if (type == Value.TYPE_BYTES) {
return pValue;
}
else if (type == Value.TYPE_BLOB) {
return pValue;
}
else if (type == Value.TYPE_STRING) {
long pBytes = FishObject.toBytes(heap, pValue);
return pBytes;
}
else {
throw new NotImplementedException();
}
}
示例11: tagFormulaToString
import org.apache.commons.lang.NotImplementedException; //导入依赖的package包/类
/**
* transform a tag formula to a string Note: only supports non negative conjunction, which will
* result in a comma separated list
*
* @param f
* the formula
* @param separator
* the separator used during tag parsing
* @return the string representation
*/
public String tagFormulaToString(LogicalTagFormula f, String separator) {
if (f instanceof AtomicTagFormula) {
return ((AtomicTagFormula) f).getTag();
}
CompoundTagFormula cf = (CompoundTagFormula) f;
if (cf.isNegated() || cf.isDisjunction()) {
throw new NotImplementedException("Creating string representation of disjunction or"
+ " negations is not supported.");
}
String prefix = "";
StringBuilder sb = new StringBuilder();
AtomicTagFormula[] atoms = cf.getPositiveAtoms();
for (int i = 0; i < atoms.length; i++) {
sb.append(prefix);
sb.append(atoms[i].getTag());
prefix = separator + " ";
}
return sb.toString();
}
示例12: run
import org.apache.commons.lang.NotImplementedException; //导入依赖的package包/类
@Override
public Object run(VdmContext ctx, Parameters params) {
TableMeta table = Checks.tableExist(ctx.getSession(), this.tableName);
try {
ctx.getSession().lockTable(table.getId(), LockLevel.EXCLUSIVE, false);
// copy the table over to a new one
ObjectName newName = ctx.getMetaService().findUniqueName(ctx.getTransaction(), this.tableName);
new CreateTable(newName).run(ctx, params);
// ..... more more to be implemented
throw new NotImplementedException();
}
finally {
ctx.getSession().unlockTable(table.getId());
}
}
示例13: sendChunkChange
import org.apache.commons.lang.NotImplementedException; //导入依赖的package包/类
@Override
public boolean sendChunkChange(Location loc, int sx, int sy, int sz, byte[] data) {
if (getHandle().playerNetServerHandler == null) return false;
/*
int x = loc.getBlockX();
int y = loc.getBlockY();
int z = loc.getBlockZ();
int cx = x >> 4;
int cz = z >> 4;
if (sx <= 0 || sy <= 0 || sz <= 0) {
return false;
}
if ((x + sx - 1) >> 4 != cx || (z + sz - 1) >> 4 != cz || y < 0 || y + sy > 128) {
return false;
}
if (data.length != (sx * sy * sz * 5) / 2) {
return false;
}
Packet51MapChunk packet = new Packet51MapChunk(x, y, z, sx, sy, sz, data);
getHandle().playerConnection.sendPacket(packet);
return true;
*/
throw new NotImplementedException("Chunk changes do not yet work"); // TODO: Chunk changes.
}
示例14: getTypeForClass
import org.apache.commons.lang.NotImplementedException; //导入依赖的package包/类
@Nullable
private static Object getTypeForClass(Class clazz, String input, @Nullable CommandSender sender) throws InputException {
if (clazz == null) {
throw new IllegalArgumentException("Cannot determine input type for null class");
}
if (clazz.equals(String.class)) {
return input;
} else if (clazz.isPrimitive()) {
return getPrimitive(clazz, input);
} else if (clazz.equals(Class.class)) {
return getBukkitClass(input);
} else if (clazz.equals(Material.class)) {
return getMaterial(input);
} else if (clazz.equals(MaterialData.class)) {
return getMaterialData(input);
} else if (clazz.equals(Location.class)) {
return getLocation(input, sender);
} else if (clazz.equals(Entity.class)) {
return getEntity(input, sender);
} else if (clazz.equals(UUID.class)) {
return getUUID(input, sender);
} else if (clazz.equals(GameMode.class)) {
return getGameMode(input);
} else if (clazz.equals(Difficulty.class)) {
return getDifficulty(input);
} else if (Enum.class.isAssignableFrom(clazz)) { // Do not use for all enum types, lacks magic value support
return getValueFromEnum(clazz, input);
} else if (clazz.equals(ItemStack.class)) {
return getItemStack(input, sender);
} else if (clazz.equals(Class[].class)) {
return getBukkitClasses(input);
}
throw new InputException(new NotImplementedException("Input handling for class type " + clazz.getSimpleName() + " not implemented yet"));
}
示例15: clone
import org.apache.commons.lang.NotImplementedException; //导入依赖的package包/类
@Override
public IntegrityConstraint clone(){
try {
throw new NotImplementedException("The clone method should be implemented in the subtypes!");
} catch (NotImplementedException e) {
e.printStackTrace();
}
return null;
}