@NotNull private static TObjectIntHashMap<String> getParsingModes(@NotNull PsiBuilder builder_) { TObjectIntHashMap<String> flags = builder_.getUserDataUnprotected(MODES_KEY); if (flags == null) builder_.putUserDataUnprotected(MODES_KEY, flags = new TObjectIntHashMap<>()); return flags; }
public static boolean withOff(PsiBuilder builder_, int level_, Parser parser, String... modes) { TObjectIntHashMap<String> map = getParsingModes(builder_); TObjectIntHashMap<String> prev = new TObjectIntHashMap<>(); for (String mode : modes) { int p = map.get(mode); if (p > 0) { map.put(mode, 0); prev.put(mode, p); } } boolean result = parser.parse(builder_, level_); prev.forEachEntry((mode, p) -> { map.put(mode, p); return true; }); return result; }
/** * A default constructor for the result set with a given * number of documents. * @param numberOfDocuments the number of documents contained in the result set. */ public QueryResultSet(final int numberOfDocuments) { super(numberOfDocuments); metaMap = new TObjectIntHashMap<String>(); metadata = new String[0][]; } public QueryResultSet(int[] docids, double[] ds, short[] occurrences) {
public QueryResultSet(int[] docids, double[] ds, short[] occurrences) { super(docids, ds, occurrences); metaMap = new TObjectIntHashMap<String>(); metadata = new String[0][]; } /**
public Alphabet(int capacity) { this.map = new gnu.trove.TObjectIntHashMap(capacity); // this.map.setDefaultValue(-1); numEntries = 0; }
/** * A default constructor for the result set with a given * number of documents. * @param numberOfDocuments the number of documents contained in the result set. */ public QueryResultSet(final int numberOfDocuments) { super(numberOfDocuments); metaMap = new TObjectIntHashMap<String>(); metadata = new String[0][]; } public QueryResultSet(int[] docids, double[] ds, short[] occurrences) {
public BidirectionalIntObjectMap (int capacity) { this.map = new gnu.trove.TObjectIntHashMap (capacity); this.entries = new ArrayList (capacity); }
public TroveFeaturesDB() { super(); _featuresMap = new TObjectIntHashMap<String>(); _featuresRMap = new Vector<String>(); _name = "generic"; }
public Alphabet (int capacity, Class entryClass) { this.map = new gnu.trove.TObjectIntHashMap (capacity); this.entries = new ArrayList (capacity); this.entryClass = entryClass; // someone could try to deserialize us into this image (e.g., by RMI). Handle this. deserializedEntries.putIfAbsent(instanceId, this); }
private TObjectIntHashMap findProperImmutableCache(Class clazz) { TObjectIntHashMap properCache = (TObjectIntHashMap)immutableCache.get(clazz); if (properCache == null) { properCache = new TObjectIntHashMap(regularHashStrategy); immutableCache.put(clazz, properCache); } return properCache; }
public Alphabet (int capacity, Class entryClass) { this.map = new gnu.trove.TObjectIntHashMap (capacity); this.entries = new ArrayList (capacity); this.entryClass = entryClass; // someone could try to deserialize us into this image (e.g., by RMI). Handle this. deserializedEntries.putIfAbsent(instanceId, this); }
/** * Creates an empty assignment. */ public Assignment () { super (new HashVarSet ()); var2idx = new TObjectIntHashMap (); values = new ArrayList(); }
/** * Creates an assignemnt for the given variables. */ public Assignment (Variable[] vars, int[] outcomes) { var2idx = new TObjectIntHashMap (vars.length); values = new ArrayList (); addRow (vars, outcomes); }
/** * Creates an empty assignment. */ public Assignment () { super (new HashVarSet ()); var2idx = new TObjectIntHashMap (); values = new ArrayList(); }
/** * Creates an assignemnt for the given variables. */ public Assignment (Variable[] vars, int[] outcomes) { var2idx = new TObjectIntHashMap (vars.length); values = new ArrayList (); addRow (vars, outcomes); }
/** * Creates an assignemnt for the given variables. */ public Assignment (List vars, int[] outcomes) { var2idx = new TObjectIntHashMap (vars.size ()); values = new ArrayList (); addRow ((Variable[]) vars.toArray (new Variable[0]), outcomes); }
/** * Creates an assignemnt for the given variables. */ public Assignment (List vars, int[] outcomes) { var2idx = new TObjectIntHashMap (vars.size ()); values = new ArrayList (); addRow ((Variable[]) vars.toArray (new Variable[0]), outcomes); }
/** * Creates an assignemnt for the given variables. */ public Assignment (Variable[] vars, int[] outcomes) { var2idx = new TObjectIntHashMap (vars.length); values = new ArrayList (); addRow (vars, outcomes); }
/** * Creates an assignemnt for the given variables. */ public Assignment (Variable[] vars, double[] outcomes) { var2idx = new TObjectIntHashMap (vars.length); values = new ArrayList (); addRow (vars, outcomes); }
/** * Creates an assignment over all Variables in a model. * The assignment will assign outcomes[i] to the variable * <tt>mdl.get(i)</tt> */ public Assignment (FactorGraph mdl, int[] outcomes) { var2idx = new TObjectIntHashMap (mdl.numVariables ()); values = new ArrayList (); Variable[] vars = new Variable [mdl.numVariables ()]; for (int i = 0; i < vars.length; i++) vars[i] = mdl.get (i); addRow (vars, outcomes); }