Package qurtext.domain

Examples of qurtext.domain.Chapter


    try {
      String[] location=start.split("[:]");
      int chapterNo=Integer.valueOf(location[0]);
      int verseNo=Integer.valueOf(location[1]);
      int wordNo=Integer.valueOf(location[2]);
      Chapter chapter = ((Collection<Chapter>) pm.newQuery("select from " + Chapter.class.getName() + " where chapterNo==" + chapterNo)
          .execute()).iterator().next();
      for (Section section:chapter.getSections()) {
        if (section.getStartVerse()>verseNo || section.getEndVerse()<verseNo) continue;
        for (Verse verse:section.getVerses()) {
          if (verse.getVerseNo()!=verseNo) continue;
          String[] texts = verse.getText().replaceAll("[\u0640]", "").split("[ ]");
          int maxWordPerRequest=wordNo+WORD_COUNT_PER_REQUEST;
View Full Code Here


  @SuppressWarnings("unchecked")
  private Chapter getChapter(PersistenceManager pm, int chapterNo) {
    try {
      String query = "select from " + Chapter.class.getName() + " where chapterNo==" + chapterNo;
      Chapter result=((Collection<Chapter>) pm.newQuery(query)
          .execute()).iterator().next();
      return result;
    } catch (NoSuchElementException e) {
      return null;
    }
View Full Code Here

           ,{111,1,5}
           ,{112,1,4}
           ,{113,1,5}
           ,{114,1,6}};
        for (int i=1;i<chapterSize.length;i++) {
          Chapter chapter=getChapter(pm, i);
          if (null==chapter) {
            chapter=new Chapter();
          }
          chapter.setChapterNo(i);
          chapter.setStartVerse(1);
          chapter.setEndVerse(chapterSize[i]);
          chapter.setTitel(getTanzilChapterName(i));
          chapter.setTransliteration(getTanzilChapterTransliteration(i));
          pm.makePersistent(chapter);
          initialChapterMap.put(i,chapter);
        }
        for (int i=0;i<sections.length;i++) {
          int[] sectionData=sections[i];
          Chapter chapter=initialChapterMap.get(sectionData[0]);
          Section section = chapter.getSection(sectionData[1]);
          if (null==section) {
            section=new Section();
            chapter.addSection(section);
          }
          section.setSectionNo(i);
          section.setChapterNo(chapter.getChapterNo());
          section.setStartVerse(sectionData[1]);
          section.setEndVerse(sectionData[2]);
          pm.makePersistent(section);
        }
      }
      Chapter chapter=initialChapterMap.get(start);
      if (null==chapter)
        return -1;
    } finally {
      pm.close();
    }
View Full Code Here

TOP

Related Classes of qurtext.domain.Chapter

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.