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


Java TIntIterator類代碼示例

本文整理匯總了Java中gnu.trove.iterator.TIntIterator的典型用法代碼示例。如果您正苦於以下問題:Java TIntIterator類的具體用法?Java TIntIterator怎麽用?Java TIntIterator使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: toString

import gnu.trove.iterator.TIntIterator; //導入依賴的package包/類
@Override
	public String toString() {
		StringBuilder outputBuilder = new StringBuilder();
		outputBuilder.append("{");

		for(TEquivalence entry : this) {
			outputBuilder.append("{");
			for (TIntIterator valueIt=entry.iterator(); valueIt.hasNext(); ) {
//			for (TIntIteratorInteger value : entry) {
				outputBuilder.append(valueIt.next());
				outputBuilder.append(",");
			}
			outputBuilder.append("}");
		}
		outputBuilder.append("}");

		return outputBuilder.toString();
	}
 
開發者ID:HPI-Information-Systems,項目名稱:metanome-algorithms,代碼行數:19,代碼來源:StrippedPartition.java

示例2: toString

import gnu.trove.iterator.TIntIterator; //導入依賴的package包/類
@Override
public String toString() {
	StringBuilder outputBuilder = new StringBuilder();
	outputBuilder.append(String.format("[%s]{", this.indices));

	for(TEquivalence equivalenceGroup : this) {
		outputBuilder.append("{");
		for (TIntIterator valueIt=equivalenceGroup.iterator(); valueIt.hasNext(); ) {
			outputBuilder.append(valueIt.next());
			outputBuilder.append(",");
		}
		outputBuilder.append("}");
	}
	outputBuilder.append("}");

	return outputBuilder.toString();
}
 
開發者ID:HPI-Information-Systems,項目名稱:metanome-algorithms,代碼行數:18,代碼來源:Partition.java

示例3: refineBy

import gnu.trove.iterator.TIntIterator; //導入依賴的package包/類
public Collection<Partition> refineBy(int target) {
	HashMap<Cluster, Partition> map = new HashMap<Cluster, Partition>();
	for(TIntIterator iter = array.iterator(); iter.hasNext();) {
		int next = iter.next();
		Cluster c = StrippedPartition.clusters.get(next)[target];
		if(c == null) {
			continue;
		}
		if(map.containsKey(c)) {
			map.get(c).add(next);
		} else {
			Partition p = new Partition();
			p.add(next);
			map.put(c, p);
		}
	}
	return map.values();
}
 
開發者ID:HPI-Information-Systems,項目名稱:metanome-algorithms,代碼行數:19,代碼來源:Partition.java

示例4: materials

import gnu.trove.iterator.TIntIterator; //導入依賴的package包/類
public Iterable<MaterialData> materials() {
    return new Iterable<MaterialData>() {
        @Override
        public Iterator<MaterialData> iterator() {
            return new Iterator<MaterialData>() {
                final TIntIterator iter = counts.keySet().iterator();

                @Override
                public boolean hasNext() {
                    return iter.hasNext();
                }

                @Override
                public MaterialData next() {
                    return decodeMaterial(iter.next());
                }

                @Override
                public void remove() {
                    iter.remove();
                }
            };
        }
    };
}
 
開發者ID:OvercastNetwork,項目名稱:ProjectAres,代碼行數:26,代碼來源:MaterialCounter.java

示例5: removeAll

import gnu.trove.iterator.TIntIterator; //導入依賴的package包/類
/** {@inheritDoc} */
public boolean removeAll( TIntCollection collection ) {
    if ( this == collection ) {
        clear();
        return true;
    }
    boolean changed = false;
    TIntIterator iter = collection.iterator();
    while ( iter.hasNext() ) {
        int element = iter.next();
        if ( remove( element ) ) {
            changed = true;
        }
    }
    return changed;
}
 
開發者ID:JianpingZeng,項目名稱:xcc,代碼行數:17,代碼來源:TObjectIntHashMap.java

示例6: removeAll

import gnu.trove.iterator.TIntIterator; //導入依賴的package包/類
/** {@inheritDoc} */
public boolean removeAll( TIntCollection collection ) {
    if ( collection == this ) {
        clear();
        return true;
    }
    boolean changed = false;
    TIntIterator iter = collection.iterator();
    while ( iter.hasNext() ) {
        int element = iter.next();
        if ( remove( element ) ) {
            changed = true;
        }
    }
    return changed;
}
 
開發者ID:JianpingZeng,項目名稱:xcc,代碼行數:17,代碼來源:TIntObjectHashMap.java

示例7: equals

import gnu.trove.iterator.TIntIterator; //導入依賴的package包/類
@Override
public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    TIntLinkedList that = (TIntLinkedList) o;

    if (no_entry_value != that.no_entry_value) return false;
    if (size != that.size) return false;

    TIntIterator iterator = iterator();
    TIntIterator thatIterator = that.iterator();
    while (iterator.hasNext()) {
        if (!thatIterator.hasNext())
            return false;

        if (iterator.next() != thatIterator.next())
            return false;
    }

    return true;
}
 
開發者ID:JianpingZeng,項目名稱:xcc,代碼行數:23,代碼來源:TIntLinkedList.java

示例8: iterator

import gnu.trove.iterator.TIntIterator; //導入依賴的package包/類
/**
 * Creates an iterator over the values of the set.
 *
 * @return an iterator with support for removals in the underlying set
 */
public Iterator<Integer> iterator() {
    return new Iterator<Integer>() {
        private final TIntIterator it = _set.iterator();

        public Integer next() {
            return Integer.valueOf( it.next() );
        }

        public boolean hasNext() {
            return it.hasNext();
        }

        public void remove() {
            it.remove();
        }
    };
}
 
