Examples of replaceWith()


Examples of edu.cmu.cs.stage3.alice.core.Element.replaceWith()

            if (part != null) {
              edu.cmu.cs.stage3.math.Vector3 posToParent =
                ((Model) part).getPosition((edu.cmu.cs.stage3.alice.core.ReferenceFrame) part.getParent());
              edu.cmu.cs.stage3.math.Matrix33 orientToParent =
                ((Model) part).getOrientationAsAxes((edu.cmu.cs.stage3.alice.core.ReferenceFrame) part.getParent());
              part.replaceWith(model);
              if (part instanceof Model) {
                model.vehicle.set(((Model) part).vehicle.get());
                ((Model) part).vehicle.set(null);
                if (posToParent != null)
                   ((Model) model).setPositionRightNow(posToParent, (edu.cmu.cs.stage3.alice.core.ReferenceFrame) model.getParent());
View Full Code Here

Examples of edu.cmu.cs.stage3.alice.core.Element.replaceWith()

        if (parents.length > 0) {
          Element child = parents[0].getChildNamed(part.name.getStringValue());
          if (child != null) {
            part.isFirstClass.set(false);
            edu.cmu.cs.stage3.math.Vector3 posToParent = ((Model) child).getPosition((edu.cmu.cs.stage3.alice.core.ReferenceFrame) parents[0]);
            child.replaceWith(part);
            if (child instanceof Model) {
              part.vehicle.set(((Model) child).vehicle.get());
              ((Model) child).vehicle.set(null);
              if (posToParent != null)
                 ((Model) part).setPositionRightNow(posToParent, (edu.cmu.cs.stage3.alice.core.ReferenceFrame) part.getParent());
View Full Code Here

Examples of java.nio.charset.CharsetDecoder.replaceWith()

                        // start after the NUL
                        if (cc.cbopt.charAt(1) == 0x00) {
                            cc.cbopt = cc.cbopt.substring(2);

                            try {
                                decoder.replaceWith(cc.cbopt);
                            } catch (Exception e) {
                                logln("Skipping test due to limitation in Java API - substitution character sequence size error");
                            }
                        }
                    }
View Full Code Here

Examples of java.nio.charset.CharsetDecoder.replaceWith()

        CharsetDecoder decoder = charset.newDecoder();
       
        decoder.onUnmappableCharacter(actions.onUnmappableCharacter);
        decoder.onMalformedInput(actions.onMalformedInput);
       
        if (actions.replaceWith != null) decoder.replaceWith(actions.replaceWith.toString());

        return decoder;
    }

    private CharsetEncoder getCharsetEncoder(Charset charset) {
View Full Code Here

Examples of java.nio.charset.CharsetDecoder.replaceWith()

   
    static String inputStreamToString(InputStream is) throws IOException {
        CharsetDecoder decoder = Charsets.US_ASCII.newDecoder();
        decoder.onMalformedInput(CodingErrorAction.IGNORE);
        decoder.onUnmappableCharacter(CodingErrorAction.REPLACE);
        decoder.replaceWith("?");
        CharBuffer buffer = decoder.decode(
            ByteBuffer.wrap(StreamUtil.inputStream2Bytes(is)));
        String t = buffer.toString();
        t = (t.length()<(MAX_BODY_CHARS+1))? t: t.substring(MAX_BODY_CHARS);
        if(t.isEmpty()) {
View Full Code Here

Examples of java.nio.charset.CharsetEncoder.replaceWith()

           
            IRubyObject replace = hash.fastARef(runtime.newSymbol("replace"));
            if (replace != null && !replace.isNil()) {
                String replaceWith = replace.toString();
                if (replaceWith.length() > 0) {
                    encoder.replaceWith(replaceWith.getBytes());
                } else {
                    action = CodingErrorAction.IGNORE;
                }
            }
           
View Full Code Here

Examples of java.nio.charset.CharsetEncoder.replaceWith()

                        // start after the NUL
                        if (cc.cbopt.charAt(1) == 0x00) {
                            cc.cbopt = cc.cbopt.substring(2);

                            try {
                                encoder.replaceWith(toByteArray(cc.cbopt));
                            } catch (Exception e) {
                                logln("Skipping test due to limitation in Java API - substitution character sequence size error");
                                return;
                            }
                        }
View Full Code Here

Examples of java.nio.charset.CharsetEncoder.replaceWith()

        @Override
    public byte[] generateBytes(String password) {
            final CharsetEncoder encoder = createCharsetEncoder();
            if (this.replacementByte != null) {
                encoder.replaceWith(new byte[]{this.replacementByte});
                encoder.onUnmappableCharacter(CodingErrorAction.REPLACE);
            } else {
                encoder.onUnmappableCharacter(CodingErrorAction.IGNORE);
            }
            try {
View Full Code Here

Examples of java.nio.charset.CharsetEncoder.replaceWith()

        CharsetEncoder encoder = charset.newEncoder();
       
        encoder.onUnmappableCharacter(actions.onUnmappableCharacter);
        encoder.onMalformedInput(actions.onMalformedInput);
        if (actions.replaceWith != null) {
            encoder.replaceWith(actions.replaceWith.getBytes());
        }

        return encoder;
    }
View Full Code Here

Examples of java.nio.charset.CharsetEncoder.replaceWith()

       
        // Regression test for harmony-3378
        Charset cs = Charset.forName("UTF-8");
        CharsetEncoder encoder = cs.newEncoder();
        encoder.onMalformedInput(CodingErrorAction.REPLACE);
        encoder = encoder.replaceWith(new byte[] { (byte) 0xef, (byte) 0xbf,
                (byte) 0xbd, });
        CharBuffer in = CharBuffer.wrap("\ud800");
        out = encoder.encode(in);
        assertNotNull(out);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.