Package com.baulsupp.kolja.log.util

Examples of com.baulsupp.kolja.log.util.IntRange


    return l.size();
  }

  private IntList readUpTo(int position) {
    position = Math.min(position, buffer.length());
    IntList result = lineIndex.get(new IntRange(0, position));

    positionRead = Math.max(positionRead, position);
    linesRead = result.size();

    return result;
View Full Code Here


  public Collection<RequestLine> getKnown() {
    return requests.values();
  }

  public List<Line> getAll() {
    return get(new IntRange(0, length()));
  }
View Full Code Here

  private void ensureLineKnown(IntRange region, RequestLine line) {
    if (line.isComplete()) {
      return;
    }

    region = new IntRange(region);

    while (!line.isComplete()) {
      if (!line.isStartFound()) {
        region.setFrom(Math.max(0, region.getFrom() - region.getLength()));
      }
View Full Code Here

    return cs.newDecoder().averageCharsPerByte() == 1;
  }

  public char charAt(int index) {
    if (index < offset) {
      throw new IndexOutOfBoundsException("index " + index + " current range " + new IntRange(offset, chunkThreeAvailable));
    }

    if (index < chunkOneAvailable) {
      return chunkOne[index - offset];
    }
View Full Code Here

  public Collection<RequestLine> getKnown() {
    return requests.values();
  }

  public List<Line> getAll() {
    return get(new IntRange(0, length()));
  }
View Full Code Here

  private void ensureLineKnown(IntRange region, RequestLine line) {
    if (line.isComplete()) {
      return;
    }

    region = new IntRange(region);

    while (!line.isComplete()) {
      if (!line.isStartFound()) {
        region.setFrom(Math.max(0, region.getFrom() - region.getLength()));
      }
View Full Code Here

      }
    }
  }

  public void ensureAllKnown() {
    ensureKnown(new IntRange(0, li.length()));
  }
View Full Code Here

      processLines(unknownRegion, list);
    }
  }

  public IntRange[] listUnknown() {
    return indexed.listUnknownRanges(new IntRange(0, li.length()));
  }
View Full Code Here

    readInitialChunks();
  }

  public char charAt(int index) {
    if (index < offset) {
      throw new IndexOutOfBoundsException("index " + index + " current range " + new IntRange(offset, chunkThreeAvailable));
    }

    if (index < chunkOneAvailable) {
      return chunkOne[index - offset];
    }
View Full Code Here

    if (unknown.length == 0) {
      log.info("nothing to process");

      return false;
    } else {
      IntRange first = new IntRange(unknown[0]);
     
      if (first.getLength() > BACKGROUND_READAHEAD) {
        first.setTo(first.getFrom() + BACKGROUND_READAHEAD);
      }
     
      log.info("ensuring known " + first);
     
      eventList.ensureKnown(first);
View Full Code Here

TOP

Related Classes of com.baulsupp.kolja.log.util.IntRange

Copyright © 2018 www.massapicom. 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.