当前位置: 首页>>代码示例>>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;未经允许,请勿转载。