當前位置: 首頁>>代碼示例>>Java>>正文


Java NumericUtils.prefixCodedToLong方法代碼示例

本文整理匯總了Java中org.apache.lucene.util.NumericUtils.prefixCodedToLong方法的典型用法代碼示例。如果您正苦於以下問題:Java NumericUtils.prefixCodedToLong方法的具體用法?Java NumericUtils.prefixCodedToLong怎麽用?Java NumericUtils.prefixCodedToLong使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.lucene.util.NumericUtils的用法示例。


在下文中一共展示了NumericUtils.prefixCodedToLong方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: toObject

import org.apache.lucene.util.NumericUtils; //導入方法依賴的package包/類
@Override
public Object toObject(SchemaField sf, BytesRef term) {
  switch (type) {
    case INTEGER:
      return NumericUtils.prefixCodedToInt(term);
    case FLOAT:
      return NumericUtils.sortableIntToFloat(NumericUtils.prefixCodedToInt(term));
    case LONG:
      return NumericUtils.prefixCodedToLong(term);
    case DOUBLE:
      return NumericUtils.sortableLongToDouble(NumericUtils.prefixCodedToLong(term));
    case DATE:
      return new Date(NumericUtils.prefixCodedToLong(term));
    default:
      throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Unknown type for trie field: " + type);
  }
}
 
開發者ID:europeana,項目名稱:search,代碼行數:18,代碼來源:TrieField.java

示例2: next

