当前位置: 首页>>代码示例>>Java>>正文


Java TObjectHashIterator类代码示例

本文整理汇总了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);
			}

		}
	}
 
开发者ID:FudanNLP,项目名称:fnlp,代码行数:26,代码来源:DictPOS.java

示例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];
        }
    };
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:9,代码来源:TCustomHashMap.java

示例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];
        }
    };
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:9,代码来源:THashMap.java

示例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];
        }
    };
}
 
开发者ID:palantir,项目名称:trove-3.0.3,代码行数:11,代码来源:TCustomHashMap.java

示例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];
        }
    };
}
 
开发者ID:palantir,项目名称:trove-3.0.3,代码行数:11,代码来源:THashMap.java

示例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];
        }
    };
}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:9,代码来源:THashMap.java

示例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;		
}
 
开发者ID:FudanNLP,项目名称:fnlp,代码行数:20,代码来源:Dictionary.java

示例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;
}
 
开发者ID:FudanNLP,项目名称:fnlp,代码行数:14,代码来源:JaccardSimilarity.java

示例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);
	}

}
 
开发者ID:FudanNLP,项目名称:fnlp,代码行数:9,代码来源:MyCollection.java

示例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;
}
 
开发者ID:FudanNLP,项目名称:fnlp,代码行数:11,代码来源:MyCollection.java

示例11: iterator

import gnu.trove.iterator.hash.TObjectHashIterator; //导入依赖的package包/类
@SuppressWarnings({"unchecked"})
public Iterator<K> iterator() {
    return new TObjectHashIterator( TObjectFloatHashMap.this );
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:5,代码来源:TObjectFloatHashMap.java

示例12: iterator

import gnu.trove.iterator.hash.TObjectHashIterator; //导入依赖的package包/类
@SuppressWarnings({"unchecked"})
public Iterator<K> iterator() {
    return new TObjectHashIterator( TObjectIntHashMap.this );
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:5,代码来源:TObjectIntHashMap.java

示例13: iterator

import gnu.trove.iterator.hash.TObjectHashIterator; //导入依赖的package包/类
@SuppressWarnings({"unchecked"})
public Iterator<K> iterator() {
    return new TObjectHashIterator( TObjectShortHashMap.this );
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:5,代码来源:TObjectShortHashMap.java

示例14: iterator

import gnu.trove.iterator.hash.TObjectHashIterator; //导入依赖的package包/类
@SuppressWarnings({"unchecked"})
public Iterator<K> iterator() {
    return new TObjectHashIterator( TObjectByteHashMap.this );
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:5,代码来源:TObjectByteHashMap.java

示例15: iterator

import gnu.trove.iterator.hash.TObjectHashIterator; //导入依赖的package包/类
@SuppressWarnings({"unchecked"})
public Iterator<K> iterator() {
    return new TObjectHashIterator( TObjectDoubleHashMap.this );
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:5,代码来源:TObjectDoubleHashMap.java


注:本文中的gnu.trove.iterator.hash.TObjectHashIterator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。