gpt4 book ai didi

com.koolearn.klibrary.text.view.ZLTextPosition.getCharIndex()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 11:52:33 25 4
gpt4 key购买 nike

本文整理了Java中com.koolearn.klibrary.text.view.ZLTextPosition.getCharIndex()方法的一些代码示例,展示了ZLTextPosition.getCharIndex()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZLTextPosition.getCharIndex()方法的具体详情如下:
包路径:com.koolearn.klibrary.text.view.ZLTextPosition
类名称:ZLTextPosition
方法名:getCharIndex

ZLTextPosition.getCharIndex介绍

暂无

代码示例

代码示例来源:origin: ydcx/KooReader

@Override
  public String toString() {
    return getClass().getSimpleName() + " [" + getParagraphIndex() + "," + getElementIndex() + "," + getCharIndex() + "]";
  }
}

代码示例来源:origin: Jiangzqts/EpubRead

@Override
  public String toString() {
    return getClass().getSimpleName() + " [" + getParagraphIndex() + "," + getElementIndex() + "," + getCharIndex() + "]";
  }
}

代码示例来源:origin: ydcx/KooReader

public PositionWithTimestamp(ZLTextPosition pos) {
  this(
    pos.getParagraphIndex(),
    pos.getElementIndex(),
    pos.getCharIndex(),
    (pos instanceof ZLTextFixedPosition.WithTimestamp)
      ? ((ZLTextFixedPosition.WithTimestamp)pos).Timestamp : -1
  );
}

代码示例来源:origin: Jiangzqts/EpubRead

public boolean samePositionAs(ZLTextPosition position) {
  return
    getParagraphIndex() == position.getParagraphIndex() &&
    getElementIndex() == position.getElementIndex() &&
    getCharIndex() == position.getCharIndex();
}

代码示例来源:origin: ydcx/KooReader

public boolean samePositionAs(ZLTextPosition position) {
  return
    getParagraphIndex() == position.getParagraphIndex() &&
    getElementIndex() == position.getElementIndex() &&
    getCharIndex() == position.getCharIndex();
}

代码示例来源:origin: ydcx/KooReader

public ZLTextFixedPosition(ZLTextPosition position) {
  ParagraphIndex = position.getParagraphIndex();
  ElementIndex = position.getElementIndex();
  CharIndex = position.getCharIndex();
}

代码示例来源:origin: ydcx/KooReader

public int compareTo(ZLTextPosition position) {
  final int p0 = getParagraphIndex();
  final int p1 = position.getParagraphIndex();
  if (p0 != p1) {
    return p0 < p1 ? -1 : 1;
  }
  final int e0 = getElementIndex();
  final int e1 = position.getElementIndex();
  if (e0 != e1) {
    return e0 < e1 ? -1 : 1;
  }
  return getCharIndex() - position.getCharIndex();
}

代码示例来源:origin: Jiangzqts/EpubRead

public PositionWithTimestamp(ZLTextPosition pos) {
  this(
    pos.getParagraphIndex(),
    pos.getElementIndex(),
    pos.getCharIndex(),
    (pos instanceof ZLTextFixedPosition.WithTimestamp)
      ? ((ZLTextFixedPosition.WithTimestamp)pos).Timestamp : -1
  );
}

代码示例来源:origin: Jiangzqts/EpubRead

public ZLTextFixedPosition(ZLTextPosition position) {
  ParagraphIndex = position.getParagraphIndex();
  ElementIndex = position.getElementIndex();
  CharIndex = position.getCharIndex();
}

代码示例来源:origin: Jiangzqts/EpubRead

@Override
public int hashCode() {
  return (getParagraphIndex() << 16) + (getElementIndex() << 8) + getCharIndex();
}

代码示例来源:origin: Jiangzqts/EpubRead

public int compareTo(ZLTextPosition position) {
  final int p0 = getParagraphIndex();
  final int p1 = position.getParagraphIndex();
  if (p0 != p1) {
    return p0 < p1 ? -1 : 1;
  }
  final int e0 = getElementIndex();
  final int e1 = position.getElementIndex();
  if (e0 != e1) {
    return e0 < e1 ? -1 : 1;
  }
  return getCharIndex() - position.getCharIndex();
}

