本文整理汇总了Java中gnu.trove.iterator.hash.TObjectHashIterator类的典型用法代码示例。如果您正苦于以下问题:Java TObjectHashIterator类的具体用法?Java TObjectHashIterator怎么用?Java TObjectHashIterator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TObjectHashIterator类属于gnu.trove.iterator.hash包,在下文中一共展示了TObjectHashIterator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: load
import gnu.trove.iterator.hash.TObjectHashIterator; //导入依赖的package包/类
public void load(String in) throws IOException{
int begin = in.lastIndexOf("\\");
int idx = in.indexOf('-',begin);
if(idx==-1)
idx = in.indexOf('.',begin);
if(idx==-1)
idx = in.length();
String pos = in.substring(begin+1,idx);
THashSet<String> set = MyCollection.loadTSet(in);
TObjectHashIterator<String> it = set.iterator();
while(it.hasNext()){
String s = it.next();
s = s.replaceAll("(\\s| | |\\t)+", "");
if(s.length()==0)
continue;
add(pos, s);
String ss = filter(pos,s);
if(ss!=null){
add(pos,ss);
}
}
}
示例2: iterator
import gnu.trove.iterator.hash.TObjectHashIterator; //导入依赖的package包/类
@SuppressWarnings({"unchecked"})
public Iterator<V> iterator() {
return new TObjectHashIterator( TCustomHashMap.this ) {
protected V objectAtIndex( int index ) {
return _values[index];
}
};
}
示例3: iterator
import gnu.trove.iterator.hash.TObjectHashIterator; //导入依赖的package包/类
@SuppressWarnings({"unchecked"})
public Iterator<V> iterator() {
return new TObjectHashIterator(THashMap.this) {
protected V objectAtIndex(int index) {
return _values[index];
}
};
}
示例4: iterator
import gnu.trove.iterator.hash.TObjectHashIterator; //导入依赖的package包/类
@SuppressWarnings({"unchecked", "rawtypes"})
@Override
public Iterator<V> iterator() {
return new TObjectHashIterator( TCustomHashMap.this ) {
@Override
protected V objectAtIndex( int index ) {
return _values[index];
}
};
}
示例5: iterator
import gnu.trove.iterator.hash.TObjectHashIterator; //导入依赖的package包/类
@Override
@SuppressWarnings({"unchecked", "rawtypes"})
public Iterator<V> iterator() {
return new TObjectHashIterator(THashMap.this) {
@Override
protected V objectAtIndex(int index) {
return _values[index];
}
};
}
示例6: iterator
import gnu.trove.iterator.hash.TObjectHashIterator; //导入依赖的package包/类
@SuppressWarnings({"unchecked"})
public Iterator<V> iterator() {
return new TObjectHashIterator( THashMap.this ) {
protected V objectAtIndex( int index ) {
return _values[index];
}
};
}
示例7: load
import gnu.trove.iterator.hash.TObjectHashIterator; //导入依赖的package包/类
/**
* 从文件中读取
* @param path 文件路径
* @param tag 词典名
* @throws IOException
*/
public void load(String path,String tag) throws IOException{
if(path == null) return;
dict = MyCollection.loadTSet(path);
maxLen = 0;
TObjectHashIterator<String> it = dict.iterator();
while(it.hasNext()){
String k = it.next();
if(k.length()>maxLen){
maxLen = k.length();
}
}
name = tag;
}
示例8: calc
import gnu.trove.iterator.hash.TObjectHashIterator; //导入依赖的package包/类
public float calc(THashSet<Object> s1, THashSet<Object> s2) {
int com = 0;
if (s1 == null || s2 == null)
return 0;
TObjectHashIterator<Object> it = s1.iterator();
for ( int i = s1.size(); i-- > 0; ) {
Object v = it.next();
if(s2.contains(v))
com++;
}
float sim = ((float) com)/(s1.size()+s2.size()-com);
return sim;
}
示例9: TSet2List
import gnu.trove.iterator.hash.TObjectHashIterator; //导入依赖的package包/类
public static void TSet2List(THashSet<String> newset, ArrayList<String> al) {
TObjectHashIterator<String> it = newset.iterator();
while(it.hasNext()){
String s = it.next();
al.add(s);
}
}
示例10: getLength
import gnu.trove.iterator.hash.TObjectHashIterator; //导入依赖的package包/类
public static int getLength(THashSet<String> set) {
int i = 0;
TObjectHashIterator<String> it = set.iterator();
while(it.hasNext()){
String s = it.next();
if(s.length()>i)
i=s.length();
}
return i;
}
示例11: iterator
import gnu.trove.iterator.hash.TObjectHashIterator; //导入依赖的package包/类
@SuppressWarnings({"unchecked"})
public Iterator<K> iterator() {
return new TObjectHashIterator( TObjectFloatHashMap.this );
}
示例12: iterator
import gnu.trove.iterator.hash.TObjectHashIterator; //导入依赖的package包/类
@SuppressWarnings({"unchecked"})
public Iterator<K> iterator() {
return new TObjectHashIterator( TObjectIntHashMap.this );
}
示例13: iterator
import gnu.trove.iterator.hash.TObjectHashIterator; //导入依赖的package包/类
@SuppressWarnings({"unchecked"})
public Iterator<K> iterator() {
return new TObjectHashIterator( TObjectShortHashMap.this );
}
示例14: iterator
import gnu.trove.iterator.hash.TObjectHashIterator; //导入依赖的package包/类
@SuppressWarnings({"unchecked"})
public Iterator<K> iterator() {
return new TObjectHashIterator( TObjectByteHashMap.this );
}
示例15: iterator
import gnu.trove.iterator.hash.TObjectHashIterator; //导入依赖的package包/类
@SuppressWarnings({"unchecked"})
public Iterator<K> iterator() {
return new TObjectHashIterator( TObjectDoubleHashMap.this );
}