Java 类gnu.trove.map.hash.TObjectLongHashMap 实例源码

项目:demidovii    文件:NodeParameters.java   
@Override
public NodeParameters clone() {
  NodeParameters duplicate = new NodeParameters();
  if (keyMapping != null) {
    duplicate.keyMapping = new HashMap<>(this.keyMapping);
  }
  if (boolMap != null) {
    duplicate.boolMap = new TObjectByteHashMap<>(boolMap);
  }
  if (longMap != null) {
    duplicate.longMap = new TObjectLongHashMap<>(longMap);
  }
  if (doubleMap != null) {
    duplicate.doubleMap = new TObjectDoubleHashMap<>(doubleMap);
  }
  if (stringMap != null) {
    duplicate.stringMap = new HashMap<>(this.stringMap);
  }
  return duplicate;
}
项目:galago-git    文件:NodeParameters.java   
@Override
public NodeParameters clone() {
  NodeParameters duplicate = new NodeParameters();
  if (keyMapping != null) {
    duplicate.keyMapping = new HashMap<>(this.keyMapping);
  }
  if (boolMap != null) {
    duplicate.boolMap = new TObjectByteHashMap<>(boolMap);
  }
  if (longMap != null) {
    duplicate.longMap = new TObjectLongHashMap<>(longMap);
  }
  if (doubleMap != null) {
    duplicate.doubleMap = new TObjectDoubleHashMap<>(doubleMap);
  }
  if (stringMap != null) {
    duplicate.stringMap = new HashMap<>(this.stringMap);
  }
  return duplicate;
}
项目:G    文件:TxtGraphUtils.java   
public static TObjectLongHashMap loadTXT2LongGZMap(String mapFile, boolean reverse) throws IOException {
    long time = System.currentTimeMillis();
    TObjectLongHashMap idMap = new TObjectLongHashMap();
    BufferedReader br = new BufferedReader(new InputStreamReader(new GZIPInputStream(new FileInputStream(mapFile))));
    String line;
    String[] parts;

    while ((line = br.readLine()) != null) {
        parts = line.split(SEP);

        try {
            if (!reverse) {
                idMap.put(parts[1], Long.parseLong(parts[0]));
            } else {
                idMap.put(parts[0], Long.parseLong(parts[1]));
            }
        } catch (java.lang.ArrayIndexOutOfBoundsException ex) {
            logger.info(line);
            System.exit(-1);
        }
    }

    logger.info(((System.currentTimeMillis() - time) / 1000d) + "s");
    return idMap;
}
项目:sequitur    文件:Rule.java   
public TObjectLongMap<Rule<T>> getUsedRules() {
    TObjectLongMap<Rule<T>> rules = new TObjectLongHashMap<Rule<T>>(Constants.DEFAULT_CAPACITY, Constants.DEFAULT_LOAD_FACTOR, -1);

    List<Rule<T>> iteratedList = new ArrayList<Rule<T>>(32);
    List<Rule<T>> newList = new ArrayList<Rule<T>>(32);

    iteratedList.add(this);

    do {
        for (Rule<T> rule : iteratedList) {
            for (Symbol<T> sym: rule.symbols) {
                if (sym instanceof NonTerminal<?>) {
                    Rule<T> newRule = ((NonTerminal<T>)sym).getRule();
                    if (rules.adjustOrPutValue(newRule, 1, 1) == 1) // increase counter. new rule?
                        newList.add(newRule);
                }
            }
        }
        List<Rule<T>> nextNewList = iteratedList;
        iteratedList = newList;
        newList = nextNewList;
        newList.clear();
    } while (!iteratedList.isEmpty());

    return rules;
}
项目:shorthand    文件:AbstractDataMapper.java   
/**
 * {@inheritDoc}
 * @see com.heliosapm.shorthand.datamapper.IDataMapper#put(long, gnu.trove.map.hash.TObjectLongHashMap, long[])
 */
