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


Java TIntArrayList.remove方法代码示例

本文整理汇总了Java中gnu.trove.TIntArrayList.remove方法的典型用法代码示例。如果您正苦于以下问题:Java TIntArrayList.remove方法的具体用法?Java TIntArrayList.remove怎么用?Java TIntArrayList.remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gnu.trove.TIntArrayList的用法示例。


在下文中一共展示了TIntArrayList.remove方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setDocumentFeatureFrequency

import gnu.trove.TIntArrayList; //导入方法依赖的package包/类
public void setDocumentFeatureFrequency(int document, int feature, int frequency) {
    if (document >= 0) {
        int size = _contentDB._documentsFeatures.size();
        if (document >= size) {
            for (int i = size; i <= document; ++i) {
                _contentDB._documentsFeatures.add(new TIntArrayList());
                _contentDB._documentsFrequencies.add(new TIntArrayList());
            }
        }
        if (feature >= 0) {
            TIntArrayList feats = _contentDB._documentsFeatures.get(document);
            TIntArrayList freqs = _contentDB._documentsFrequencies.get(document);
            int pos = feats.binarySearch(feature);
            if (pos < 0 && frequency > 0) {
                pos = -pos - 1;
                feats.insert(pos, feature);
                freqs.insert(pos, frequency);
            } else {
                if (frequency > 0) {
                    freqs.setQuick(pos, frequency);
                } else {
                    feats.remove(pos);
                    freqs.remove(pos);
                }
            }
        }
    }
}
 
开发者ID:jatecs,项目名称:jatecs,代码行数:29,代码来源:TroveContentDBBuilder.java

示例2: setDocumentFeatureFrequency

import gnu.trove.TIntArrayList; //导入方法依赖的package包/类
public void setDocumentFeatureFrequency(int document, int feature,
                                        int frequency) {
    if (feature >= 0) {
        int size = _contentDB._featuresDocuments.size();
        if (feature >= size) {
            for (int i = size; i <= feature; ++i) {
                _contentDB._featuresDocuments.add(new TIntArrayList());
                _contentDB._featuresFrequencies.add(new TIntArrayList());
            }
        }
        if (document >= 0) {
            TIntArrayList docs = _contentDB._featuresDocuments.get(feature);
            TIntArrayList freqs = _contentDB._featuresFrequencies
                    .get(feature);
            int pos = docs.binarySearch(document);
            if (pos < 0 && frequency > 0) {
                pos = -pos - 1;
                docs.insert(pos, document);
                freqs.insert(pos, frequency);
            } else {
                if (frequency > 0) {
                    freqs.setQuick(pos, frequency);
                } else {
                    docs.remove(pos);
                    freqs.remove(pos);
                }
            }
        }
    }
}
 
开发者ID:jatecs,项目名称:jatecs,代码行数:31,代码来源:TroveContentILDBBuilder.java

示例3: removeFromMultiMap

