code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
public static <V> Node<V> findNode(List<Node<V>> parents, Predicate<Node<V>> predicate) {
checkArgNotNull(predicate, "predicate");
if (parents != null && !parents.isEmpty()) {
for (Node<V> child : parents) {
Node<V> found = findNode(child, predicate);
if (foun... | java |
public static <V> Node<V> findNodeByLabel(Node<V> parent, String labelPrefix) {
return findNode(parent, new LabelPrefixPredicate<V>(labelPrefix));
} | java |
public static <V> Node<V> findNodeByLabel(List<Node<V>> parents, String labelPrefix) {
return findNode(parents, new LabelPrefixPredicate<V>(labelPrefix));
} | java |
public static <V> Node<V> findLastNode(List<Node<V>> parents, Predicate<Node<V>> predicate) {
checkArgNotNull(predicate, "predicate");
if (parents != null && !parents.isEmpty()) {
int parentsSize = parents.size();
for (int i = parentsSize - 1; i >= 0; i--) {
Node<... | java |
public static <V, C extends Collection<Node<V>>> C collectNodes(Node<V> parent,
Predicate<Node<V>> predicate,
C collection) {
checkArgNotNull(predicate, "predicate");
c... | java |
public static String getNodeText(Node<?> node, InputBuffer inputBuffer) {
checkArgNotNull(node, "node");
checkArgNotNull(inputBuffer, "inputBuffer");
if (node.hasError()) {
// if the node has a parse error we cannot simply cut a string out of the underlying input buffer, since we
... | java |
public static <V, C extends Collection<Node<V>>> C collectNodes(List<Node<V>> parents,
Predicate<Node<V>> predicate,
C collection) {
checkArgNotNull(predicate, "predicate");
... | java |
public static String collectContent(InputBuffer buf) {
StringBuilder sb = new StringBuilder();
int ix = 0;
loop:
while (true) {
char c = buf.charAt(ix++);
switch (c) {
case INDENT:
sb.append('\u00bb'); // right pointed double a... | java |
public boolean append(char c) {
return set(get() == null ? String.valueOf(c) : get() + c);
} | java |
public static void ensure(boolean condition, String errorMessageFormat, Object... errorMessageArgs) {
if (!condition) {
throw new GrammarException(errorMessageFormat, errorMessageArgs);
}
} | java |
private void sort(InstructionGroup group) {
final InsnList instructions = method.instructions;
Collections.sort(group.getNodes(), new Comparator<InstructionGraphNode>() {
public int compare(InstructionGraphNode a, InstructionGraphNode b) {
return Integer.valueOf(instructions.... | java |
private void markUngroupedEnclosedNodes(InstructionGroup group) {
while_:
while (true) {
for (int i = getIndexOfFirstInsn(group), max = getIndexOfLastInsn(group); i < max; i++) {
InstructionGraphNode node = method.getGraphNodes().get(i);
if (node.getGroup() ==... | java |
public boolean isPrefixOf(MatcherPath that) {
checkArgNotNull(that, "that");
return element.level <= that.element.level &&
(this == that || (that.parent != null && isPrefixOf(that.parent)));
} | java |
public Element getElementAtLevel(int level) {
checkArgument(level >= 0);
if (level > element.level) return null;
if (level < element.level) return parent.getElementAtLevel(level);
return element;
} | java |
public MatcherPath commonPrefix(MatcherPath that) {
checkArgNotNull(that, "that");
if (element.level > that.element.level) return parent.commonPrefix(that);
if (element.level < that.element.level) return commonPrefix(that.parent);
if (this == that) return this;
return (parent != ... | java |
public boolean contains(Matcher matcher) {
return element.matcher == matcher || (parent != null && parent.contains(matcher));
} | java |
public static Predicate<Matcher> preventLoops() {
return new Predicate<Matcher>() {
private final Set<Matcher> visited = new HashSet<Matcher>();
public boolean apply(Matcher node) {
node = unwrap(node);
if (visited.contains(node)) {
re... | java |
private void extractInstructions(InstructionGroup group) {
for (InstructionGraphNode node : group.getNodes()) {
if (node != group.getRoot()) {
AbstractInsnNode insn = node.getInstruction();
method.instructions.remove(insn);
group.getInstructions().add(... | java |
private void extractFields(InstructionGroup group) {
List<FieldNode> fields = group.getFields();
for (InstructionGraphNode node : group.getNodes()) {
if (node.isXLoad()) {
VarInsnNode insn = (VarInsnNode) node.getInstruction();
// check whether we already hav... | java |
private synchronized void name(InstructionGroup group, ParserClassNode classNode) {
// generate an MD5 hash across the buffer, use only the first 96 bit
MD5Digester digester = new MD5Digester(classNode.name);
group.getInstructions().accept(digester);
for (FieldNode field: group.getFields... | java |
public Characters add(Characters other) {
checkArgNotNull(other, "other");
if (!subtractive && !other.subtractive) {
return addToChars(other.chars);
}
if (subtractive && other.subtractive) {
return retainAllChars(other.chars);
}
return subtractive ... | java |
public Characters remove(Characters other) {
checkArgNotNull(other, "other");
if (!subtractive && !other.subtractive) {
return removeFromChars(other.chars);
}
if (subtractive && other.subtractive) {
return new Characters(false, other.removeFromChars(chars).chars);... | java |
public boolean overlapsWith(IndexRange other) {
checkArgNotNull(other, "other");
return end > other.start && other.end > start;
} | java |
public boolean touches(IndexRange other) {
checkArgNotNull(other, "other");
return other.end == start || end == other.start;
} | java |
public IndexRange mergedWith(IndexRange other) {
checkArgNotNull(other, "other");
return new IndexRange(Math.min(start, other.start), Math.max(end, other.end));
} | java |
private Paint getPreparedPaint() {
getActionButton().resetPaint();
Paint paint = getActionButton().getPaint();
paint.setStyle(Paint.Style.FILL);
paint.setColor(getActionButton().getButtonColorRipple());
return paint;
} | java |
private void initShadowRadius(TypedArray attrs) {
int index = R.styleable.ActionButton_shadow_radius;
if (attrs.hasValue(index)) {
shadowRadius = attrs.getDimension(index, shadowRadius);
LOGGER.trace("Initialized Action Button shadow radius: {}", getShadowRadius());
}
} | java |
private void initShadowXOffset(TypedArray attrs) {
int index = R.styleable.ActionButton_shadow_xOffset;
if (attrs.hasValue(index)) {
shadowXOffset = attrs.getDimension(index, shadowXOffset);
LOGGER.trace("Initialized Action Button X-axis offset: {}", getShadowXOffset());
}
} | java |
private void initShadowYOffset(TypedArray attrs) {
int index = R.styleable.ActionButton_shadow_yOffset;
if (attrs.hasValue(index)) {
shadowYOffset = attrs.getDimension(index, shadowYOffset);
LOGGER.trace("Initialized Action Button shadow Y-axis offset: {}", getShadowYOffset());
}
} | java |
private void initShadowColor(TypedArray attrs) {
int index = R.styleable.ActionButton_shadow_color;
if (attrs.hasValue(index)) {
shadowColor = attrs.getColor(index, shadowColor);
LOGGER.trace("Initialized Action Button shadow color: {}", getShadowColor());
}
} | java |
private void initShadowResponsiveEffectEnabled(TypedArray attrs) {
int index = R.styleable.ActionButton_shadowResponsiveEffect_enabled;
if (attrs.hasValue(index)) {
shadowResponsiveEffectEnabled = attrs.getBoolean(index, shadowResponsiveEffectEnabled);
LOGGER.trace("Initialized Action Button Shadow Responsive... | java |
private void initStrokeWidth(TypedArray attrs) {
int index = R.styleable.ActionButton_stroke_width;
if (attrs.hasValue(index)) {
strokeWidth = attrs.getDimension(index, strokeWidth);
LOGGER.trace("Initialized Action Button stroke width: {}", getStrokeWidth());
}
} | java |
private void initStrokeColor(TypedArray attrs) {
int index = R.styleable.ActionButton_stroke_color;
if (attrs.hasValue(index)) {
strokeColor = attrs.getColor(index, strokeColor);
LOGGER.trace("Initialized Action Button stroke color: {}", getStrokeColor());
}
} | java |
@SuppressWarnings("all")
@Override
public void startAnimation(Animation animation) {
if (animation != null &&
(getAnimation() == null || getAnimation().hasEnded())) {
super.startAnimation(animation);
}
} | java |
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private boolean hasElevation() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && getElevation() > 0.0f;
} | java |
protected void drawStroke(Canvas canvas) {
resetPaint();
getPaint().setStyle(Paint.Style.STROKE);
getPaint().setStrokeWidth(getStrokeWidth());
getPaint().setColor(getStrokeColor());
canvas.drawCircle(calculateCenterX(), calculateCenterY(), calculateCircleRadius(), getPaint());
LOGGER.trace("Drawn the Action... | java |
protected void drawImage(Canvas canvas) {
int startPointX = (int) (calculateCenterX() - getImageSize() / 2);
int startPointY = (int) (calculateCenterY() - getImageSize() / 2);
int endPointX = (int) (startPointX + getImageSize());
int endPointY = (int) (startPointY + getImageSize());
getImage().setBounds(start... | java |
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
LOGGER.trace("Called Action Button onMeasure");
setMeasuredDimension(calculateMeasuredWidth(), calculateMeasuredHeight());
LOGGER.trace("Measured the Action Button size: heigh... | java |
private int calculateShadowWidth() {
float mShadowRadius = isShadowResponsiveEffectEnabled() ?
((ShadowResponsiveDrawer) shadowResponsiveDrawer).getMaxShadowRadius() : getShadowRadius();
int shadowWidth = hasShadow() ? (int) ((mShadowRadius + Math.abs(getShadowXOffset())) * 2) : 0;
LOGGER.trace("Calculated Ac... | java |
private int calculateShadowHeight() {
float mShadowRadius = isShadowResponsiveEffectEnabled() ?
((ShadowResponsiveDrawer) shadowResponsiveDrawer).getMaxShadowRadius() : getShadowRadius();
int shadowHeight = hasShadow() ? (int) ((mShadowRadius + Math.abs(getShadowYOffset())) * 2) : 0;
LOGGER.trace("Calculated ... | java |
void invalidate() {
if (isInvalidationRequired()) {
view.postInvalidate();
LOGGER.trace("Called view invalidation");
}
if (isInvalidationDelayedRequired()) {
view.postInvalidateDelayed(getInvalidationDelay());
LOGGER.trace("Called view delayed invalidation. Delay time is: {}", getInvalidationDelay());... | java |
boolean isInsideCircle(float centerPointX, float centerPointY, float radius) {
double xValue = Math.pow((getX() - centerPointX), 2);
double yValue = Math.pow((getY() - centerPointY), 2);
double radiusValue = Math.pow(radius, 2);
boolean touchPointInsideCircle = xValue + yValue <= radiusValue;
LOGGER.trace("De... | java |
public List<Classification.RuntimeClassification> getClassifications() {
List<Classification.RuntimeClassification> result = new ArrayList<>();
getClassifications(result, tree.getRoot());
return result;
} | java |
public static JSONObject getStepAsJSON(Machine machine, boolean verbose, boolean showUnvisited) {
JSONObject object = new JSONObject();
if (verbose) {
object.put("modelName", FilenameUtils.getBaseName(machine.getCurrentContext().getModel().getName()));
}
if (machine.getCurrentContext().getCurrentE... | java |
private static void next() {
final short t0 = s0;
short t1 = s1;
t1 ^= t0;
s0 = (short) (rotl(t0, 8) ^ t1 ^ t1 << 5);
s1 = rotl(t1, 13);
} | java |
private static long[] computeParameters(final LongIterator iterator) {
long v = -1, prev = -1, c = 0;
while(iterator.hasNext()) {
v = iterator.nextLong();
if (prev > v) throw new IllegalArgumentException("The list of values is not monotone: " + prev + " > " + v);
prev = v;
c++;
}
return new long[] ... | java |
public static long[][] preprocessJenkins(final BitVector bv, final long seed) {
final long length = bv.length();
final int wordLength = (int) (length / (Long.SIZE * 3)) + 1;
final long aa[] = new long[wordLength], bb[] = new long[wordLength],
cc[] = new long[wordLength];
long a, b, c, from = 0;
if (aa.le... | java |
public static long murmur(final BitVector bv, final long seed) {
long h = seed, k;
long from = 0;
final long length = bv.length();
while (length - from >= Long.SIZE) {
k = bv.getLong(from, from += Long.SIZE);
k *= M;
k ^= k >>> R;
k *= M;
h ^= k;
h *= M;
}
if (length > from) {
k = b... | java |
public static long murmur(final BitVector bv, final long prefixLength, final long[] state) {
final long precomputedUpTo = prefixLength - prefixLength % Long.SIZE;
long h = state[(int) (precomputedUpTo / Long.SIZE)], k;
if (prefixLength > precomputedUpTo) {
k = bv.getLong(precomputedUpTo, prefixLength);
k *... | java |
public static long murmur(final BitVector bv, final long prefixLength, final long[] state, final long lcp) {
final int startStateWord = (int) (Math.min(lcp, prefixLength) / Long.SIZE);
long h = state[startStateWord], k;
long from = startStateWord * Long.SIZE;
while (prefixLength - from >= Long.SIZE) {
k = b... | java |
public static long[] preprocessMurmur(final BitVector bv, final long seed) {
long h = seed, k;
long from = 0;
final long length = bv.length();
final int wordLength = (int) (length / Long.SIZE);
final long state[] = new long[wordLength + 1];
int i = 0;
state[i++] = h;
for (; length - from >= Long.SIZE... | java |
public static long murmur3(final BitVector bv, final long seed) {
long h1 = 0x9368e53c2f6af274L ^ seed;
long h2 = 0x586dcd208f7cd3fdL ^ seed;
long c1 = 0x87c37b91114253d5L;
long c2 = 0x4cf5ad432745937fL;
long from = 0;
final long length = bv.length();
long k1, k2;
while (length - from >= Long.SIZE * ... | java |
public static void murmur3(final BitVector bv, final long prefixLength, final long[] hh1, final long[] hh2, final long[] cc1, final long cc2[], final long h[]) {
final int startStateWord = (int) (prefixLength / (2 * Long.SIZE));
long precomputedUpTo = startStateWord * 2L * Long.SIZE;
long h1 = hh1[startStateWord... | java |
public static void murmur3(final BitVector bv, final long prefixLength, final long[] hh1, final long[] hh2, final long[] cc1, final long cc2[], final long lcp, final long h[]) {
final int startStateWord = (int) (Math.min(lcp, prefixLength) / (2 * Long.SIZE));
long from = startStateWord * 2L * Long.SIZE;
long h1 ... | java |
public static long[][] preprocessMurmur3(final BitVector bv, final long seed) {
long from = 0;
final long length = bv.length();
long h1 = 0x9368e53c2f6af274L ^ seed;
long h2 = 0x586dcd208f7cd3fdL ^ seed;
long c1 = 0x87c37b91114253d5L;
long c2 = 0x4cf5ad432745937fL;
final int wordLength = (int) (length ... | java |
public static long[] preprocessSpooky4(final BitVector bv, final long seed) {
final long length = bv.length();
if (length < Long.SIZE * 2) return null;
final long[] state = new long[4 * (int) (length + Long.SIZE * 2) / (4 * Long.SIZE)];
long h0, h1, h2, h3;
h0 = seed;
h1 = seed;
h2 = ARBITRARY_BITS;
h3... | java |
public long getLongByTriple(final long[] triple) {
if (n == 0) return defRetValue;
final int[] e = new int[3];
final int chunk = chunkShift == Long.SIZE ? 0 : (int)(triple[0] >>> chunkShift);
final long chunkOffset = offset[chunk];
HypergraphSorter.tripleToEdge(triple, seed[chunk], (int)(offset[chunk + 1] - c... | java |
private boolean sort() {
// We cache all variables for faster access
final int[] d = this.d;
//System.err.println("Visiting...");
if (LOGGER.isDebugEnabled()) LOGGER.debug("Peeling hypergraph...");
top = 0;
for(int i = 0; i < numVertices; i++) if (d[i] == 1) peel(i);
if (LOGGER.isDebugEnabled()) LOGGER.... | java |
public LcpMonotoneMinimalPerfectHashFunction<T> build() throws IOException {
if (built) throw new IllegalStateException("This builder has been already used");
built = true;
return new LcpMonotoneMinimalPerfectHashFunction<>(keys, numKeys, transform, signatureWidth, tempDir);
} | java |
public void add(final T o, final long value) throws IOException {
final long[] triple = new long[3];
Hashes.spooky4(transform.toBitVector(o), seed, triple);
add(triple, value);
} | java |
private void add(final long[] triple, final long value) throws IOException {
final int chunk = (int)(triple[0] >>> DISK_CHUNKS_SHIFT);
count[chunk]++;
checkedForDuplicates = false;
if (DEBUG) System.err.println("Adding " + Arrays.toString(triple));
writeLong(triple[0], byteBuffer[chunk], writableByteChannel[c... | java |
public void addAll(final Iterator<? extends T> elements, final LongIterator values, final boolean requiresValue2CountMap) throws IOException {
if (pl != null) {
pl.expectedUpdates = -1;
pl.start("Adding elements...");
}
final long[] triple = new long[3];
while(elements.hasNext()) {
Hashes.spooky4(trans... | java |
public void addAll(final Iterator<? extends T> elements, final LongIterator values) throws IOException {
addAll(elements, values, false);
} | java |
@Override
public void close() throws IOException {
if (! closed) {
LOGGER.debug("Wall clock for quicksort: " + Util.format(quickSortWallTime / 1E9) + "s");
closed = true;
for(final WritableByteChannel channel: writableByteChannel) channel.close();
for(final File f: file) f.delete();
}
} | java |
public void reset(final long seed) throws IOException {
if (locked) throw new IllegalStateException();
if (DEBUG) System.err.println("RESET(" + seed + ")");
filteredSize = 0;
this.seed = seed;
checkedForDuplicates = false;
Arrays.fill(count, 0);
for (int i = 0; i < DISK_CHUNKS; i++) {
writableByteChann... | java |
public void checkAndRetry(final Iterable<? extends T> iterable, final LongIterable values) throws IOException {
final RandomGenerator random = new XoRoShiRo128PlusRandomGenerator();
int duplicates = 0;
for(;;)
try {
check();
break;
}
catch (final DuplicateException e) {
if (duplicates++ > 3)... | java |
public LongBigList signatures(final int signatureWidth, final ProgressLogger pl) throws IOException {
final LongBigList signatures = LongArrayBitVector.getInstance().asLongBigList(signatureWidth);
final long signatureMask = -1L >>> Long.SIZE - signatureWidth;
signatures.size(size());
pl.expectedUpdates = size()... | java |
public int log2Chunks(final int log2chunks) {
this.chunks = 1 << log2chunks;
diskChunkStep = (int)Math.max(DISK_CHUNKS / chunks, 1);
virtualDiskChunks = DISK_CHUNKS / diskChunkStep;
if (DEBUG) {
System.err.print("Chunk sizes: ");
final double avg = filteredSize / (double)DISK_CHUNKS;
double var = 0;
... | java |
public long[] select(long rank, long[] dest, final int offset, final int length) {
if (length == 0) return dest;
final long s = select(rank);
dest[offset] = s;
int curr = (int)(s / Long.SIZE);
long window = bits[curr] & -1L << s;
window &= window - 1;
for(int i = 1; i < length; i++) {
while(window ==... | java |
public void add(final Modulo2Equation equation) {
int i = 0, j = 0, k = 0;
final int s = variables.size(), t = equation.variables.size();
final int[] a = variables.elements(), b = equation.variables.elements(), result = new int[s + t];
if (t != 0 && s != 0) {
for (;;) {
if (a[i] < b[j]) {
re... | java |
public static long scalarProduct(final Modulo2Equation e, long[] solution) {
long sum = 0;
for(final IntListIterator iterator = e.variables.iterator(); iterator.hasNext();)
sum ^= solution[iterator.nextInt()];
return sum;
} | java |
private static void next() {
final long t0 = s0;
long t1 = s1;
t1 ^= t0;
s0 = Long.rotateLeft(t0, 55) ^ t1 ^ t1 << 14;
s1 = Long.rotateLeft(t1, 36);
} | java |
@Override
public Object convert(String value, Class type) {
if (isNullOrEmpty(value)) {
return null;
}
if (Character.isDigit(value.charAt(0))) {
return resolveByOrdinal(value, type);
} else {
return resolveByName(value, type);
}
} | java |
@PreDestroy
public void removeGeneratedClasses() {
ClassPool pool = ClassPool.getDefault();
for (Class<?> clazz : interfaces.values()) {
CtClass ctClass = pool.getOrNull(clazz.getName());
if (ctClass != null) {
ctClass.detach();
logger.debug("class {} is detached", clazz.getName());
}
}
} | java |
private boolean hasConstraints(ControllerMethod controllerMethod) {
Method method = controllerMethod.getMethod();
if (method.getParameterTypes().length == 0) {
logger.debug("method {} has no parameters, skipping", controllerMethod);
return false;
}
BeanDescriptor bean = bvalidator.getConstraintsForClass(c... | java |
protected String extractCategory(ValuedParameter[] params, ConstraintViolation<Object> violation) {
Iterator<Node> path = violation.getPropertyPath().iterator();
Node method = path.next();
logger.debug("Constraint violation on method {}: {}", method, violation);
StringBuilder cat = new StringBuilder();
cat.a... | java |
protected String extractInternacionalizedMessage(ConstraintViolation<Object> v) {
return interpolator.interpolate(v.getMessageTemplate(), new BeanValidatorContext(v), locale.get());
} | java |
@AroundCall
public void intercept(SimpleInterceptorStack stack) {
User current = info.getUser();
try {
dao.refresh(current);
} catch (Exception e) {
// could happen if the user does not exist in the database or if there's no user logged in.
}
/**
* You can use the result even in interceptors, but ... | java |
public void registerComponents(XStream xstream) {
for(Converter converter : converters) {
xstream.registerConverter(converter);
logger.debug("registered Xstream converter for {}", converter.getClass().getName());
}
for(SingleValueConverter converter : singleValueConverters) {
xstream.registerConverter(c... | java |
@Public @Path("/musics/list/json")
public void showAllMusicsAsJSON() {
result.use(json()).from(musicDao.listAll()).serialize();
} | java |
@Public @Path("/musics/list/xml")
public void showAllMusicsAsXML() {
result.use(xml()).from(musicDao.listAll()).serialize();
} | java |
@Public @Path("/musics/list/http")
public void showAllMusicsAsHTTP() {
result.use(http()).body("<p class=\"content\">"+
musicDao.listAll().toString()+"</p>");
} | java |
public Map<String, Collection<Message>> getGrouped() {
if (grouped == null) {
grouped = FluentIterable.from(delegate).index(byCategoryMapping()).asMap();
}
return grouped;
} | java |
public MessageListItem from(final String category) {
List<String> messages = FluentIterable.from(delegate)
.filter(byCategory(category))
.transform(toMessageString())
.toList();
return new MessageListItem(messages);
} | java |
protected String extractControllerNameFrom(Class<?> type) {
String prefix = extractPrefix(type);
if (isNullOrEmpty(prefix)) {
String baseName = StringUtils.lowercaseFirst(type.getSimpleName());
if (baseName.endsWith("Controller")) {
return "/" + baseName.substring(0, baseName.lastIndexOf("Controller"... | java |
protected Route getRouteStrategy(ControllerMethod controllerMethod, Parameter[] parameterNames) {
return new FixedMethodStrategy(originalUri, controllerMethod, this.supportedMethods, builder.build(), priority, parameterNames);
} | java |
public String buildGroupName(Boolean doValidation) {
NameValidation.notEmpty(appName, "appName");
if (doValidation) {
validateNames(appName, stack, countries, devPhase, hardware, partners, revision, usedBy, redBlackSwap,
zoneVar);
if (detail != null && !detai... | java |
public static String notEmpty(String value, String variableName) {
if (value == null) {
throw new NullPointerException("ERROR: Trying to use String with null " + variableName);
}
if (value.isEmpty()) {
throw new IllegalArgumentException("ERROR: Illegal empty string for " ... | java |
public static Boolean usesReservedFormat(String name) {
return checkMatch(name, PUSH_FORMAT_PATTERN) || checkMatch(name, LABELED_VARIABLE_PATTERN);
} | java |
public static <T> Map<String, List<T>> groupByClusterName(List<T> inputs, AsgNameProvider<T> nameProvider) {
Map<String, List<T>> clusterNamesToAsgs = new HashMap<String, List<T>>();
for (T input : inputs) {
String clusterName = Names.parseName(nameProvider.extractAsgName(input)).getCluster(... | java |
public static Map<String, List<String>> groupAsgNamesByClusterName(List<String> asgNames) {
return groupByClusterName(asgNames, new AsgNameProvider<String>() {
public String extractAsgName(String asgName) {
return asgName;
}
});
} | java |
public static AppVersion parseName(String amiName) {
if (amiName == null) {
return null;
}
Matcher matcher = APP_VERSION_PATTERN.matcher(amiName);
if (!matcher.matches()) {
return null;
}
AppVersion parsedName = new AppVersion();
parsedName... | java |
public static BaseAmiInfo parseDescription(String imageDescription) {
BaseAmiInfo info = new BaseAmiInfo();
if (imageDescription == null) {
return info;
}
info.baseAmiId = extractBaseAmiId(imageDescription);
info.baseAmiName = extractBaseAmiName(imageDescription);
... | java |
public boolean isExistingID() {
try {
String userId= getPost().getString(Defines.Jsonkey.Identity.getKey());
return (userId != null && userId.equals(prefHelper_.getIdentity()));
} catch (JSONException e) {
e.printStackTrace();
return false;
}
... | java |
public ContentMetadata addCustomMetadata(String key, String value) {
customMetadata.put(key, value);
return this;
} | java |
public void setDialogWindowAttributes() {
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCR... | java |
static DeviceInfo initialize(Context context) {
if (thisInstance_ == null) {
thisInstance_ = new DeviceInfo(context);
}
return thisInstance_;
} | java |
void updateRequestWithV1Params(JSONObject requestObj) {
try {
SystemObserver.UniqueId hardwareID = getHardwareID();
if (!isNullOrEmptyOrBlank(hardwareID.getId())) {
requestObj.put(Defines.Jsonkey.HardwareID.getKey(), hardwareID.getId());
requestObj.put(Def... | java |
void updateLinkReferrerParams() {
// Add link identifier if present
String linkIdentifier = prefHelper_.getLinkClickIdentifier();
if (!linkIdentifier.equals(PrefHelper.NO_STRING_VALUE)) {
try {
getPost().put(Defines.Jsonkey.LinkIdentifier.getKey(), linkIdentifier);
... | java |
static String getPackageName(Context context) {
String packageName = "";
if (context != null) {
try {
final PackageInfo packageInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
packageName = packageInfo.packageName;
} ... | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.