import org.apache.lucene.util.NumericUtils; //導入方法依賴的package包/類
public Long next() throws IOException {
    final BytesRef term = termsEnum.next();
    if (term == null) {
        return null;
    }
    if (termEncoding == GeoPointField.TermEncoding.PREFIX) {
        return GeoEncodingUtils.prefixCodedToGeoCoded(term);
    } else if (termEncoding == GeoPointField.TermEncoding.NUMERIC) {
        return NumericUtils.prefixCodedToLong(term);
    }
    throw new IllegalArgumentException("GeoPoint.TermEncoding should be one of: " + GeoPointField.TermEncoding.PREFIX
        + " or " + GeoPointField.TermEncoding.NUMERIC + " found: " + termEncoding);
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:14,代碼來源:AbstractIndexGeoPointFieldData.java

示例3: parseLong

import org.apache.lucene.util.NumericUtils; //導入方法依賴的package包/類
@Override
public long parseLong(BytesRef term) {
  return NumericUtils.prefixCodedToLong(term);
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:5,代碼來源:FieldCache.java

示例4: toLong

import org.apache.lucene.util.NumericUtils; //導入方法依賴的package包/類
@Override
public long toLong(BytesRef indexForm) {
    return NumericUtils.prefixCodedToLong(indexForm);
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:5,代碼來源:IndexNumericFieldData.java

示例5: toNumber

import org.apache.lucene.util.NumericUtils; //導入方法依賴的package包/類
@Override
public Number toNumber(BytesRef indexForm) {
    return NumericUtils.prefixCodedToLong(indexForm);
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:5,代碼來源:IndexNumericFieldData.java

示例6: getFileSystemObject

import org.apache.lucene.util.NumericUtils; //導入方法依賴的package包/類
/**
 * Gets the file system objects from the database.
 * 
 * @param document - document containing the information
 * @return the file system object loaded from the database.
 */
private  FileSystem getFileSystemObject(Document document)
{
	FileSystem fileSystem = null;
	String type = document.get(DefaultUserWorkspaceIndexService.TYPE);
	log.debug("The type = " + type);
	log.debug("Personal file type " + FileSystemType.PERSONAL_FILE.getType());
	log.debug(" equals personal file " + type.equals(FileSystemType.PERSONAL_FILE.getType()));
	
	if( type.equals(FileSystemType.PERSONAL_FILE.getType()) )
	{
		log.debug( "personal file id = " + document.get(DefaultUserWorkspaceIndexService.PERSONAL_FILE_ID));
		Long personalFileId = NumericUtils.prefixCodedToLong(document.get(DefaultUserWorkspaceIndexService.PERSONAL_FILE_ID));
		fileSystem = userFileSystemService.getPersonalFile(personalFileId, false);
	}
	if( type.equals(FileSystemType.PERSONAL_FOLDER.getType()))
	{
		log.debug( "personal folder id = " + document.get(DefaultUserWorkspaceIndexService.PERSONAL_FOLDER_ID));
		Long personalFolderId = NumericUtils.prefixCodedToLong(document.get(DefaultUserWorkspaceIndexService.PERSONAL_FOLDER_ID));
		fileSystem = userFileSystemService.getPersonalFolder(personalFolderId, false);
	}
	if( type.equals(FileSystemType.SHARED_INBOX_FILE.getType()))
	{
		log.debug( "inbox file id = " + document.get(DefaultUserWorkspaceIndexService.SHARED_INBOX_FILE_ID));
		Long inboxFileId = NumericUtils.prefixCodedToLong(document.get(DefaultUserWorkspaceIndexService.SHARED_INBOX_FILE_ID));
		fileSystem = userFileSystemService.getSharedInboxFile(inboxFileId, false);
	}
	if( type.equals(FileSystemType.PERSONAL_ITEM.getType()))
	{
		log.debug( "personal id = " + document.get(DefaultUserWorkspaceIndexService.PERSONAL_ITEM_ID));
		Long personalItemId = NumericUtils.prefixCodedToLong(document.get(DefaultUserWorkspaceIndexService.PERSONAL_ITEM_ID));
		fileSystem = userPublishingFileSystemService.getPersonalItem(personalItemId, false);
	}
	if( type.equals(FileSystemType.PERSONAL_COLLECTION.getType()))
	{
		log.debug( "personal collection id = " + document.get(DefaultUserWorkspaceIndexService.PERSONAL_COLLECTION_ID));
		Long personalCollectionId = NumericUtils.prefixCodedToLong(document.get(DefaultUserWorkspaceIndexService.PERSONAL_COLLECTION_ID));
		fileSystem = userPublishingFileSystemService.getPersonalCollection(personalCollectionId, false);
	}
	if( type.equals(FileSystemType.GROUP_WORKSPACE_FILE.getType()) )
	{
		log.debug( "group workspace file id = " + document.get(DefaultUserWorkspaceIndexService.GROUP_WORKSPACE_FILE_ID));
		Long groupWorkspaceFileId = NumericUtils.prefixCodedToLong(document.get(DefaultUserWorkspaceIndexService.GROUP_WORKSPACE_FILE_ID));
		fileSystem = groupWorkspaceFileSystemService.getFile(groupWorkspaceFileId, false);
	}
	if( type.equals(FileSystemType.GROUP_WORKSPACE_FOLDER.getType()))
	{
		log.debug( "group workspace folder id = " + document.get(DefaultUserWorkspaceIndexService.GROUP_WORKSPACE_FOLDER_ID));
		Long groupWorkspaceFolderId = NumericUtils.prefixCodedToLong(document.get(DefaultUserWorkspaceIndexService.GROUP_WORKSPACE_FOLDER_ID));
		fileSystem = groupWorkspaceFileSystemService.getFolder(groupWorkspaceFolderId, false);
	}

	
	return fileSystem;
}
 
開發者ID:nate-rcl,項目名稱:irplus,代碼行數:61,代碼來源:DefaultUserWorkspaceSearchService.java

示例7: stringToMoney

import org.apache.lucene.util.NumericUtils; //導入方法依賴的package包/類
/**
 * 將s轉換成long,再轉換成BigDecimal,除以1000。
 * 
 * @param s
 * @return
 */
public static BigDecimal stringToMoney(String s) {
	BigDecimal number = new BigDecimal(NumericUtils.prefixCodedToLong(s));
	return number.divide(MULTIPLE);
}
 
開發者ID:huanzhou,項目名稱:jeecms6,代碼行數:11,代碼來源:MoneyTools.java


注:本文中的org.apache.lucene.util.NumericUtils.prefixCodedToLong方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。