開發者ID:funkemunky,項目名稱:HCFCore,代碼行數:23,代碼來源:TIntSetDecorator.java

示例9: ProbeTable

import gnu.trove.iterator.TIntIterator; //導入依賴的package包/類
public ProbeTable(Partition partition) {
		// set the no entry key and no entry value to something recognizable
		super(partition.size(), 2, -1, -1);
		// The probe table maps each tuple index to the index of the equivalence class it belongs to
		for (TEquivalence equivalenceGroup : partition) {
			int groupIdentifier = equivalenceGroup.getIdentifier();
			for (TIntIterator groupValueIt=equivalenceGroup.iterator(); groupValueIt.hasNext(); ) {
//			for (Integer groupValue : equivalenceGroup) {
				this.put(groupValueIt.next(), groupIdentifier);
			}
		}
	}
 
開發者ID:HPI-Information-Systems,項目名稱:metanome-algorithms,代碼行數:13,代碼來源:ProbeTable.java

示例10: retainAll

import gnu.trove.iterator.TIntIterator; //導入依賴的package包/類
public boolean retainAll( TIntCollection collection ) {
    if ( this == collection ) {
        return false;
    }
    boolean modified = false;
    TIntIterator iter = iterator();
    while ( iter.hasNext() ) {
        if ( ! collection.contains( iter.next() ) ) {
            iter.remove();
            modified = true;
        }
    }
    return modified;
}
 
開發者ID:funkemunky,項目名稱:HCFCore,代碼行數:15,代碼來源:TIntObjectHashMap.java

示例11: removeAll

import gnu.trove.iterator.TIntIterator; //導入依賴的package包/類
/** {@inheritDoc} */
public boolean removeAll(int[] array) {
    Arrays.sort(array);

    boolean modified = false;
    TIntIterator iter = iterator();
    while (iter.hasNext()) {
        if (Arrays.binarySearch(array, iter.next()) >= 0) {
            iter.remove();
            modified = true;
        }
    }
    return modified;
}
 
開發者ID:funkemunky,項目名稱:HCFCore,代碼行數:15,代碼來源:TIntLinkedList.java

示例12: containsAll

import gnu.trove.iterator.TIntIterator; //導入依賴的package包/類
/** {@inheritDoc} */
public boolean containsAll( TIntCollection collection ) {
    TIntIterator iter = collection.iterator();
    while ( iter.hasNext() ) {
        if ( ! TObjectIntHashMap.this.containsValue( iter.next() ) ) {
            return false;
        }
    }
    return true;
}
 
開發者ID:funkemunky,項目名稱:HCFCore,代碼行數:11,代碼來源:TObjectIntHashMap.java

示例13: buildCoalscingEdgeCosts

import gnu.trove.iterator.TIntIterator; //導入依賴的package包/類
private PBQPMatrix buildCoalscingEdgeCosts(
        TIntArrayList allowedReg1,
        TIntArrayList allowedReg2, double cost)
{
    PBQPMatrix m = new PBQPMatrix(allowedReg1.size()+1, allowedReg2.size()+1);
    boolean isAllZero = true;

    int i = 1;
    for (TIntIterator itr = allowedReg1.iterator(); itr.hasNext(); )
    {
        int j = 1;
        int reg1 = itr.next();
        for (TIntIterator itr2 = allowedReg2.iterator(); itr2.hasNext(); )
        {
            if (reg1 == itr2.next())
            {
                m.set(i, j, -cost);
                isAllZero = false;
            }
            j++;
        }
        i++;
    }
    if (isAllZero)
        return null;
    return m;
}
 
開發者ID:JianpingZeng,項目名稱:xcc,代碼行數:28,代碼來源:RegAllocPBQP.java

示例14: buildInterferenceEdgeCosts

import gnu.trove.iterator.TIntIterator; //導入依賴的package包/類
private PBQPMatrix buildInterferenceEdgeCosts(
        TIntArrayList allowedReg1,
        TIntArrayList allowedReg2)
{
    PBQPMatrix m = new PBQPMatrix(allowedReg1.size()+1, allowedReg2.size()+1);
    boolean isAllZero = true;

    int i = 1;
    for (TIntIterator itr = allowedReg1.iterator(); itr.hasNext(); )
    {
        int j = 1;
        int reg1 = itr.next();
        for (TIntIterator itr2 = allowedReg2.iterator(); itr2.hasNext(); )
        {
            // If the row/column regs are identical or alias insert an infinity.
            int reg2 = itr2.next();
            if (tri.regsOverlap(reg1, reg2))
            {
                m.set(i, j, Double.MAX_VALUE);
                isAllZero = false;
            }
            j++;
        }
        i++;
    }
    if (isAllZero)
        return null;
    return m;
}
 
開發者ID:JianpingZeng,項目名稱:xcc,代碼行數:30,代碼來源:RegAllocPBQP.java

示例15: retainAll

import gnu.trove.iterator.TIntIterator; //導入依賴的package包/類
/** {@inheritDoc} */
@SuppressWarnings({"SuspiciousMethodCalls"})
public boolean retainAll( Collection<?> collection ) {
    boolean modified = false;
    TIntIterator iter = iterator();
    while ( iter.hasNext() ) {
        if ( ! collection.contains( Integer.valueOf ( iter.next() ) ) ) {
            iter.remove();
            modified = true;
        }
    }
    return modified;
}
 
開發者ID:JianpingZeng,項目名稱:xcc,代碼行數:14,代碼來源:TObjectIntHashMap.java


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