"Naked" parameters in casts or instanceof operations.
数据类型转换或instance of操作中的“外露”参数。
You can check them with type hinting and instanceof tests.
可以用类型提示和instance of测试来检查它们。
"Naked" type parameters can't be used in casts or instanceof operations.
不能在数据类型转换或instance of操作中使用“外露”类型参数。
In some cases, it may be sensible to use an instanceof check prior to doing a class cast.
在某些情况下,在做类型转换之前用instance of进行检查是有意义的。
You can check for a sequence by doing bo.getProperty("") instanceof commonj.sdo.Sequence.
可以通过执行 bo.getProperty("") instanceof commonj.sdo.Sequence 检查序列。
Similarly, instanceof will check that the operand is an instanceof the bound of the parameter.
同样,instance of将检查操作数是否是参数界限的instance of。
If required, the instanceof operator can be used to determine the specific destination subtype.
如果需要,可以使用instance of运算符来确定指定的目的地子类型。
The instanceof operator resolves to true if the given object is an instance of the given class.
如果给定对象是给定类的实例,则 instanceof 操作符解析为真。
You can even check that a certain method or property is available, with a finer granularity than through any instanceof check
你甚至可以检查某个特定的方法或者属性是否可用,比使用instanceof来检查的粒度要小的多
I could easily add support for reporting casts, instanceof tests, and catch blocks by implementing the appropriate methods in VerboseEditor.
通过在VerboseEditor中实现适当的方法,可以容易地增加对报告强制类型转换、instance of检查和catch块的支持。
You can test this using the instanceof operator, which returns true if the object is a member of the indicated class, as shown in Listing 14.
可以使用instance of操作符来测试这一点,如果对象是指定类的成员,则返回true,如清单14所示。
You should perform an instanceOf operation to make sure it is the view you are looking for, and then type cast it to the appropriate view class.
应执行instance Of操作来确保它就是正在寻找的视图,然后将其类型转换为适当的视图类。
You can verify it manually with the instanceof operator, a handy tool introduced with PHP V5 that sits between an object instance and a class name.
可以用instance of操作符来手动验证这一点,该操作符是PHP V 5引入的介于对象实例和类名之间的一个便捷工具。
Similarly, instanceof checks on naked type parameters will result in an "unchecked" warning at compile time and the check will not occur as expected at runtime.
同样,对“外露”类型参数的instance of检查将在编译时产生“unchecked”警告,而且检查将不会如期在运行时进行。
Throwing an exception would not help in our case because we would then have to add instanceof checks in hasConsecutiveZeros to ensure that we didn't trigger the exception.
抛出一个异常在本例中帮不了什么忙,因为我们将不得不在 hasConsecutiveZeros 中添加 instanceof 检查语句以确保我们没有触发异常。
Because Tiger relies on type erasure, the naked type parameters in casts and instanceof tests are "erased" to their upper bounds (in the earlier case, that'll be type Object).
因为Tiger依靠类型擦除,所以数据类型转换和instance of测试中的外露类型参数被“擦除”为它们的上界(在前面的例子中,那将是类型Object)。
The instanceof function provides a good way of checking type, but you can also roll object type checking into the method signature itself by using type hints in the argument list.
虽然 instanceof 功能提供了一种检查类型的好方法,但您还可以通过在参数列表中使用类型提示,来将对象类型检查滚动到方法签名自身中。
Another consequence of erasure is that using casts or instanceof with generic type parameters doesn't make any sense. The following code will not improve the type safety of your code at all.
擦除的另一个后果是,对泛型类型参数是用强制类型转换或者instance of毫无意义。
The disadvantage of using instanceof checks in this fashion is that, if we were to add another subclass of Tree (such as, a LeafWithValue class), we would have to revise these instanceof checks.
以这种方式使用instance of检查语句的一个缺点是,如果我们要添加Tree的另一个子类(比如一个leafwithvalue类),我们将不得不修改这些instance of检查语句。