Пример #1
0
 /** {@inheritDoc} */
 @SuppressWarnings({"SuspiciousMethodCalls"})
 public boolean retainAll(Collection<?> collection) {
   boolean modified = false;
   TCharIterator iter = iterator();
   while (iter.hasNext()) {
     if (!collection.contains(Character.valueOf(iter.next()))) {
       iter.remove();
       modified = true;
     }
   }
   return modified;
 }
 /** {@inheritDoc} */
 @Override
 public boolean retainAll(Collection<?> collection) {
   boolean modified = false;
   TCharIterator iter = iterator();
   while (iter.hasNext()) {
     if (!collection.contains(Character.valueOf(iter.next()))) {
       iter.remove();
       modified = true;
     }
   }
   return modified;
 }
Пример #3
0
 @SuppressWarnings("UnnecessaryBoxing")
 private static Object box(final Object value) {
   Object newBoxedValue;
   if (value instanceof Integer) {
     newBoxedValue = Integer.valueOf(((Integer) value).intValue());
   } else if (value instanceof Byte) {
     newBoxedValue = Byte.valueOf(((Byte) value).byteValue());
   } else if (value instanceof Short) {
     newBoxedValue = Short.valueOf(((Short) value).shortValue());
   } else if (value instanceof Long) {
     newBoxedValue = Long.valueOf(((Long) value).longValue());
   } else if (value instanceof Boolean) {
     newBoxedValue = Boolean.valueOf(((Boolean) value).booleanValue());
   } else if (value instanceof Character) {
     newBoxedValue = Character.valueOf(((Character) value).charValue());
   } else {
     return new Object();
   }
   return newBoxedValue;
 }