代码示例来源:origin: ydcx/KooReader

@Override
public int hashCode() {
  return (getParagraphIndex() << 16) + (getElementIndex() << 8) + getCharIndex();
}

代码示例来源:origin: Jiangzqts/EpubRead

@Override
public boolean equals(Object object) {
  if (object == this) {
    return true;
  }
  if (!(object instanceof ZLTextPosition)) {
    return false;
  }
  final ZLTextPosition position = (ZLTextPosition)object;
  return
    getParagraphIndex() == position.getParagraphIndex() &&
    getElementIndex() == position.getElementIndex() &&
    getCharIndex() == position.getCharIndex();
}

代码示例来源:origin: ydcx/KooReader

@Override
public boolean equals(Object object) {
  if (object == this) {
    return true;
  }
  if (!(object instanceof ZLTextPosition)) {
    return false;
  }
  final ZLTextPosition position = (ZLTextPosition)object;
  return
    getParagraphIndex() == position.getParagraphIndex() &&
    getElementIndex() == position.getElementIndex() &&
    getCharIndex() == position.getCharIndex();
}

代码示例来源:origin: Jiangzqts/EpubRead

public final synchronized void gotoPosition(ZLTextPosition position) {
  if (position != null) {
    gotoPosition(position.getParagraphIndex(), position.getElementIndex(), position.getCharIndex());
  }
}

代码示例来源:origin: ydcx/KooReader

public final synchronized void gotoPosition(ZLTextPosition position) {
  if (position != null) {
    gotoPosition(position.getParagraphIndex(), position.getElementIndex(), position.getCharIndex());
  }
}

代码示例来源:origin: Jiangzqts/EpubRead

public void moveTo(ZLTextPosition position) {
  LogUtil.i13("moveTo1:" + toString());
  moveToParagraph(position.getParagraphIndex());
  moveTo(position.getElementIndex(), position.getCharIndex());
}

代码示例来源:origin: ydcx/KooReader

public void moveTo(ZLTextPosition position) {
  LogUtil.i13("moveTo1:" + toString());
  moveToParagraph(position.getParagraphIndex());
  moveTo(position.getElementIndex(), position.getCharIndex());
}

代码示例来源:origin: ydcx/KooReader

protected void storePosition(long bookId, ZLTextPosition position) {
  LogUtil.i24("" + position.getParagraphIndex());
  final SQLiteStatement statement = get(
      "INSERT OR REPLACE INTO BookState (book_id,paragraph,word,char,timestamp) VALUES (?,?,?,?,?)"
  );
  synchronized (statement) {
    statement.bindLong(1, bookId);
    statement.bindLong(2, position.getParagraphIndex());
    statement.bindLong(3, position.getElementIndex());
    statement.bindLong(4, position.getCharIndex());
    long timestamp = -1;
    if (position instanceof ZLTextFixedPosition.WithTimestamp) {
      timestamp = ((ZLTextFixedPosition.WithTimestamp) position).Timestamp;
    }
    if (timestamp == -1) {
      timestamp = System.currentTimeMillis();
    }
    statement.bindLong(5, timestamp);
    statement.execute();
  }
}

代码示例来源:origin: Jiangzqts/EpubRead

protected void storePosition(long bookId, ZLTextPosition position) {
  LogUtil.i24("" + position.getParagraphIndex());
  final SQLiteStatement statement = get(
      "INSERT OR REPLACE INTO BookState (book_id,paragraph,word,char,timestamp) VALUES (?,?,?,?,?)"
  );
  synchronized (statement) {
    statement.bindLong(1, bookId);
    statement.bindLong(2, position.getParagraphIndex());
    statement.bindLong(3, position.getElementIndex());
    statement.bindLong(4, position.getCharIndex());
    long timestamp = -1;
    if (position instanceof ZLTextFixedPosition.WithTimestamp) {
      timestamp = ((ZLTextFixedPosition.WithTimestamp) position).Timestamp;
    }
    if (timestamp == -1) {
      timestamp = System.currentTimeMillis();
    }
    statement.bindLong(5, timestamp);
    statement.execute();
  }
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com