@Override
public void put(final long address, final long[] data) {
    HeaderOffset.Touch.set(address, 1);
    int enumIndex = (int)HeaderOffset.EnumIndex.get(address);
    int bitMask = (int)HeaderOffset.BitMask.get(address);
    TObjectLongHashMap<T> offsets = (TObjectLongHashMap<T>) EnumCollectors.getInstance().offsets(enumIndex, bitMask);
    if(offsets.isEmpty()) return;               
    offsets.forEachEntry(new TObjectLongProcedure<ICollector<?>>() {
        @Override
        public boolean execute(ICollector<?> collector, long offset) {
            if(!collector.isPreApply()) {
                collector.apply(address+offset, data);
            }
            return true;
        }
    });     
}
项目:ZorahPractice    文件:PlayTimeManager.java   
public PlayTimeManager() {
    this.totalPlaytimeMap = new TObjectLongHashMap<>();
    this.sessionTimestamps = new TObjectLongHashMap<>();
    this.config = new FileConfig("play-times.yml");
    this.reloadPlaytimeData();

    Bukkit.getPluginManager().registerEvents(this, PracticePlugin.getInstance());
}
项目:trove-3.0.3    文件:TObjectHashTest.java   
public static void testBug3067307() {
    TObjectLongHashMap<String> testHash = new TObjectLongHashMap<String>();
    final int c = 1000;
    for ( long i = 1; i < c; i++ ) {
        final String data = "test-" + i;
        testHash.put( data, i );
        testHash.remove( data );
    }
}
项目:trove-3.0.3    文件:TObjectHashTest.java   
public static void testBug3067307_noAutoCompact() {
    TObjectLongHashMap<String> testHash = new TObjectLongHashMap<String>();
    testHash.setAutoCompactionFactor( 0 );
    final int c = 1000;
    for ( long i = 1; i < c; i++ ) {
        final String data = "test-" + i;
        testHash.put( data, i );
        testHash.remove( data );
    }
}
项目:HeliosStreams    文件:DeltaManager.java   
/**
 * Creates a new DeltaManager
 */
