Allocate a counter record and wrap it with a new {@link AtomicCounter} for use.

@param label  to describe the counter.
@param typeId for the type of counter.
@return a newly allocated {@link AtomicCounter}
482392
public AtomicCounter newCounter(final String label, final int typeId)
    {
        return new AtomicCounter(valuesBuffer, allocate(label, typeId), this);
    }
718712
private void createCountersManager() {
        UnsafeBuffer counterLabelsBuffer = monitorFileWriter.createServiceCounterLabelsBuffer(index);
        UnsafeBuffer counterValuesBuffer = monitorFileWriter.createServiceCounterValuesBuffer(index);

        countersManager = new CountersManager(counterLabelsBuffer, counterValuesBuffer);
    }
979272
public synchronized CheckBox setLabel(String label) {
        if(label == null) {
            throw new IllegalArgumentException("Cannot set CheckBox label to null");
        }
        this.label = label;
        invalidate();
        return this;
    }
992932
public LabelId convertToId(Label label) {
        if (transactionCache.isLabelCached(label)) {
            return transactionCache.convertLabelToId(label);
        }
        return LabelId.invalid();
    }
354022
public <T extends TypedTagLibrary> T createInvoker(Class<T> type) {
        ProxyImpl handler = new ProxyImpl();
        Object proxy = Proxy.newProxyInstance(type.getClassLoader(), new Class[]{type}, handler);
        handler.setMetaClass(InvokerHelper.getMetaClass(proxy.getClass()));
        return type.cast(proxy);
    }
356514
public TypeChecker createTypeChecker(CompilationUnit unit) {

        TypeChecker typeChecker = super.createTypeChecker(unit);
        CompileListener typeCheckerListener = getTypeCheckerListener();
        if (typeCheckerListener != null) {
            typeChecker.addCompileListener(typeCheckerListener);
        }

        return typeChecker;
    }
1238725
public void add(Counter<? extends Pair<T>> counter) {
        for (Map.Entry<? extends Pair<T>,Integer> e : counter) {
            count(e.getKey(), e.getValue());
        }
    }
881803
public static EquivalentFragmentSet label(VarProperty varProperty, Variable type, ImmutableSet<Label> labels) {
        return new AutoValue_LabelFragmentSet(varProperty, type, labels);
    }
1203175
public static <T> TypedColumn<T, Long> count(MapFunction<T, Object> f) {
    return new TypedCount<T>(f).toColumnJava();
  }
927049
public static <T> TypeChecker<Collection<? extends T>> tCollection(TypeChecker<? extends T> elementChecker) {
        return new CollectionTypeChecker<>(Collection.class, elementChecker);
    }
1145021
public static Label.Builder generateLabelBuilder(final String label) {
        return addLabel(Label.newBuilder(), Locale.getDefault(), label);
    }
168769
public static String createTypeCollectionId(Collection<? extends Type> types) {
        StringBuilder builder = new StringBuilder();
        List<? extends Type> sortedTypes = new ArrayList<Type>(types);
        Collections.sort(sortedTypes, TypeComparator.INSTANCE);
        builder.append("[");
        for (Iterator<? extends Type> iterator = sortedTypes.iterator(); iterator.hasNext();) {
            builder.append(createTypeId(iterator.next()));
            if (iterator.hasNext()) {
                builder.append(",");
            }
        }
        builder.append("]");
        return builder.toString();
    }
1051315
public Binder collect(int index, Class<?> type) {
        return new Binder(this, new Collect(type(), index, type));
    }
891135
public void storeLabel(String label) {
        if (labels == null)
            labels = new ArrayList<>();

        if (!uniq.contains(label)) {
            uniq.add(label);
            labels.add(label);
        }
    }
336373
public static Result newPSMResult(int type, String label, Object value) {

        Result result = newResult(ResultConstants.VALUE);

        result.errorCode  = type;
        result.mainString = label;
        result.valueData  = value;

        return result;
    }
1049616
public static Label buildLabel(final String label) {
        return addLabel(Label.newBuilder(), Locale.getDefault(), label).build();
    }
964480
public Binder spread(int count) {
        if (count == 0) {
            return dropLast();
        }

        Class<?> aryType = type().parameterType(type().parameterCount() - 1);

        assert aryType.isArray();

        Class<?>[] spreadTypes = new Class[count];
        Arrays.fill(spreadTypes, aryType.getComponentType());

        return spread(spreadTypes);
    }