Examples of subSequence()


Examples of client.net.sf.saxon.ce.om.GroundedValue.subsequence()

    */
   
    public static SequenceIterator make(SequenceIterator base, int min, int max) throws XPathException {
        if (base instanceof GroundedIterator) {
            GroundedValue value = ((GroundedIterator)base).materialize();
            value = value.subsequence(min-1, max-min+1);
            return ((Value)value).iterate();
        } else {
            return new SubsequenceIterator(base, min, max);
        }
    }
View Full Code Here

Examples of com.cloudera.flume.handlers.text.CustomDelimCursor.ByteBufferAsCharSequence.subSequence()

  @Test
  public void testBBCSSubsequence() {
    ByteBuffer buf = ByteBuffer.wrap("This is a test".getBytes());
    ByteBufferAsCharSequence bbcs = new ByteBufferAsCharSequence(buf);

    CharSequence cs = bbcs.subSequence(5, 13);
    assertEquals('i', cs.charAt(0));
    assertEquals('s', cs.charAt(1));
    assertEquals('s', cs.charAt(7));

    // original still sane?
View Full Code Here

Examples of it.unimi.dsi.lang.MutableString.subSequence()

      if ( line.charAt( 0 ) == '#' ) continue;
      matcher.reset( line );
      l = 0;
      start = 0;
      while( matcher.find() && l <= h ) {
        printStream[ l ].println( line.subSequence( start, matcher.start() ) );
        start = matcher.end();
        l++;
      }
    }
   
View Full Code Here

Examples of java.nio.CharBuffer.subSequence()

      int start = 0;
      // Ignore any white spaces and line feed
      char c = chFrom.charAt(start);
      while (c==' ' || c=='\r' || c=='\n' || c=='\t') c = chFrom.charAt(++start);
      // If first line does not start with message preffx then raise an exception
      if (!chFrom.subSequence(start, start+FROM__PREFIX.length()).toString().equals(FROM__PREFIX))
        throw new IOException ("MboxFile.getMessageAsStream() starting position " + String.valueOf(start) + " \""+chFrom.subSequence(start, start+FROM__PREFIX.length()).toString()+"\" does not match a begin message token \"" + FROM__PREFIX + "\"");
      // Skip the From line
      while (chFrom.charAt(start++)!=(char) 10) ;

      log.debug("  skip = " + String.valueOf(start));
View Full Code Here

Examples of java.nio.CharBuffer.subSequence()

      // Ignore any white spaces and line feed
      char c = chFrom.charAt(start);
      while (c==' ' || c=='\r' || c=='\n' || c=='\t') c = chFrom.charAt(++start);
      // If first line does not start with message preffx then raise an exception
      if (!chFrom.subSequence(start, start+FROM__PREFIX.length()).toString().equals(FROM__PREFIX))
        throw new IOException ("MboxFile.getMessageAsStream() starting position " + String.valueOf(start) + " \""+chFrom.subSequence(start, start+FROM__PREFIX.length()).toString()+"\" does not match a begin message token \"" + FROM__PREFIX + "\"");
      // Skip the From line
      while (chFrom.charAt(start++)!=(char) 10) ;

      log.debug("  skip = " + String.valueOf(start));
      log.debug("  start = " + String.valueOf(begin+start));
View Full Code Here

Examples of java.nio.CharBuffer.subSequence()

      int start = 0;
      // Ignore any white spaces and line feed
      char c = chFrom.charAt(start);
      while (c==' ' || c=='\r' || c=='\n' || c=='\t') c = chFrom.charAt(++start);
      // If first line does not start with message preffx then raise an exception
      log.debug("first line is " + chFrom.subSequence(start, start+FROM__PREFIX.length()).toString());
      if (!chFrom.subSequence(start, start+FROM__PREFIX.length()).toString().equals(FROM__PREFIX))
        throw new IOException ("MboxFile.getPartAsStream() starting position " + String.valueOf(start) + " \""+chFrom.subSequence(start, start+FROM__PREFIX.length()).toString()+"\" does not match a begin message token \"" + FROM__PREFIX + "\"");
      // Skip the From line
      while (chFrom.charAt(start++)!=(char) 10) ;
View Full Code Here

Examples of java.nio.CharBuffer.subSequence()

      // Ignore any white spaces and line feed
      char c = chFrom.charAt(start);
      while (c==' ' || c=='\r' || c=='\n' || c=='\t') c = chFrom.charAt(++start);
      // If first line does not start with message preffx then raise an exception
      log.debug("first line is " + chFrom.subSequence(start, start+FROM__PREFIX.length()).toString());
      if (!chFrom.subSequence(start, start+FROM__PREFIX.length()).toString().equals(FROM__PREFIX))
        throw new IOException ("MboxFile.getPartAsStream() starting position " + String.valueOf(start) + " \""+chFrom.subSequence(start, start+FROM__PREFIX.length()).toString()+"\" does not match a begin message token \"" + FROM__PREFIX + "\"");
      // Skip the From line
      while (chFrom.charAt(start++)!=(char) 10) ;

      start += offset;
View Full Code Here

Examples of java.nio.CharBuffer.subSequence()

      char c = chFrom.charAt(start);
      while (c==' ' || c=='\r' || c=='\n' || c=='\t') c = chFrom.charAt(++start);
      // If first line does not start with message preffx then raise an exception
      log.debug("first line is " + chFrom.subSequence(start, start+FROM__PREFIX.length()).toString());
      if (!chFrom.subSequence(start, start+FROM__PREFIX.length()).toString().equals(FROM__PREFIX))
        throw new IOException ("MboxFile.getPartAsStream() starting position " + String.valueOf(start) + " \""+chFrom.subSequence(start, start+FROM__PREFIX.length()).toString()+"\" does not match a begin message token \"" + FROM__PREFIX + "\"");
      // Skip the From line
      while (chFrom.charAt(start++)!=(char) 10) ;

      start += offset;
View Full Code Here

Examples of java.nio.CharBuffer.subSequence()

      int start = 0;
      // Ignore any white spaces and line feed
      char c = chFrom.charAt(start);
      while (c==' ' || c=='\r' || c=='\n' || c=='\t') c = chFrom.charAt(++start);
      // If first line does not start with message preffx then raise an exception
      if (!chFrom.subSequence(start, start+FROM__PREFIX.length()).toString().equals(FROM__PREFIX))
        throw new IOException ("MboxFile.getMessageAsStream() starting position " + String.valueOf(start) + " \""+chFrom.subSequence(start, start+FROM__PREFIX.length()).toString()+"\" does not match a begin message token \"" + FROM__PREFIX + "\"");
      // Skip the From line
      while (chFrom.charAt(start++)!=(char) 10) ;

      log.debug("  skip = " + String.valueOf(start));
View Full Code Here

Examples of java.nio.CharBuffer.subSequence()

      // Ignore any white spaces and line feed
      char c = chFrom.charAt(start);
      while (c==' ' || c=='\r' || c=='\n' || c=='\t') c = chFrom.charAt(++start);
      // If first line does not start with message preffx then raise an exception
      if (!chFrom.subSequence(start, start+FROM__PREFIX.length()).toString().equals(FROM__PREFIX))
        throw new IOException ("MboxFile.getMessageAsStream() starting position " + String.valueOf(start) + " \""+chFrom.subSequence(start, start+FROM__PREFIX.length()).toString()+"\" does not match a begin message token \"" + FROM__PREFIX + "\"");
      // Skip the From line
      while (chFrom.charAt(start++)!=(char) 10) ;

      log.debug("  skip = " + String.valueOf(start));
      log.debug("  start = " + String.valueOf(position+start));
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.