private DeltaManager() {
    final int initialDeltaCapacity = ConfigurationHelper.getIntSystemThenEnvProperty(DELTA_CAPACITY, DELTA_CAPACITY_DEFAULT);
    final float initialDeltaLoadFactor = ConfigurationHelper.getFloatSystemThenEnvProperty(DELTA_LOAD_FACTOR, DELTA_LOAD_FACTOR_DEFAULT);
    longDeltas = new TObjectLongHashMap<java.lang.String>(initialDeltaCapacity, initialDeltaLoadFactor, Long.MIN_VALUE);
    doubleDeltas = new TObjectDoubleHashMap<java.lang.String>(initialDeltaCapacity, initialDeltaLoadFactor, Double.MIN_NORMAL);
    intDeltas = new TObjectIntHashMap<java.lang.String>(initialDeltaCapacity, initialDeltaLoadFactor, Integer.MIN_VALUE);
    longVDeltas = new TObjectLongHashMap<java.lang.String>(initialDeltaCapacity, initialDeltaLoadFactor, Long.MIN_VALUE);
    doubleVDeltas = new TObjectDoubleHashMap<java.lang.String>(initialDeltaCapacity, initialDeltaLoadFactor, Double.MIN_NORMAL);
    intVDeltas = new TObjectIntHashMap<java.lang.String>(initialDeltaCapacity, initialDeltaLoadFactor, Integer.MIN_VALUE);      
    JMXHelper.registerMBean(OBJECT_NAME, this);     
}
项目:demidovii    文件:NodeParameters.java   
public NodeParameters set(String key, long value) {
  ensureKeyType(key, Type.LONG);
  if (longMap == null) {
    longMap = new TObjectLongHashMap<>();
  }
  longMap.put(key, value);
  return this;
}
项目:trove-over-koloboke-compile    文件:TObjectHashTest.java   
public static void testBug3067307() {
    TObjectLongHashMap<String> testHash = new TObjectLongHashMap<String>();
    final int c = 1000;
    for ( long i = 1; i < c; i++ ) {
        final String data = "test-" + i;
        testHash.put( data, i );
        testHash.remove( data );
    }
}
项目:trove-over-koloboke-compile    文件:TObjectHashTest.java   
public static void testBug3067307_noAutoCompact() {
    TObjectLongHashMap<String> testHash = new TObjectLongHashMap<String>();
    testHash.setAutoCompactionFactor( 0 );
    final int c = 1000;
    for ( long i = 1; i < c; i++ ) {
        final String data = "test-" + i;
        testHash.put( data, i );
        testHash.remove( data );
    }
}
项目:mutinack    文件:CandidateSequence.java   
@Override
@SuppressWarnings("null")
public @NonNull TObjectLongHashMap<Duplex> getIssues() {
    if (issues == null) {
        issues = new TObjectLongHashMap<>();
    }
    return issues;
}
项目:galago-git    文件:NodeParameters.java   
public NodeParameters set(String key, long value) {
  ensureKeyType(key, Type.LONG);
  if (longMap == null) {
    longMap = new TObjectLongHashMap<>();
  }
  longMap.put(key, value);
  return this;
}
项目:gnu.trove    文件:TObjectHashTest.java   
public static void testBug3067307() {
    TObjectLongHashMap<String> testHash = new TObjectLongHashMap<String>();
    final int c = 1000;
    for ( long i = 1; i < c; i++ ) {
        final String data = "test-" + i;
        testHash.put( data, i );
        testHash.remove( data );
    }
}
项目:gnu.trove    文件:TObjectHashTest.java   
public static void testBug3067307_noAutoCompact() {
    TObjectLongHashMap<String> testHash = new TObjectLongHashMap<String>();
    testHash.setAutoCompactionFactor( 0 );
    final int c = 1000;
    for ( long i = 1; i < c; i++ ) {
        final String data = "test-" + i;
        testHash.put( data, i );
        testHash.remove( data );
    }
}
项目:openimaj    文件:StatsWordMatch.java   
public StatsWordMatch() {
    this.available = new HashMap<String,Pattern>();
    addAvail(new EmoticonPatternProvider());
    addAvail(new URLPatternProvider());
    addAvail(new TimePatternProvider());
    addAvail(new PunctuationPatternProvider());
    TwitterStuffPatternProvider tpp = new TwitterStuffPatternProvider();
    addAvail("TwitterStuff.hashtags", tpp.hashtagPatternString());
    addAvail("TwitterStuff.retweets", tpp.retweetPatternString());
    addAvail("TwitterStuff.username", tpp.usernamePatternString());
    addAvail("EdgePunctuation",EdgePunctuationPatternProvider.edgePuncPattern());
    this.counts = new TObjectLongHashMap<String>();
}
项目:G    文件:TxtGraphUtils.java   
public static void convertTextGraphWithLongMapGZ(String inputGraph, String outputGraph, String mapFile) throws IOException {

        TObjectLongHashMap map = loadTXT2LongGZMap(mapFile, false);
        long time = System.currentTimeMillis();

        BufferedReader br = new BufferedReader(new InputStreamReader(new GZIPInputStream(new FileInputStream(inputGraph))));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new GZIPOutputStream(new FileOutputStream(outputGraph))));

        String line, newLine;
        long id1, id2;
        String[] parts;

        while ((line = br.readLine()) != null) {
            parts = line.split(SEP);
            id1 = map.get(parts[0]);
            id2 = map.get(parts[1]);
            if (id1 != 0 && id2 != 0) {
                newLine = "" + id1 + SEP + id2 + (parts.length > 2 ? (SEP + parts[2]) : "");
                bw.write(newLine);
                bw.newLine();
            }
        }
        bw.flush();
        bw.close();

        br.close();

        logger.info(((System.currentTimeMillis() - time) / 1000d) + "s");
    }