import gnu.trove.TIntArrayList; //导入方法依赖的package包/类
private void removeFromMultiMap(int key, int value) {
  final TIntObjectHashMap<TIntArrayList> map = myMultipleValuesMap;
  if (map == null) return;
  TIntArrayList list = map.get(key);
  if (list != null) {
    int offset = list.indexOf(value);
    if (offset != -1) {
      list.remove(offset);
      if (list.isEmpty()) {
        map.remove(key);
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:SmartIntToIntArrayMap.java

示例4: removeFeatures

import gnu.trove.TIntArrayList; //导入方法依赖的package包/类
public void removeFeatures(IIntIterator removedFeatures) {
    for (int i = 0; i < _documentsFeatures.size(); ++i) {
        TIntArrayList feats = _documentsFeatures.get(i);
        TIntArrayList freqs = _documentsFrequencies.get(i);
        int j = 0;
        int shift = 0;
        int feat;
        int rem;
        if (j < feats.size() && removedFeatures.hasNext()) {
            feat = feats.getQuick(j);
            rem = removedFeatures.next();

            while (true) {
                if (feat == rem) {
                    feats.remove(j);
                    freqs.remove(j);
                    if (j < feats.size() && removedFeatures.hasNext()) {
                        feat = feats.getQuick(j);
                        rem = removedFeatures.next();
                        ++shift;
                    } else
                        break;
                } else if (feat > rem) {
                    if (removedFeatures.hasNext()) {
                        rem = removedFeatures.next();
                        ++shift;
                    } else
                        break;
                } else {
                    feats.setQuick(j, feat - shift);
                    ++j;
                    if (j < feats.size())
                        feat = feats.getQuick(j);
                    else
                        break;
                }
            }
            ++shift;
        }

        while (j < feats.size()) {
            feats.setQuick(j, feats.getQuick(j) - shift);
            ++j;
        }
        removedFeatures.begin();
    }
    _documentLenghts.clear();
    _featureDocumentsCount.clear();
}
 
开发者ID:jatecs,项目名称:jatecs,代码行数:50,代码来源:TroveContentDB.java

示例5: removeDocuments

import gnu.trove.TIntArrayList; //导入方法依赖的package包/类
public void removeDocuments(IIntIterator removedDocuments) {
    for (int i = 0; i < _categoriesDocuments.size(); ++i) {
        TIntArrayList docs = _categoriesDocuments.get(i);
        Vector<Boolean> docsPrimary = _categoriesDocumentsPrimary.get(i);
        int j = 0;
        int shift = 0;
        int doc;
        int rem;
        if (j < docs.size() && removedDocuments.hasNext()) {
            doc = docs.getQuick(j);
            rem = removedDocuments.next();

            while (true) {
                if (doc == rem) {
                    docs.remove(j);
                    docsPrimary.remove(j);
                    if (j < docs.size() && removedDocuments.hasNext()) {
                        doc = docs.getQuick(j);
                        rem = removedDocuments.next();
                        ++shift;
                    } else
                        break;
                } else if (doc > rem) {
                    if (removedDocuments.hasNext()) {
                        rem = removedDocuments.next();
                        ++shift;
                    } else
                        break;
                } else {
                    docs.setQuick(j, doc - shift);
                    ++j;
                    if (j < docs.size())
                        doc = docs.getQuick(j);
                    else
                        break;
                }
            }
            ++shift;
        }
        while (j < docs.size()) {
            docs.setQuick(j, docs.getQuick(j) - shift);
            ++j;
        }
        removedDocuments.begin();
    }
}
 
开发者ID:jatecs,项目名称:jatecs,代码行数:47,代码来源:TroveClassificationILDB.java

示例6: removeFeatures

import gnu.trove.TIntArrayList; //导入方法依赖的package包/类
public void removeFeatures(IIntIterator removedFeatures) {
    for (int i = 0; i < _documentsWeights.size(); ++i) {
        TIntDoubleHashMap weigs = _documentsWeights.get(i);
        TIntArrayList feats = new TIntArrayList(weigs.size());
        TDoubleArrayList weigths = new TDoubleArrayList(weigs.size());
        TIntDoubleIterator wit = weigs.iterator();
        while (wit.hasNext()) {
            wit.advance();
            feats.add(wit.key());
            weigths.add(wit.value());
        }
        int j = 0;
        int shift = 0;
        int feat;
        int rem;
        if (j < feats.size() && removedFeatures.hasNext()) {
            feat = feats.getQuick(j);
            rem = removedFeatures.next();

            while (true) {
                if (feat == rem) {
                    feats.remove(j);
                    weigths.remove(j);
                    if (j < feats.size() && removedFeatures.hasNext()) {
                        feat = feats.getQuick(j);
                        rem = removedFeatures.next();
                        ++shift;
                    } else
                        break;
                } else if (feat > rem) {
                    if (removedFeatures.hasNext()) {
                        rem = removedFeatures.next();
                        ++shift;
                    } else
                        break;
                } else {
                    feats.setQuick(j, feat - shift);
                    ++j;
                    if (j < feats.size())
                        feat = feats.getQuick(j);
                    else
                        break;
                }
            }
            ++shift;
        }
        while (j < feats.size()) {
            feats.setQuick(j, feats.getQuick(j) - shift);
            ++j;
        }

        weigs.clear();
        for (j = 0; j < feats.size(); ++j)
            weigs.put(feats.getQuick(j), weigths.getQuick(j));

        removedFeatures.begin();
    }
}
 
开发者ID:jatecs,项目名称:jatecs,代码行数:59,代码来源:TroveWeightingDB.java

示例7: removeFeatures

import gnu.trove.TIntArrayList; //导入方法依赖的package包/类
public void removeFeatures(IIntIterator removedFeatures) {
    for (int i = 0; i < _categoriesFeatures.size(); ++i) {
        TIntArrayList feats = _categoriesFeatures.get(i);
        int j = 0;
        int shift = 0;
        int feat;
        int rem;
        if (j < feats.size() && removedFeatures.hasNext()) {
            feat = feats.getQuick(j);
            rem = removedFeatures.next();

            while (true) {
                if (feat == rem) {
                    feats.remove(j);
                    if (j < feats.size() && removedFeatures.hasNext()) {
                        feat = feats.getQuick(j);
                        rem = removedFeatures.next();
                        ++shift;
                    } else
                        break;
                } else if (feat > rem) {
                    if (removedFeatures.hasNext()) {
                        rem = removedFeatures.next();
                        ++shift;
                    } else
                        break;
                } else {
                    feats.setQuick(j, feat - shift);
                    ++j;
                    if (j < feats.size())
                        feat = feats.getQuick(j);
                    else
                        break;
                }
            }
        }
        while (j < feats.size()) {
            feats.setQuick(j, feats.getQuick(j) - shift);
            ++j;
        }
        removedFeatures.begin();
    }
}
 
开发者ID:jatecs,项目名称:jatecs,代码行数:44,代码来源:TroveDomainDB.java

示例8: removeDocuments

import gnu.trove.TIntArrayList; //导入方法依赖的package包/类
public void removeDocuments(IIntIterator removedDocuments) {
    for (int i = 0; i < _featuresDocuments.size(); ++i) {
        TIntArrayList docs = _featuresDocuments.get(i);
        TIntArrayList freqs = _featuresFrequencies.get(i);
        int j = 0;
        int shift = 0;
        int doc;
        int rem;
        if (j < docs.size() && removedDocuments.hasNext()) {
            doc = docs.getQuick(j);
            rem = removedDocuments.next();

            while (true) {
                if (doc == rem) {
                    docs.remove(j);
                    freqs.remove(j);
                    if (j < docs.size() && removedDocuments.hasNext()) {
                        doc = docs.getQuick(j);
                        rem = removedDocuments.next();
                        ++shift;
                    } else
                        break;
                } else if (doc > rem) {
                    if (removedDocuments.hasNext()) {
                        rem = removedDocuments.next();
                        ++shift;
                    } else
                        break;
                } else {
                    docs.setQuick(j, doc - shift);
                    ++j;
                    if (j < docs.size())
                        doc = docs.getQuick(j);
                    else
                        break;
                }
            }
            ++shift;
        }
        while (j < docs.size()) {
            docs.setQuick(j, docs.getQuick(j) - shift);
            ++j;
        }
        removedDocuments.begin();
    }
    removedDocuments.begin();
    while (removedDocuments.hasNext()) {
        int document = removedDocuments.next();
        _documentFeaturesCount.remove(document);
        _documentLenghts.remove(document);
    }

}
 
开发者ID:jatecs,项目名称:jatecs,代码行数:54,代码来源:TroveContentILDB.java

示例9: removeFeatures

import gnu.trove.TIntArrayList; //导入方法依赖的package包/类
public void removeFeatures(IIntIterator removedFeatures) {
    int shift = 0;
    while (removedFeatures.hasNext()) {
        int feature = removedFeatures.next() - shift;
        _featuresDocuments.remove(feature);
        _featuresFrequencies.remove(feature);
        ++shift;
    }
    removedFeatures.begin();
    for (int i = 0; i < _documentsFeatures.size(); ++i) {
        TIntArrayList feats = _documentsFeatures.get(i);
        TIntArrayList freqs = _documentsFrequencies.get(i);
        int j = 0;
        shift = 0;
        int feat;
        int rem;
        if (j < feats.size() && removedFeatures.hasNext()) {
            feat = feats.getQuick(j);
            rem = removedFeatures.next();

            while (true) {
                if (feat == rem) {
                    feats.remove(j);
                    freqs.remove(j);
                    if (j < feats.size() && removedFeatures.hasNext()) {
                        feat = feats.getQuick(j);
                        rem = removedFeatures.next();
                        ++shift;
                    } else
                        break;
                } else if (feat > rem) {
                    if (removedFeatures.hasNext()) {
                        rem = removedFeatures.next();
                        ++shift;
                    } else
                        break;
                } else {
                    feats.setQuick(j, feat - shift);
                    ++j;
                    if (j < feats.size())
                        feat = feats.getQuick(j);
                    else
                        break;
                }
            }
            ++shift;
        }
        while (j < feats.size()) {
            feats.setQuick(j, feats.getQuick(j) - shift);
            ++j;
        }
        removedFeatures.begin();
    }
    _documentLenghts.clear();
}
 
开发者ID:jatecs,项目名称:jatecs,代码行数:56,代码来源:TroveContentFullDB.java


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