本文整理汇总了Python中java.lang.Float方法的典型用法代码示例。如果您正苦于以下问题:Python lang.Float方法的具体用法?Python lang.Float怎么用?Python lang.Float使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.lang
的用法示例。
在下文中一共展示了lang.Float方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_multiple
# 需要导入模块: from java import lang [as 别名]
# 或者: from java.lang import Float [as 别名]
def test_multiple(self):
from java.lang import Integer, Float
self.assertIs(Integer, jclass("java.lang.Integer"))
self.assertIs(Float, jclass("java.lang.Float"))
from java.lang import Integer, Integer
self.assertIs(Integer, jclass("java.lang.Integer"))
示例2: test_float
# 需要导入模块: from java import lang [as 别名]
# 或者: from java.lang import Float [as 别名]
def test_float(self):
x = Decimal("1.1")
y = x.__tojava__(Float)
self.assertTrue(isinstance(y, Float))
示例3: __init__
# 需要导入模块: from java import lang [as 别名]
# 或者: from java.lang import Float [as 别名]
def __init__(self,
index_dir,
search_fields=['canonical_url', 'title', 'meta', 'content'],
unique_field='uq_id_str',
boost=dict(
canonical_url=4.0, title=8.0, meta=2.0, content=1.0),
date_format='%Y-%m-%dT%H:%M:%S'):
"""Constructor of Searcher.
Parameters
----------
index_dir : string
The location of lucene index.
search_fields : list
A list of field names indicating fields to search on.
unique_field : string
The field name, on which the duplication should avoid.
boost : dict
This dict control the weight when computing score.
date_format : string
Convert the string into datetime. Should consistent with the
index part.
"""
self.index_dir = index_dir
self.search_fields = search_fields
self.sort_by_recent = Sort(
SortField('date_published', SortField.Type.STRING, True))
self.store = FSDirectory.open(Paths.get(index_dir))
self.reader = DirectoryReader.open(self.store)
self.isearcher = IndexSearcher(self.reader)
self.analyzer = StandardAnalyzer()
self.boost_map = HashMap()
for k, v in boost.items():
self.boost_map.put(k, Float(v))
self.mul_parser = MultiFieldQueryParser(search_fields, self.analyzer,
self.boost_map)
self.date_format = date_format
示例4: interval
# 需要导入模块: from java import lang [as 别名]
# 或者: from java.lang import Float [as 别名]
def interval(self, key, start, end):
if isinstance(start, float):
start_value = Float(start)
else:
start_value = start
if isinstance(end, float):
end_value = Float(end)
else:
end_value = end
return self.__class__(self.pipeline.interval(key, start_value, end_value))
示例5: test_remove
# 需要导入模块: from java import lang [as 别名]
# 或者: from java.lang import Float [as 别名]
def test_remove():
assert set(g.E.weight) == {0.4000000059604645, 0.5, 1.0, 0.20000000298023224}
g.E.has("weight",Float(0.5), 'lt').remove()
assert set(g.E.weight) == {0.5, 1.0}
assert len(g.E.weight) == 3