项目:Mineworld    文件:PerformanceMonitorImpl.java   
public PerformanceMonitorImpl() {
    _activityStack = new Stack<Activity>();
    _metricData = new LinkedList<TObjectLongMap<String>>();
    _runningTotals = new TObjectLongHashMap<String>();
    _timerTicksPerSecond = Sys.getTimerResolution();
    _currentData = new TObjectLongHashMap<String>();
    _spikeData = new TObjectDoubleHashMap<String>();
    _runningThreads = TCollections.synchronizedMap(new TObjectIntHashMap<String>());
    _stoppedThreads = TCollections.synchronizedMap(new TObjectIntHashMap<String>());
    _lastRunningThreads = new TObjectIntHashMap<String>();
    _timeFactor = 1000.0 / _timerTicksPerSecond;
    _mainThread = Thread.currentThread();

}
项目:trove    文件:TObjectHashTest.java   
public static void testBug3067307() {
    TObjectLongHashMap<String> testHash = new TObjectLongHashMap<String>();
    final int c = 1000;
    for ( long i = 1; i < c; i++ ) {
        final String data = "test-" + i;
        testHash.put( data, i );
        testHash.remove( data );
    }
}
项目:trove    文件:TObjectHashTest.java   
public static void testBug3067307_noAutoCompact() {
    TObjectLongHashMap<String> testHash = new TObjectLongHashMap<String>();
    testHash.setAutoCompactionFactor( 0 );
    final int c = 1000;
    for ( long i = 1; i < c; i++ ) {
        final String data = "test-" + i;
        testHash.put( data, i );
        testHash.remove( data );
    }
}
项目:shorthand    文件:AbstractDataMapper.java   
/**
 * {@inheritDoc}
 * @see com.heliosapm.shorthand.datamapper.IDataMapper#prePut(long, long[])
 */
@Override
public void prePut(long address, long[] data) {
    int enumIndex = (int)HeaderOffset.EnumIndex.get(address);
    int bitMask = (int)HeaderOffset.BitMask.get(address);
    TObjectLongHashMap<T> offsets = (TObjectLongHashMap<T>) EnumCollectors.getInstance().offsets(enumIndex, bitMask);

    if(offsets.isEmpty()) return;
    ICollector<?>[] preApplies = (ICollector<?>[]) offsets.iterator().key().getPreApplies(bitMask);
    if(preApplies.length==0) return;
    for(ICollector<?> collector: preApplies) {
        collector.apply(address+offsets.get(collector), data);
    }
}
项目:offheapstore-benchmark    文件:ChronicleStore.java   
public ChronicleStore() throws IOException {
    file = FileUtils.createTempFile();

    LOGGER.info("Using " + file.getAbsolutePath());

    chronicle = new IndexedChronicle(file.getAbsolutePath());
    posMap = new TObjectLongHashMap<Serializable>(Constants.DEFAULT_CAPACITY, Constants.DEFAULT_LOAD_FACTOR, NO_ENTRY);
    posSizeMap = new TLongIntHashMap(Constants.DEFAULT_CAPACITY, Constants.DEFAULT_LOAD_FACTOR, NO_ENTRY, NO_ENTRY);
    freePosSizeMap = new TIntObjectHashMap<TLongList>(Constants.DEFAULT_CAPACITY, Constants.DEFAULT_LOAD_FACTOR, NO_ENTRY);
    freePosMaxSize = 0;

    appender = chronicle.createAppender();
    randomAccessor = chronicle.createExcerpt();
}
项目:monsoon    文件:ChainingTSCPair.java   
public TscStreamReductor() {
    this(new TLongHashSet(), new TObjectLongHashMap<>());
}
项目:pre-cu    文件:AutoDeltaStringLongMap.java   
public AutoDeltaStringLongMap() {
    this.changes = new ArrayList<>(5);
    this.container = new TObjectLongHashMap<>();
    this.baselineCommandCount = 0;
}
项目:pre-cu    文件:AutoDeltaObjectLongMap.java   
public AutoDeltaObjectLongMap(Function<ByteBuffer, K> keyCreator) {
    this.changes = new ArrayList<>(5);
    this.container = new TObjectLongHashMap<>();
    this.baselineCommandCount = 0;
    this.keyCreator = keyCreator;
}
项目:chinesesegmentor    文件:FeatureStat.java   
@Override
protected void setup(Context context) throws IOException, InterruptedException {
  counter = new TObjectLongHashMap<String>();
}
项目:mutinack    文件:CandidateSequenceI.java   
@NonNull TObjectLongHashMap<Duplex> getIssues();