id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
7,800 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/qe/StorableIndexSet.java | StorableIndexSet.markClustered | public void markClustered(boolean clustered) {
Map<StorableIndex<S>, StorableIndex<S>> replacements = null;
for (StorableIndex<S> index : this) {
StorableIndex<S> replacement = index.clustered(clustered);
if (replacement != index) {
if (replacements == null) ... | java | public void markClustered(boolean clustered) {
Map<StorableIndex<S>, StorableIndex<S>> replacements = null;
for (StorableIndex<S> index : this) {
StorableIndex<S> replacement = index.clustered(clustered);
if (replacement != index) {
if (replacements == null) ... | [
"public",
"void",
"markClustered",
"(",
"boolean",
"clustered",
")",
"{",
"Map",
"<",
"StorableIndex",
"<",
"S",
">",
",",
"StorableIndex",
"<",
"S",
">",
">",
"replacements",
"=",
"null",
";",
"for",
"(",
"StorableIndex",
"<",
"S",
">",
"index",
":",
... | Marks all indexes as clustered or non-clustered.
@param clustered true to mark clustered; false to mark non-clustered
@see StorableIndex#isClustered()
@since 1.2 | [
"Marks",
"all",
"indexes",
"as",
"clustered",
"or",
"non",
"-",
"clustered",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/qe/StorableIndexSet.java#L210-L222 |
7,801 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/qe/StorableIndexSet.java | StorableIndexSet.uniquify | public void uniquify(StorableInfo<S> info) {
if (info == null) {
throw new IllegalArgumentException();
}
uniquify(info.getPrimaryKey());
} | java | public void uniquify(StorableInfo<S> info) {
if (info == null) {
throw new IllegalArgumentException();
}
uniquify(info.getPrimaryKey());
} | [
"public",
"void",
"uniquify",
"(",
"StorableInfo",
"<",
"S",
">",
"info",
")",
"{",
"if",
"(",
"info",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"uniquify",
"(",
"info",
".",
"getPrimaryKey",
"(",
")",
")",... | Augment non-unique indexes with primary key properties, thus making them
unique.
@throws IllegalArgumentException if info is null | [
"Augment",
"non",
"-",
"unique",
"indexes",
"with",
"primary",
"key",
"properties",
"thus",
"making",
"them",
"unique",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/qe/StorableIndexSet.java#L230-L235 |
7,802 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/qe/StorableIndexSet.java | StorableIndexSet.uniquify | public void uniquify(StorableKey<S> key) {
if (key == null) {
throw new IllegalArgumentException();
}
// Replace indexes which were are implied unique, even if they are not
// declared as such.
{
Map<StorableIndex<S>, StorableIndex<S>> replaceme... | java | public void uniquify(StorableKey<S> key) {
if (key == null) {
throw new IllegalArgumentException();
}
// Replace indexes which were are implied unique, even if they are not
// declared as such.
{
Map<StorableIndex<S>, StorableIndex<S>> replaceme... | [
"public",
"void",
"uniquify",
"(",
"StorableKey",
"<",
"S",
">",
"key",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"// Replace indexes which were are implied unique, even if they are not\r",
... | Augment non-unique indexes with key properties, thus making them unique.
@throws IllegalArgumentException if key is null | [
"Augment",
"non",
"-",
"unique",
"indexes",
"with",
"key",
"properties",
"thus",
"making",
"them",
"unique",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/qe/StorableIndexSet.java#L242-L277 |
7,803 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/qe/StorableIndexSet.java | StorableIndexSet.isUniqueImplied | private boolean isUniqueImplied(StorableIndex<S> candidate) {
if (candidate.isUnique()) {
return true;
}
if (this.size() <= 1) {
return false;
}
Set<StorableProperty<S>> candidateProps = new HashSet<StorableProperty<S>>();
for (int i=cand... | java | private boolean isUniqueImplied(StorableIndex<S> candidate) {
if (candidate.isUnique()) {
return true;
}
if (this.size() <= 1) {
return false;
}
Set<StorableProperty<S>> candidateProps = new HashSet<StorableProperty<S>>();
for (int i=cand... | [
"private",
"boolean",
"isUniqueImplied",
"(",
"StorableIndex",
"<",
"S",
">",
"candidate",
")",
"{",
"if",
"(",
"candidate",
".",
"isUnique",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"this",
".",
"size",
"(",
")",
"<=",
"1",
")",
... | Return true if index is unique or fully contains the members of a unique index. | [
"Return",
"true",
"if",
"index",
"is",
"unique",
"or",
"fully",
"contains",
"the",
"members",
"of",
"a",
"unique",
"index",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/qe/StorableIndexSet.java#L330-L356 |
7,804 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/qe/StorableIndexSet.java | StorableIndexSet.isRedundant | private boolean isRedundant(List<StorableIndex<S>> group, StorableIndex<S> candidate,
Map<StorableIndex<S>, StorableIndex<S>> mergedReplacements) {
// All visited group members will have an equal or greater number of
// properties. This is ensured by the ordering of th... | java | private boolean isRedundant(List<StorableIndex<S>> group, StorableIndex<S> candidate,
Map<StorableIndex<S>, StorableIndex<S>> mergedReplacements) {
// All visited group members will have an equal or greater number of
// properties. This is ensured by the ordering of th... | [
"private",
"boolean",
"isRedundant",
"(",
"List",
"<",
"StorableIndex",
"<",
"S",
">",
">",
"group",
",",
"StorableIndex",
"<",
"S",
">",
"candidate",
",",
"Map",
"<",
"StorableIndex",
"<",
"S",
">",
",",
"StorableIndex",
"<",
"S",
">",
">",
"mergedRepla... | Returns true if candidate index is less qualified than an existing group
member, or if it was merged with another group member. If it was merged,
then an entry is placed in the merged map, and the given group list is
updated. | [
"Returns",
"true",
"if",
"candidate",
"index",
"is",
"less",
"qualified",
"than",
"an",
"existing",
"group",
"member",
"or",
"if",
"it",
"was",
"merged",
"with",
"another",
"group",
"member",
".",
"If",
"it",
"was",
"merged",
"then",
"an",
"entry",
"is",
... | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/qe/StorableIndexSet.java#L379-L460 |
7,805 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/repo/map/MapStorage.java | MapStorage.doTryUpdateNoLock | private boolean doTryUpdateNoLock(S storable) {
S existing = mMap.get(new Key<S>(storable, mFullComparator));
if (existing == null) {
return false;
} else {
// Copy altered values to existing object.
existing.markAllPropertiesDirty();
storab... | java | private boolean doTryUpdateNoLock(S storable) {
S existing = mMap.get(new Key<S>(storable, mFullComparator));
if (existing == null) {
return false;
} else {
// Copy altered values to existing object.
existing.markAllPropertiesDirty();
storab... | [
"private",
"boolean",
"doTryUpdateNoLock",
"(",
"S",
"storable",
")",
"{",
"S",
"existing",
"=",
"mMap",
".",
"get",
"(",
"new",
"Key",
"<",
"S",
">",
"(",
"storable",
",",
"mFullComparator",
")",
")",
";",
"if",
"(",
"existing",
"==",
"null",
")",
"... | Caller must hold write lock. | [
"Caller",
"must",
"hold",
"write",
"lock",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/repo/map/MapStorage.java#L389-L406 |
7,806 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/repo/map/MapStorage.java | MapStorage.mapPut | void mapPut(S storable) {
mMap.put(new Key<S>(storable, mFullComparator), storable);
} | java | void mapPut(S storable) {
mMap.put(new Key<S>(storable, mFullComparator), storable);
} | [
"void",
"mapPut",
"(",
"S",
"storable",
")",
"{",
"mMap",
".",
"put",
"(",
"new",
"Key",
"<",
"S",
">",
"(",
"storable",
",",
"mFullComparator",
")",
",",
"storable",
")",
";",
"}"
] | Called by MapTransaction, which implicitly holds lock. | [
"Called",
"by",
"MapTransaction",
"which",
"implicitly",
"holds",
"lock",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/repo/map/MapStorage.java#L448-L450 |
7,807 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/synthetic/SyntheticPropertyList.java | SyntheticPropertyList.addProperty | public void addProperty(String propertyName, Direction direction) {
if (propertyName == null) {
throw new IllegalArgumentException();
}
if (direction == null) {
direction = Direction.UNSPECIFIED;
}
if (direction != Direction.UNSPECIFIED) {
... | java | public void addProperty(String propertyName, Direction direction) {
if (propertyName == null) {
throw new IllegalArgumentException();
}
if (direction == null) {
direction = Direction.UNSPECIFIED;
}
if (direction != Direction.UNSPECIFIED) {
... | [
"public",
"void",
"addProperty",
"(",
"String",
"propertyName",
",",
"Direction",
"direction",
")",
"{",
"if",
"(",
"propertyName",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"if",
"(",
"direction",
"==",
"null",
... | Adds a property to this index, with the specified direction.
@param propertyName name of property to add to index
@param direction optional direction of property | [
"Adds",
"a",
"property",
"to",
"this",
"index",
"with",
"the",
"specified",
"direction",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/synthetic/SyntheticPropertyList.java#L56-L75 |
7,808 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/cursor/SortedCursor.java | SortedCursor.createComparator | public static <S> Comparator<S> createComparator(Class<S> type, String... orderProperties) {
BeanComparator bc = BeanComparator.forClass(type);
if (Storable.class.isAssignableFrom(type)) {
StorableInfo info = StorableIntrospector.examine((Class) type);
for (String property ... | java | public static <S> Comparator<S> createComparator(Class<S> type, String... orderProperties) {
BeanComparator bc = BeanComparator.forClass(type);
if (Storable.class.isAssignableFrom(type)) {
StorableInfo info = StorableIntrospector.examine((Class) type);
for (String property ... | [
"public",
"static",
"<",
"S",
">",
"Comparator",
"<",
"S",
">",
"createComparator",
"(",
"Class",
"<",
"S",
">",
"type",
",",
"String",
"...",
"orderProperties",
")",
"{",
"BeanComparator",
"bc",
"=",
"BeanComparator",
".",
"forClass",
"(",
"type",
")",
... | Convenience method to create a comparator which orders storables by the
given order-by properties. The property names may be prefixed with '+'
or '-' to indicate ascending or descending order. If the prefix is
omitted, ascending order is assumed.
@param type type of storable to create comparator for
@param orderProper... | [
"Convenience",
"method",
"to",
"create",
"a",
"comparator",
"which",
"orders",
"storables",
"by",
"the",
"given",
"order",
"-",
"by",
"properties",
".",
"The",
"property",
"names",
"may",
"be",
"prefixed",
"with",
"+",
"or",
"-",
"to",
"indicate",
"ascending... | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/cursor/SortedCursor.java#L67-L90 |
7,809 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/cursor/SortedCursor.java | SortedCursor.createComparator | public static <S extends Storable> Comparator<S>
createComparator(OrderedProperty<S>... properties)
{
if (properties == null || properties.length == 0 || properties[0] == null) {
throw new IllegalArgumentException();
}
Class<S> type = properties[0].getChainedPrope... | java | public static <S extends Storable> Comparator<S>
createComparator(OrderedProperty<S>... properties)
{
if (properties == null || properties.length == 0 || properties[0] == null) {
throw new IllegalArgumentException();
}
Class<S> type = properties[0].getChainedPrope... | [
"public",
"static",
"<",
"S",
"extends",
"Storable",
">",
"Comparator",
"<",
"S",
">",
"createComparator",
"(",
"OrderedProperty",
"<",
"S",
">",
"...",
"properties",
")",
"{",
"if",
"(",
"properties",
"==",
"null",
"||",
"properties",
".",
"length",
"==",... | Convenience method to create a comparator which orders storables by the
given properties.
@param properties list of properties to order by
@throws IllegalArgumentException if no properties or if any property is null | [
"Convenience",
"method",
"to",
"create",
"a",
"comparator",
"which",
"orders",
"storables",
"by",
"the",
"given",
"properties",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/cursor/SortedCursor.java#L118-L137 |
7,810 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/cursor/SortedCursor.java | SortedCursor.chainToBeanString | private static String chainToBeanString(ChainedProperty property) {
int count = property.getChainCount();
if (count <= 0) {
return property.getPrimeProperty().getBeanName();
}
StringBuilder b = new StringBuilder();
b.append(property.getPrimeProperty().getBeanN... | java | private static String chainToBeanString(ChainedProperty property) {
int count = property.getChainCount();
if (count <= 0) {
return property.getPrimeProperty().getBeanName();
}
StringBuilder b = new StringBuilder();
b.append(property.getPrimeProperty().getBeanN... | [
"private",
"static",
"String",
"chainToBeanString",
"(",
"ChainedProperty",
"property",
")",
"{",
"int",
"count",
"=",
"property",
".",
"getChainCount",
"(",
")",
";",
"if",
"(",
"count",
"<=",
"0",
")",
"{",
"return",
"property",
".",
"getPrimeProperty",
"(... | Creates a dotted name string using the bean property names. | [
"Creates",
"a",
"dotted",
"name",
"string",
"using",
"the",
"bean",
"property",
"names",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/cursor/SortedCursor.java#L207-L221 |
7,811 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/cursor/SortedCursor.java | SortedCursor.comparator | public Comparator<S> comparator() {
if (mChunkMatcher == null) {
return mChunkSorter;
}
return new Comparator<S>() {
public int compare(S a, S b) {
int result = mChunkMatcher.compare(a, b);
if (result == 0) {
res... | java | public Comparator<S> comparator() {
if (mChunkMatcher == null) {
return mChunkSorter;
}
return new Comparator<S>() {
public int compare(S a, S b) {
int result = mChunkMatcher.compare(a, b);
if (result == 0) {
res... | [
"public",
"Comparator",
"<",
"S",
">",
"comparator",
"(",
")",
"{",
"if",
"(",
"mChunkMatcher",
"==",
"null",
")",
"{",
"return",
"mChunkSorter",
";",
"}",
"return",
"new",
"Comparator",
"<",
"S",
">",
"(",
")",
"{",
"public",
"int",
"compare",
"(",
... | Returns a comparator representing the effective sort order of this cursor. | [
"Returns",
"a",
"comparator",
"representing",
"the",
"effective",
"sort",
"order",
"of",
"this",
"cursor",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/cursor/SortedCursor.java#L277-L290 |
7,812 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/repo/jdbc/SQLStatement.java | SQLStatement.buildStatement | public String buildStatement(int initialCapacity, FilterValues<S> filterValues) {
StringBuilder b = new StringBuilder(initialCapacity);
this.appendTo(b, filterValues);
return b.toString();
} | java | public String buildStatement(int initialCapacity, FilterValues<S> filterValues) {
StringBuilder b = new StringBuilder(initialCapacity);
this.appendTo(b, filterValues);
return b.toString();
} | [
"public",
"String",
"buildStatement",
"(",
"int",
"initialCapacity",
",",
"FilterValues",
"<",
"S",
">",
"filterValues",
")",
"{",
"StringBuilder",
"b",
"=",
"new",
"StringBuilder",
"(",
"initialCapacity",
")",
";",
"this",
".",
"appendTo",
"(",
"b",
",",
"f... | Builds a statement string from the given values.
@param initialCapacity expected size of finished string
length. Should be value returned from maxLength.
@param filterValues values may be needed to build complete statement | [
"Builds",
"a",
"statement",
"string",
"from",
"the",
"given",
"values",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/repo/jdbc/SQLStatement.java#L41-L45 |
7,813 | michael-rapp/AndroidMaterialValidation | library/src/main/java/de/mrapp/android/validation/Validators.java | Validators.conjunctive | @SafeVarargs
public static <Type> Validator<Type> conjunctive(@NonNull final Context context,
@NonNull final Validator<Type>... validators) {
return ConjunctiveValidator.create(context, R.string.default_error_message, validators);
} | java | @SafeVarargs
public static <Type> Validator<Type> conjunctive(@NonNull final Context context,
@NonNull final Validator<Type>... validators) {
return ConjunctiveValidator.create(context, R.string.default_error_message, validators);
} | [
"@",
"SafeVarargs",
"public",
"static",
"<",
"Type",
">",
"Validator",
"<",
"Type",
">",
"conjunctive",
"(",
"@",
"NonNull",
"final",
"Context",
"context",
",",
"@",
"NonNull",
"final",
"Validator",
"<",
"Type",
">",
"...",
"validators",
")",
"{",
"return"... | Creates and returns a validator, which allows to combine multiple validators in a conjunctive
manner. If all single validators succeed, the resulting validator will also succeed.
@param <Type>
The type of the values, which should be validated
@param context
The context, which should be used to retrieve the error messa... | [
"Creates",
"and",
"returns",
"a",
"validator",
"which",
"allows",
"to",
"combine",
"multiple",
"validators",
"in",
"a",
"conjunctive",
"manner",
".",
"If",
"all",
"single",
"validators",
"succeed",
"the",
"resulting",
"validator",
"will",
"also",
"succeed",
"."
... | ac8693baeac7abddf2e38a47da4c1849d4661a8b | https://github.com/michael-rapp/AndroidMaterialValidation/blob/ac8693baeac7abddf2e38a47da4c1849d4661a8b/library/src/main/java/de/mrapp/android/validation/Validators.java#L178-L182 |
7,814 | michael-rapp/AndroidMaterialValidation | library/src/main/java/de/mrapp/android/validation/Validators.java | Validators.regex | public static Validator<CharSequence> regex(@NonNull final CharSequence errorMessage,
@NonNull final Pattern regex) {
return new RegexValidator(errorMessage, regex);
} | java | public static Validator<CharSequence> regex(@NonNull final CharSequence errorMessage,
@NonNull final Pattern regex) {
return new RegexValidator(errorMessage, regex);
} | [
"public",
"static",
"Validator",
"<",
"CharSequence",
">",
"regex",
"(",
"@",
"NonNull",
"final",
"CharSequence",
"errorMessage",
",",
"@",
"NonNull",
"final",
"Pattern",
"regex",
")",
"{",
"return",
"new",
"RegexValidator",
"(",
"errorMessage",
",",
"regex",
... | Creates and returns a validator, which allows to validate texts to ensure, that they match a
certain regular expression.
@param errorMessage
The error message, which should be shown, if the validation fails, as an instance of
the type {@link CharSequence}. The error message may not be null
@param regex
The regular exp... | [
"Creates",
"and",
"returns",
"a",
"validator",
"which",
"allows",
"to",
"validate",
"texts",
"to",
"ensure",
"that",
"they",
"match",
"a",
"certain",
"regular",
"expression",
"."
] | ac8693baeac7abddf2e38a47da4c1849d4661a8b | https://github.com/michael-rapp/AndroidMaterialValidation/blob/ac8693baeac7abddf2e38a47da4c1849d4661a8b/library/src/main/java/de/mrapp/android/validation/Validators.java#L302-L305 |
7,815 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/spi/AbstractRepositoryBuilder.java | AbstractRepositoryBuilder.assertReady | public final void assertReady() throws ConfigurationException {
ArrayList<String> messages = new ArrayList<String>();
errorCheck(messages);
int size = messages.size();
if (size == 0) {
return;
}
StringBuilder b = new StringBuilder();
if (size >... | java | public final void assertReady() throws ConfigurationException {
ArrayList<String> messages = new ArrayList<String>();
errorCheck(messages);
int size = messages.size();
if (size == 0) {
return;
}
StringBuilder b = new StringBuilder();
if (size >... | [
"public",
"final",
"void",
"assertReady",
"(",
")",
"throws",
"ConfigurationException",
"{",
"ArrayList",
"<",
"String",
">",
"messages",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"errorCheck",
"(",
"messages",
")",
";",
"int",
"size",
"=... | Throw a configuration exception if the configuration is not filled out
sufficiently and correctly such that a repository could be instantiated
from it. | [
"Throw",
"a",
"configuration",
"exception",
"if",
"the",
"configuration",
"is",
"not",
"filled",
"out",
"sufficiently",
"and",
"correctly",
"such",
"that",
"a",
"repository",
"could",
"be",
"instantiated",
"from",
"it",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/spi/AbstractRepositoryBuilder.java#L78-L96 |
7,816 | michael-rapp/AndroidMaterialValidation | example/src/main/java/de/mrapp/android/validation/example/MainActivity.java | MainActivity.initializeUsernameEditText | private void initializeUsernameEditText() {
usernameEditText = (EditText) findViewById(R.id.username_edit_text);
usernameEditText.addValidator(
Validators.notEmpty(this, R.string.not_empty_validator_error_message));
usernameEditText.addValidator(Validators
.maxLen... | java | private void initializeUsernameEditText() {
usernameEditText = (EditText) findViewById(R.id.username_edit_text);
usernameEditText.addValidator(
Validators.notEmpty(this, R.string.not_empty_validator_error_message));
usernameEditText.addValidator(Validators
.maxLen... | [
"private",
"void",
"initializeUsernameEditText",
"(",
")",
"{",
"usernameEditText",
"=",
"(",
"EditText",
")",
"findViewById",
"(",
"R",
".",
"id",
".",
"username_edit_text",
")",
";",
"usernameEditText",
".",
"addValidator",
"(",
"Validators",
".",
"notEmpty",
... | Initializes the edit text, which allows to enter an username. | [
"Initializes",
"the",
"edit",
"text",
"which",
"allows",
"to",
"enter",
"an",
"username",
"."
] | ac8693baeac7abddf2e38a47da4c1849d4661a8b | https://github.com/michael-rapp/AndroidMaterialValidation/blob/ac8693baeac7abddf2e38a47da4c1849d4661a8b/example/src/main/java/de/mrapp/android/validation/example/MainActivity.java#L94-L103 |
7,817 | michael-rapp/AndroidMaterialValidation | example/src/main/java/de/mrapp/android/validation/example/MainActivity.java | MainActivity.initializePasswordEditText | private void initializePasswordEditText() {
passwordEditText = (PasswordEditText) findViewById(R.id.password_edit_text);
passwordEditText.addValidator(Validators
.minLength(this, R.string.password_min_length_validator_error_message,
MIN_PASSWORD_LENGTH));
... | java | private void initializePasswordEditText() {
passwordEditText = (PasswordEditText) findViewById(R.id.password_edit_text);
passwordEditText.addValidator(Validators
.minLength(this, R.string.password_min_length_validator_error_message,
MIN_PASSWORD_LENGTH));
... | [
"private",
"void",
"initializePasswordEditText",
"(",
")",
"{",
"passwordEditText",
"=",
"(",
"PasswordEditText",
")",
"findViewById",
"(",
"R",
".",
"id",
".",
"password_edit_text",
")",
";",
"passwordEditText",
".",
"addValidator",
"(",
"Validators",
".",
"minLe... | Initializes the edit text, which allows to enter a password. | [
"Initializes",
"the",
"edit",
"text",
"which",
"allows",
"to",
"enter",
"a",
"password",
"."
] | ac8693baeac7abddf2e38a47da4c1849d4661a8b | https://github.com/michael-rapp/AndroidMaterialValidation/blob/ac8693baeac7abddf2e38a47da4c1849d4661a8b/example/src/main/java/de/mrapp/android/validation/example/MainActivity.java#L108-L128 |
7,818 | michael-rapp/AndroidMaterialValidation | example/src/main/java/de/mrapp/android/validation/example/MainActivity.java | MainActivity.initializePasswordRepetitionEditText | private void initializePasswordRepetitionEditText() {
passwordRepetitionEditText = (EditText) findViewById(R.id.password_repetition_edit_text);
passwordRepetitionEditText.addValidator(
Validators.equal(this, R.string.equal_validator_error_message, passwordEditText));
} | java | private void initializePasswordRepetitionEditText() {
passwordRepetitionEditText = (EditText) findViewById(R.id.password_repetition_edit_text);
passwordRepetitionEditText.addValidator(
Validators.equal(this, R.string.equal_validator_error_message, passwordEditText));
} | [
"private",
"void",
"initializePasswordRepetitionEditText",
"(",
")",
"{",
"passwordRepetitionEditText",
"=",
"(",
"EditText",
")",
"findViewById",
"(",
"R",
".",
"id",
".",
"password_repetition_edit_text",
")",
";",
"passwordRepetitionEditText",
".",
"addValidator",
"("... | Initializes the edit text, which allows to enter a password repetition. | [
"Initializes",
"the",
"edit",
"text",
"which",
"allows",
"to",
"enter",
"a",
"password",
"repetition",
"."
] | ac8693baeac7abddf2e38a47da4c1849d4661a8b | https://github.com/michael-rapp/AndroidMaterialValidation/blob/ac8693baeac7abddf2e38a47da4c1849d4661a8b/example/src/main/java/de/mrapp/android/validation/example/MainActivity.java#L133-L137 |
7,819 | michael-rapp/AndroidMaterialValidation | example/src/main/java/de/mrapp/android/validation/example/MainActivity.java | MainActivity.initializeGenderSpinner | private void initializeGenderSpinner() {
genderSpinner = (Spinner) findViewById(R.id.gender_spinner);
genderSpinner
.addValidator(Validators.notNull(this, R.string.not_null_validator_error_message));
} | java | private void initializeGenderSpinner() {
genderSpinner = (Spinner) findViewById(R.id.gender_spinner);
genderSpinner
.addValidator(Validators.notNull(this, R.string.not_null_validator_error_message));
} | [
"private",
"void",
"initializeGenderSpinner",
"(",
")",
"{",
"genderSpinner",
"=",
"(",
"Spinner",
")",
"findViewById",
"(",
"R",
".",
"id",
".",
"gender_spinner",
")",
";",
"genderSpinner",
".",
"addValidator",
"(",
"Validators",
".",
"notNull",
"(",
"this",
... | Initializes the spinner, which allows to choose a gender. | [
"Initializes",
"the",
"spinner",
"which",
"allows",
"to",
"choose",
"a",
"gender",
"."
] | ac8693baeac7abddf2e38a47da4c1849d4661a8b | https://github.com/michael-rapp/AndroidMaterialValidation/blob/ac8693baeac7abddf2e38a47da4c1849d4661a8b/example/src/main/java/de/mrapp/android/validation/example/MainActivity.java#L142-L146 |
7,820 | michael-rapp/AndroidMaterialValidation | example/src/main/java/de/mrapp/android/validation/example/MainActivity.java | MainActivity.initializeFirstNameEditText | private void initializeFirstNameEditText() {
firstNameEditText = (EditText) findViewById(R.id.first_name_edit_text);
firstNameEditText.addValidator(Validators
.minLength(this, R.string.min_length_validator_error_message, MIN_NAME_LENGTH));
firstNameEditText.addValidator(Validator... | java | private void initializeFirstNameEditText() {
firstNameEditText = (EditText) findViewById(R.id.first_name_edit_text);
firstNameEditText.addValidator(Validators
.minLength(this, R.string.min_length_validator_error_message, MIN_NAME_LENGTH));
firstNameEditText.addValidator(Validator... | [
"private",
"void",
"initializeFirstNameEditText",
"(",
")",
"{",
"firstNameEditText",
"=",
"(",
"EditText",
")",
"findViewById",
"(",
"R",
".",
"id",
".",
"first_name_edit_text",
")",
";",
"firstNameEditText",
".",
"addValidator",
"(",
"Validators",
".",
"minLengt... | Initializes the edit text, which allows to enter a first name. | [
"Initializes",
"the",
"edit",
"text",
"which",
"allows",
"to",
"enter",
"a",
"first",
"name",
"."
] | ac8693baeac7abddf2e38a47da4c1849d4661a8b | https://github.com/michael-rapp/AndroidMaterialValidation/blob/ac8693baeac7abddf2e38a47da4c1849d4661a8b/example/src/main/java/de/mrapp/android/validation/example/MainActivity.java#L151-L160 |
7,821 | michael-rapp/AndroidMaterialValidation | example/src/main/java/de/mrapp/android/validation/example/MainActivity.java | MainActivity.initializeLastNameEditText | private void initializeLastNameEditText() {
lastNameEditText = (EditText) findViewById(R.id.last_name_edit_text);
lastNameEditText.addValidator(Validators
.minLength(this, R.string.min_length_validator_error_message, MIN_NAME_LENGTH));
lastNameEditText.addValidator(Validators.beg... | java | private void initializeLastNameEditText() {
lastNameEditText = (EditText) findViewById(R.id.last_name_edit_text);
lastNameEditText.addValidator(Validators
.minLength(this, R.string.min_length_validator_error_message, MIN_NAME_LENGTH));
lastNameEditText.addValidator(Validators.beg... | [
"private",
"void",
"initializeLastNameEditText",
"(",
")",
"{",
"lastNameEditText",
"=",
"(",
"EditText",
")",
"findViewById",
"(",
"R",
".",
"id",
".",
"last_name_edit_text",
")",
";",
"lastNameEditText",
".",
"addValidator",
"(",
"Validators",
".",
"minLength",
... | Initializes the edit text, which allows to enter a last name. | [
"Initializes",
"the",
"edit",
"text",
"which",
"allows",
"to",
"enter",
"a",
"last",
"name",
"."
] | ac8693baeac7abddf2e38a47da4c1849d4661a8b | https://github.com/michael-rapp/AndroidMaterialValidation/blob/ac8693baeac7abddf2e38a47da4c1849d4661a8b/example/src/main/java/de/mrapp/android/validation/example/MainActivity.java#L165-L174 |
7,822 | michael-rapp/AndroidMaterialValidation | example/src/main/java/de/mrapp/android/validation/example/MainActivity.java | MainActivity.initializeValidateButton | private void initializeValidateButton() {
Button button = (Button) findViewById(R.id.validate_button);
button.setOnClickListener(new OnClickListener() {
@Override
public void onClick(final View v) {
usernameEditText.validate();
passwordEditText.va... | java | private void initializeValidateButton() {
Button button = (Button) findViewById(R.id.validate_button);
button.setOnClickListener(new OnClickListener() {
@Override
public void onClick(final View v) {
usernameEditText.validate();
passwordEditText.va... | [
"private",
"void",
"initializeValidateButton",
"(",
")",
"{",
"Button",
"button",
"=",
"(",
"Button",
")",
"findViewById",
"(",
"R",
".",
"id",
".",
"validate_button",
")",
";",
"button",
".",
"setOnClickListener",
"(",
"new",
"OnClickListener",
"(",
")",
"{... | Initializes the button, which allows to validate the values of all views. | [
"Initializes",
"the",
"button",
"which",
"allows",
"to",
"validate",
"the",
"values",
"of",
"all",
"views",
"."
] | ac8693baeac7abddf2e38a47da4c1849d4661a8b | https://github.com/michael-rapp/AndroidMaterialValidation/blob/ac8693baeac7abddf2e38a47da4c1849d4661a8b/example/src/main/java/de/mrapp/android/validation/example/MainActivity.java#L187-L203 |
7,823 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/repo/jdbc/LoggingDataSource.java | LoggingDataSource.create | public static DataSource create(DataSource ds, Log log) {
if (ds == null) {
throw new IllegalArgumentException();
}
if (log == null) {
log = LogFactory.getLog(LoggingDataSource.class);
}
if (!log.isDebugEnabled()) {
return ds;
... | java | public static DataSource create(DataSource ds, Log log) {
if (ds == null) {
throw new IllegalArgumentException();
}
if (log == null) {
log = LogFactory.getLog(LoggingDataSource.class);
}
if (!log.isDebugEnabled()) {
return ds;
... | [
"public",
"static",
"DataSource",
"create",
"(",
"DataSource",
"ds",
",",
"Log",
"log",
")",
"{",
"if",
"(",
"ds",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"if",
"(",
"log",
"==",
"null",
")",
"{",
"log"... | Wraps the given DataSource which logs to the given log. If debug logging
is disabled, the original DataSource is returned. | [
"Wraps",
"the",
"given",
"DataSource",
"which",
"logs",
"to",
"the",
"given",
"log",
".",
"If",
"debug",
"logging",
"is",
"disabled",
"the",
"original",
"DataSource",
"is",
"returned",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/repo/jdbc/LoggingDataSource.java#L48-L59 |
7,824 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/repo/sleepycat/BDBStorage.java | BDBStorage.getPrimaryDatabase | Object getPrimaryDatabase() throws FetchException {
Object database = mPrimaryDatabase;
if (database == null) {
checkClosed();
throw new IllegalStateException("BDBStorage not opened");
}
return database;
} | java | Object getPrimaryDatabase() throws FetchException {
Object database = mPrimaryDatabase;
if (database == null) {
checkClosed();
throw new IllegalStateException("BDBStorage not opened");
}
return database;
} | [
"Object",
"getPrimaryDatabase",
"(",
")",
"throws",
"FetchException",
"{",
"Object",
"database",
"=",
"mPrimaryDatabase",
";",
"if",
"(",
"database",
"==",
"null",
")",
"{",
"checkClosed",
"(",
")",
";",
"throw",
"new",
"IllegalStateException",
"(",
"\"BDBStorag... | Caller must hold transaction lock. May throw FetchException if storage
is closed. | [
"Caller",
"must",
"hold",
"transaction",
"lock",
".",
"May",
"throw",
"FetchException",
"if",
"storage",
"is",
"closed",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBStorage.java#L739-L746 |
7,825 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/repo/sleepycat/BDBStorage.java | BDBStorage.checkClosed | void checkClosed() throws FetchException {
TransactionScope<Txn> scope = localTransactionScope();
// Lock out shutdown task.
scope.getLock().lock();
try {
if (mPrimaryDatabase == null) {
// If shutting down, this will force us to block forever.
... | java | void checkClosed() throws FetchException {
TransactionScope<Txn> scope = localTransactionScope();
// Lock out shutdown task.
scope.getLock().lock();
try {
if (mPrimaryDatabase == null) {
// If shutting down, this will force us to block forever.
... | [
"void",
"checkClosed",
"(",
")",
"throws",
"FetchException",
"{",
"TransactionScope",
"<",
"Txn",
">",
"scope",
"=",
"localTransactionScope",
"(",
")",
";",
"// Lock out shutdown task.\r",
"scope",
".",
"getLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
... | If open, returns normally. If shutting down, blocks forever. Otherwise,
if closed, throws FetchException. Method blocks forever on shutdown to
prevent threads from starting work that will likely fail along the way. | [
"If",
"open",
"returns",
"normally",
".",
"If",
"shutting",
"down",
"blocks",
"forever",
".",
"Otherwise",
"if",
"closed",
"throws",
"FetchException",
".",
"Method",
"blocks",
"forever",
"on",
"shutdown",
"to",
"prevent",
"threads",
"from",
"starting",
"work",
... | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBStorage.java#L789-L808 |
7,826 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/qe/IndexedQueryAnalyzer.java | IndexedQueryAnalyzer.isProperJoin | private boolean isProperJoin(StorableProperty<?> property)
throws SupportException, RepositoryException
{
if (!property.isJoin() || property.isQuery()) {
return false;
}
// Make up a filter over the join's internal properties and then search
// for an ind... | java | private boolean isProperJoin(StorableProperty<?> property)
throws SupportException, RepositoryException
{
if (!property.isJoin() || property.isQuery()) {
return false;
}
// Make up a filter over the join's internal properties and then search
// for an ind... | [
"private",
"boolean",
"isProperJoin",
"(",
"StorableProperty",
"<",
"?",
">",
"property",
")",
"throws",
"SupportException",
",",
"RepositoryException",
"{",
"if",
"(",
"!",
"property",
".",
"isJoin",
"(",
")",
"||",
"property",
".",
"isQuery",
"(",
")",
")"... | Checks if the property is a join and its internal properties are fully
indexed. | [
"Checks",
"if",
"the",
"property",
"is",
"a",
"join",
"and",
"its",
"internal",
"properties",
"are",
"fully",
"indexed",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/qe/IndexedQueryAnalyzer.java#L250-L279 |
7,827 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/util/ConversionComparator.java | ConversionComparator.primitiveWidth | private static int primitiveWidth(TypeDesc type) {
switch (type.getTypeCode()) {
default:
return 0;
case TypeDesc.BOOLEAN_CODE:
return 1;
case TypeDesc.BYTE_CODE:
return 2;
case TypeDesc.SHORT_CODE:
return 3;
case ... | java | private static int primitiveWidth(TypeDesc type) {
switch (type.getTypeCode()) {
default:
return 0;
case TypeDesc.BOOLEAN_CODE:
return 1;
case TypeDesc.BYTE_CODE:
return 2;
case TypeDesc.SHORT_CODE:
return 3;
case ... | [
"private",
"static",
"int",
"primitiveWidth",
"(",
"TypeDesc",
"type",
")",
"{",
"switch",
"(",
"type",
".",
"getTypeCode",
"(",
")",
")",
"{",
"default",
":",
"return",
"0",
";",
"case",
"TypeDesc",
".",
"BOOLEAN_CODE",
":",
"return",
"1",
";",
"case",
... | 1 = boolean, 2 = byte, 3 = short, 4 = char, 5 = int, 6 = float, 7 = long, 8 = double | [
"1",
"=",
"boolean",
"2",
"=",
"byte",
"3",
"=",
"short",
"4",
"=",
"char",
"5",
"=",
"int",
"6",
"=",
"float",
"7",
"=",
"long",
"8",
"=",
"double"
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/util/ConversionComparator.java#L179-L200 |
7,828 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/filter/PropertyFilter.java | PropertyFilter.getBoxedType | public Class<?> getBoxedType() {
if (mBoxedType == null) {
mBoxedType = TypeDesc.forClass(getType()).toObjectType().toClass();
}
return mBoxedType;
} | java | public Class<?> getBoxedType() {
if (mBoxedType == null) {
mBoxedType = TypeDesc.forClass(getType()).toObjectType().toClass();
}
return mBoxedType;
} | [
"public",
"Class",
"<",
"?",
">",
"getBoxedType",
"(",
")",
"{",
"if",
"(",
"mBoxedType",
"==",
"null",
")",
"{",
"mBoxedType",
"=",
"TypeDesc",
".",
"forClass",
"(",
"getType",
"(",
")",
")",
".",
"toObjectType",
"(",
")",
".",
"toClass",
"(",
")",
... | Returns the type of the ChainedProperty property, boxed into an object
if primitive. | [
"Returns",
"the",
"type",
"of",
"the",
"ChainedProperty",
"property",
"boxed",
"into",
"an",
"object",
"if",
"primitive",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/filter/PropertyFilter.java#L200-L205 |
7,829 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/filter/PropertyFilter.java | PropertyFilter.constant | public PropertyFilter<S> constant(Object value) {
if (mBindID == BOUND_CONSTANT) {
if (mConstant == null) {
if (value == null) {
return this;
}
} else if (mConstant.equals(value)) {
return this;
}
... | java | public PropertyFilter<S> constant(Object value) {
if (mBindID == BOUND_CONSTANT) {
if (mConstant == null) {
if (value == null) {
return this;
}
} else if (mConstant.equals(value)) {
return this;
}
... | [
"public",
"PropertyFilter",
"<",
"S",
">",
"constant",
"(",
"Object",
"value",
")",
"{",
"if",
"(",
"mBindID",
"==",
"BOUND_CONSTANT",
")",
"{",
"if",
"(",
"mConstant",
"==",
"null",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"th... | Returns another PropertyFilter instance which is bound to the given constant value.
@throws IllegalArgumentException if value is not compatible with property type | [
"Returns",
"another",
"PropertyFilter",
"instance",
"which",
"is",
"bound",
"to",
"the",
"given",
"constant",
"value",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/filter/PropertyFilter.java#L284-L295 |
7,830 | cose-wg/COSE-JAVA | src/main/java/COSE/ASN1.java | ASN1.EncodeSubjectPublicKeyInfo | public static byte[] EncodeSubjectPublicKeyInfo(byte[] algorithm, byte[] keyBytes) throws CoseException
{
// SPKI ::= SEQUENCE {
// algorithm SEQUENCE {
// oid = id-ecPublicKey {1 2 840 10045 2}
// namedCurve = oid for algorithm
// }
... | java | public static byte[] EncodeSubjectPublicKeyInfo(byte[] algorithm, byte[] keyBytes) throws CoseException
{
// SPKI ::= SEQUENCE {
// algorithm SEQUENCE {
// oid = id-ecPublicKey {1 2 840 10045 2}
// namedCurve = oid for algorithm
// }
... | [
"public",
"static",
"byte",
"[",
"]",
"EncodeSubjectPublicKeyInfo",
"(",
"byte",
"[",
"]",
"algorithm",
",",
"byte",
"[",
"]",
"keyBytes",
")",
"throws",
"CoseException",
"{",
"// SPKI ::= SEQUENCE {",
"// algorithm SEQUENCE {",
"// oid = id-ecPublicKe... | Encode a subject public key info structure from an OID and the data bytes
for the key
This function assumes that we are encoding an EC Public key.d
@param algorithm - encoded Object Identifier
@param keyBytes - encoded key bytes
@return - encoded SPKI
@throws CoseException - ASN encoding error. | [
"Encode",
"a",
"subject",
"public",
"key",
"info",
"structure",
"from",
"an",
"OID",
"and",
"the",
"data",
"bytes",
"for",
"the",
"key",
"This",
"function",
"assumes",
"that",
"we",
"are",
"encoding",
"an",
"EC",
"Public",
"key",
".",
"d"
] | f972b11ab4c9a18f911bc49a15225a6951cf6f63 | https://github.com/cose-wg/COSE-JAVA/blob/f972b11ab4c9a18f911bc49a15225a6951cf6f63/src/main/java/COSE/ASN1.java#L70-L93 |
7,831 | cose-wg/COSE-JAVA | src/main/java/COSE/ASN1.java | ASN1.EncodeEcPrivateKey | public static byte[] EncodeEcPrivateKey(byte[] oid, byte[] keyBytes, byte[] spki) throws CoseException
{
// ECPrivateKey ::= SEQUENCE {
// version INTEGER {1}
// privateKey OCTET STRING
// parameters [0] OBJECT IDENTIFIER = named curve
// public key [1] BIT ... | java | public static byte[] EncodeEcPrivateKey(byte[] oid, byte[] keyBytes, byte[] spki) throws CoseException
{
// ECPrivateKey ::= SEQUENCE {
// version INTEGER {1}
// privateKey OCTET STRING
// parameters [0] OBJECT IDENTIFIER = named curve
// public key [1] BIT ... | [
"public",
"static",
"byte",
"[",
"]",
"EncodeEcPrivateKey",
"(",
"byte",
"[",
"]",
"oid",
",",
"byte",
"[",
"]",
"keyBytes",
",",
"byte",
"[",
"]",
"spki",
")",
"throws",
"CoseException",
"{",
"// ECPrivateKey ::= SEQUENCE {",
"// version INTEGER {1}",
"//... | Encode an EC Private key
@param oid - curve to use
@param keyBytes - bytes of the key
@param spki - optional SPKI
@return encoded private key
@throws CoseException - from lower level | [
"Encode",
"an",
"EC",
"Private",
"key"
] | f972b11ab4c9a18f911bc49a15225a6951cf6f63 | https://github.com/cose-wg/COSE-JAVA/blob/f972b11ab4c9a18f911bc49a15225a6951cf6f63/src/main/java/COSE/ASN1.java#L103-L131 |
7,832 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/GenericStorableCodec.java | GenericStorableCodec.getInstance | @SuppressWarnings("unchecked")
static synchronized <S extends Storable> GenericStorableCodec<S> getInstance
(GenericStorableCodecFactory factory,
GenericEncodingStrategy<S> encodingStrategy, boolean isMaster,
Layout layout, RawSupport support)
throws SupportException
{
... | java | @SuppressWarnings("unchecked")
static synchronized <S extends Storable> GenericStorableCodec<S> getInstance
(GenericStorableCodecFactory factory,
GenericEncodingStrategy<S> encodingStrategy, boolean isMaster,
Layout layout, RawSupport support)
throws SupportException
{
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"static",
"synchronized",
"<",
"S",
"extends",
"Storable",
">",
"GenericStorableCodec",
"<",
"S",
">",
"getInstance",
"(",
"GenericStorableCodecFactory",
"factory",
",",
"GenericEncodingStrategy",
"<",
"S",
">",
"e... | Returns an instance of the codec. The Storable type itself may be an
interface or a class. If it is a class, then it must not be final, and
it must have a public, no-arg constructor.
@param isMaster when true, version properties and sequences are managed
@param layout when non-null, encode a storable layout generation... | [
"Returns",
"an",
"instance",
"of",
"the",
"codec",
".",
"The",
"Storable",
"type",
"itself",
"may",
"be",
"an",
"interface",
"or",
"a",
"class",
".",
"If",
"it",
"is",
"a",
"class",
"then",
"it",
"must",
"not",
"be",
"final",
"and",
"it",
"must",
"ha... | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/GenericStorableCodec.java#L88-L112 |
7,833 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/GenericStorableCodec.java | GenericStorableCodec.getSearchKeyFactory | @SuppressWarnings("unchecked")
public SearchKeyFactory<S> getSearchKeyFactory(OrderedProperty<S>[] properties) {
// This KeyFactory makes arrays work as hashtable keys.
Object key = KeyFactory.createKey(new Object[] {mCodecKey, properties});
synchronized (cCodecSearchKeyFactories) {
... | java | @SuppressWarnings("unchecked")
public SearchKeyFactory<S> getSearchKeyFactory(OrderedProperty<S>[] properties) {
// This KeyFactory makes arrays work as hashtable keys.
Object key = KeyFactory.createKey(new Object[] {mCodecKey, properties});
synchronized (cCodecSearchKeyFactories) {
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"SearchKeyFactory",
"<",
"S",
">",
"getSearchKeyFactory",
"(",
"OrderedProperty",
"<",
"S",
">",
"[",
"]",
"properties",
")",
"{",
"// This KeyFactory makes arrays work as hashtable keys.\r",
"Object",
"key",... | Returns a search key factory, which is useful for implementing indexes
and queries.
@param properties properties to build the search key from | [
"Returns",
"a",
"search",
"key",
"factory",
"which",
"is",
"useful",
"for",
"implementing",
"indexes",
"and",
"queries",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/GenericStorableCodec.java#L482-L495 |
7,834 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/GenericStorableCodec.java | GenericStorableCodec.getDecoder | @Deprecated
public Decoder<S> getDecoder(int generation) throws FetchNoneException, FetchException {
try {
synchronized (mLayout) {
IntHashMap decoders = mDecoders;
if (decoders == null) {
mDecoders = decoders = new IntHashMap();
... | java | @Deprecated
public Decoder<S> getDecoder(int generation) throws FetchNoneException, FetchException {
try {
synchronized (mLayout) {
IntHashMap decoders = mDecoders;
if (decoders == null) {
mDecoders = decoders = new IntHashMap();
... | [
"@",
"Deprecated",
"public",
"Decoder",
"<",
"S",
">",
"getDecoder",
"(",
"int",
"generation",
")",
"throws",
"FetchNoneException",
",",
"FetchException",
"{",
"try",
"{",
"synchronized",
"(",
"mLayout",
")",
"{",
"IntHashMap",
"decoders",
"=",
"mDecoders",
";... | Returns a data decoder for the given generation.
@throws FetchNoneException if generation is unknown
@deprecated use direct decode method | [
"Returns",
"a",
"data",
"decoder",
"for",
"the",
"given",
"generation",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/GenericStorableCodec.java#L514-L547 |
7,835 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/cursor/ControllerCursor.java | ControllerCursor.apply | public static <S> Cursor<S> apply(Cursor<S> source, Query.Controller controller) {
return controller == null ? source : new ControllerCursor<S>(source, controller);
} | java | public static <S> Cursor<S> apply(Cursor<S> source, Query.Controller controller) {
return controller == null ? source : new ControllerCursor<S>(source, controller);
} | [
"public",
"static",
"<",
"S",
">",
"Cursor",
"<",
"S",
">",
"apply",
"(",
"Cursor",
"<",
"S",
">",
"source",
",",
"Query",
".",
"Controller",
"controller",
")",
"{",
"return",
"controller",
"==",
"null",
"?",
"source",
":",
"new",
"ControllerCursor",
"... | Returns a ControllerCursor depending on whether a controller instance is
passed in or not.
@param controller optional controller which can abort query operation
@throws IllegalArgumentException if source is null | [
"Returns",
"a",
"ControllerCursor",
"depending",
"on",
"whether",
"a",
"controller",
"instance",
"is",
"passed",
"in",
"or",
"not",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/cursor/ControllerCursor.java#L38-L40 |
7,836 | cose-wg/COSE-JAVA | src/main/java/COSE/Attribute.java | Attribute.AddProtected | @Deprecated
public void AddProtected(HeaderKeys label, byte[] value) throws CoseException {
addAttribute(label, value, PROTECTED);
} | java | @Deprecated
public void AddProtected(HeaderKeys label, byte[] value) throws CoseException {
addAttribute(label, value, PROTECTED);
} | [
"@",
"Deprecated",
"public",
"void",
"AddProtected",
"(",
"HeaderKeys",
"label",
",",
"byte",
"[",
"]",
"value",
")",
"throws",
"CoseException",
"{",
"addAttribute",
"(",
"label",
",",
"value",
",",
"PROTECTED",
")",
";",
"}"
] | Set an attribute in the protect bucket of the COSE object
@param label CBOR object which identifies the attribute in the map
@param value byte array of value
@deprecated As of COSE 0.9.0, use addAttribute(HeaderKeys, byte[], Attribute.PROTECTED);
@exception CoseException COSE Package exception | [
"Set",
"an",
"attribute",
"in",
"the",
"protect",
"bucket",
"of",
"the",
"COSE",
"object"
] | f972b11ab4c9a18f911bc49a15225a6951cf6f63 | https://github.com/cose-wg/COSE-JAVA/blob/f972b11ab4c9a18f911bc49a15225a6951cf6f63/src/main/java/COSE/Attribute.java#L205-L208 |
7,837 | cose-wg/COSE-JAVA | src/main/java/COSE/Attribute.java | Attribute.AddUnprotected | @Deprecated
public void AddUnprotected(CBORObject label, CBORObject value) throws CoseException {
addAttribute(label, value, UNPROTECTED);
} | java | @Deprecated
public void AddUnprotected(CBORObject label, CBORObject value) throws CoseException {
addAttribute(label, value, UNPROTECTED);
} | [
"@",
"Deprecated",
"public",
"void",
"AddUnprotected",
"(",
"CBORObject",
"label",
",",
"CBORObject",
"value",
")",
"throws",
"CoseException",
"{",
"addAttribute",
"(",
"label",
",",
"value",
",",
"UNPROTECTED",
")",
";",
"}"
] | Set an attribute in the unprotected bucket of the COSE object
@param label value identifies the attribute in the map
@param value value to be associated with the label
@deprecated As of COSE 0.9.1, use addAttribute(HeaderKeys, byte[], Attribute.UNPROTECTED);
@exception CoseException COSE Package exception | [
"Set",
"an",
"attribute",
"in",
"the",
"unprotected",
"bucket",
"of",
"the",
"COSE",
"object"
] | f972b11ab4c9a18f911bc49a15225a6951cf6f63 | https://github.com/cose-wg/COSE-JAVA/blob/f972b11ab4c9a18f911bc49a15225a6951cf6f63/src/main/java/COSE/Attribute.java#L219-L222 |
7,838 | cose-wg/COSE-JAVA | src/main/java/COSE/Attribute.java | Attribute.removeAttribute | public void removeAttribute(CBORObject label) throws CoseException {
if (objProtected.ContainsKey(label)) {
if (rgbProtected != null) throw new CoseException("Operation would modify integrity protected attributes");
objProtected.Remove(label);
}
if (objUnprotected.Contain... | java | public void removeAttribute(CBORObject label) throws CoseException {
if (objProtected.ContainsKey(label)) {
if (rgbProtected != null) throw new CoseException("Operation would modify integrity protected attributes");
objProtected.Remove(label);
}
if (objUnprotected.Contain... | [
"public",
"void",
"removeAttribute",
"(",
"CBORObject",
"label",
")",
"throws",
"CoseException",
"{",
"if",
"(",
"objProtected",
".",
"ContainsKey",
"(",
"label",
")",
")",
"{",
"if",
"(",
"rgbProtected",
"!=",
"null",
")",
"throw",
"new",
"CoseException",
"... | Remove an attribute from the set of all attribute maps.
@param label attribute to be removed
@exception CoseException if integrity protection would be modified. | [
"Remove",
"an",
"attribute",
"from",
"the",
"set",
"of",
"all",
"attribute",
"maps",
"."
] | f972b11ab4c9a18f911bc49a15225a6951cf6f63 | https://github.com/cose-wg/COSE-JAVA/blob/f972b11ab4c9a18f911bc49a15225a6951cf6f63/src/main/java/COSE/Attribute.java#L334-L341 |
7,839 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/repo/map/Key.java | Key.callSetPropertyValue | private static void callSetPropertyValue(CodeBuilder b, OrderedProperty<?> op) {
StorableProperty<?> property = op.getChainedProperty().getLastProperty();
TypeDesc propType = TypeDesc.forClass(property.getType());
if (propType != TypeDesc.OBJECT) {
TypeDesc objectType = propType.... | java | private static void callSetPropertyValue(CodeBuilder b, OrderedProperty<?> op) {
StorableProperty<?> property = op.getChainedProperty().getLastProperty();
TypeDesc propType = TypeDesc.forClass(property.getType());
if (propType != TypeDesc.OBJECT) {
TypeDesc objectType = propType.... | [
"private",
"static",
"void",
"callSetPropertyValue",
"(",
"CodeBuilder",
"b",
",",
"OrderedProperty",
"<",
"?",
">",
"op",
")",
"{",
"StorableProperty",
"<",
"?",
">",
"property",
"=",
"op",
".",
"getChainedProperty",
"(",
")",
".",
"getLastProperty",
"(",
"... | Creates code to call set method. Assumes Storable and property value
are already on the stack. | [
"Creates",
"code",
"to",
"call",
"set",
"method",
".",
"Assumes",
"Storable",
"and",
"property",
"value",
"are",
"already",
"on",
"the",
"stack",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/repo/map/Key.java#L257-L267 |
7,840 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/repo/replicated/BlobReplicationTrigger.java | BlobReplicationTrigger.create | static <S extends Storable> BlobReplicationTrigger<S> create(Storage<S> masterStorage) {
Map<String, ? extends StorableProperty<S>> properties =
StorableIntrospector.examine(masterStorage.getStorableType()).getDataProperties();
List<String> blobNames = new ArrayList<String>(2);
... | java | static <S extends Storable> BlobReplicationTrigger<S> create(Storage<S> masterStorage) {
Map<String, ? extends StorableProperty<S>> properties =
StorableIntrospector.examine(masterStorage.getStorableType()).getDataProperties();
List<String> blobNames = new ArrayList<String>(2);
... | [
"static",
"<",
"S",
"extends",
"Storable",
">",
"BlobReplicationTrigger",
"<",
"S",
">",
"create",
"(",
"Storage",
"<",
"S",
">",
"masterStorage",
")",
"{",
"Map",
"<",
"String",
",",
"?",
"extends",
"StorableProperty",
"<",
"S",
">",
">",
"properties",
... | Returns null if no Blobs need to be replicated. | [
"Returns",
"null",
"if",
"no",
"Blobs",
"need",
"to",
"be",
"replicated",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/repo/replicated/BlobReplicationTrigger.java#L54-L72 |
7,841 | cose-wg/COSE-JAVA | src/main/java/COSE/Sign1Message.java | Sign1Message.sign | public void sign(OneKey key) throws CoseException {
if (rgbContent == null) throw new CoseException("No Content Specified");
if (rgbSignature != null) return;
if (rgbProtected == null) {
if (objProtected.size() > 0) rgbProtected = objProtected.EncodeToBytes();
else rgbPr... | java | public void sign(OneKey key) throws CoseException {
if (rgbContent == null) throw new CoseException("No Content Specified");
if (rgbSignature != null) return;
if (rgbProtected == null) {
if (objProtected.size() > 0) rgbProtected = objProtected.EncodeToBytes();
else rgbPr... | [
"public",
"void",
"sign",
"(",
"OneKey",
"key",
")",
"throws",
"CoseException",
"{",
"if",
"(",
"rgbContent",
"==",
"null",
")",
"throw",
"new",
"CoseException",
"(",
"\"No Content Specified\"",
")",
";",
"if",
"(",
"rgbSignature",
"!=",
"null",
")",
"return... | Create a signature for the message if one does not exist.
@param key key to use to sign the message
@exception CoseException Errors generated by the COSE module | [
"Create",
"a",
"signature",
"for",
"the",
"message",
"if",
"one",
"does",
"not",
"exist",
"."
] | f972b11ab4c9a18f911bc49a15225a6951cf6f63 | https://github.com/cose-wg/COSE-JAVA/blob/f972b11ab4c9a18f911bc49a15225a6951cf6f63/src/main/java/COSE/Sign1Message.java#L63-L81 |
7,842 | cose-wg/COSE-JAVA | src/main/java/COSE/Sign1Message.java | Sign1Message.validate | public boolean validate(OneKey cnKey) throws CoseException {
CBORObject obj = CBORObject.NewArray();
obj.Add(contextString);
if (objProtected.size() > 0) obj.Add(rgbProtected);
else obj.Add(CBORObject.FromObject(new byte[0]));
obj.Add(externalData);
obj.Add(rgbContent);
... | java | public boolean validate(OneKey cnKey) throws CoseException {
CBORObject obj = CBORObject.NewArray();
obj.Add(contextString);
if (objProtected.size() > 0) obj.Add(rgbProtected);
else obj.Add(CBORObject.FromObject(new byte[0]));
obj.Add(externalData);
obj.Add(rgbContent);
... | [
"public",
"boolean",
"validate",
"(",
"OneKey",
"cnKey",
")",
"throws",
"CoseException",
"{",
"CBORObject",
"obj",
"=",
"CBORObject",
".",
"NewArray",
"(",
")",
";",
"obj",
".",
"Add",
"(",
"contextString",
")",
";",
"if",
"(",
"objProtected",
".",
"size",... | Validate the signature on the message using the passed in key.
@param cnKey key to use for validation
@return true if the signature validates
@throws CoseException Errors generated by the COSE module | [
"Validate",
"the",
"signature",
"on",
"the",
"message",
"using",
"the",
"passed",
"in",
"key",
"."
] | f972b11ab4c9a18f911bc49a15225a6951cf6f63 | https://github.com/cose-wg/COSE-JAVA/blob/f972b11ab4c9a18f911bc49a15225a6951cf6f63/src/main/java/COSE/Sign1Message.java#L91-L99 |
7,843 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/gen/MasterStorableGenerator.java | MasterStorableGenerator.addEnterTransaction | private Label addEnterTransaction(CodeBuilder b, String opType, LocalVariable txnVar) {
if (!alwaysHasTxn(opType)) {
return null;
}
// Repository repo = masterSupport.getRootRepository();
TypeDesc repositoryType = TypeDesc.forClass(Repository.class);
TypeDes... | java | private Label addEnterTransaction(CodeBuilder b, String opType, LocalVariable txnVar) {
if (!alwaysHasTxn(opType)) {
return null;
}
// Repository repo = masterSupport.getRootRepository();
TypeDesc repositoryType = TypeDesc.forClass(Repository.class);
TypeDes... | [
"private",
"Label",
"addEnterTransaction",
"(",
"CodeBuilder",
"b",
",",
"String",
"opType",
",",
"LocalVariable",
"txnVar",
")",
"{",
"if",
"(",
"!",
"alwaysHasTxn",
"(",
"opType",
")",
")",
"{",
"return",
"null",
";",
"}",
"// Repository repo = masterSupport.g... | Generates code to enter a transaction, if required and if none in progress.
@param opType type of operation, Insert, Update, or Delete
@param txnVar required variable of type Transaction for storing transaction
@return optional try start label for transaction | [
"Generates",
"code",
"to",
"enter",
"a",
"transaction",
"if",
"required",
"and",
"if",
"none",
"in",
"progress",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/gen/MasterStorableGenerator.java#L1002-L1063 |
7,844 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/gen/MasterStorableGenerator.java | MasterStorableGenerator.unsetVersionProperty | private void unsetVersionProperty(CodeBuilder b) throws SupportException {
StorableProperty<?> property = mInfo.getVersionProperty();
// Set the property state to uninitialized.
{
String stateFieldName =
StorableGenerator.PROPERTY_STATE_FIELD_NAME + (property.g... | java | private void unsetVersionProperty(CodeBuilder b) throws SupportException {
StorableProperty<?> property = mInfo.getVersionProperty();
// Set the property state to uninitialized.
{
String stateFieldName =
StorableGenerator.PROPERTY_STATE_FIELD_NAME + (property.g... | [
"private",
"void",
"unsetVersionProperty",
"(",
"CodeBuilder",
"b",
")",
"throws",
"SupportException",
"{",
"StorableProperty",
"<",
"?",
">",
"property",
"=",
"mInfo",
".",
"getVersionProperty",
"(",
")",
";",
"// Set the property state to uninitialized.\r",
"{",
"St... | Sets the version property to its initial uninitialized state. | [
"Sets",
"the",
"version",
"property",
"to",
"its",
"initial",
"uninitialized",
"state",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/gen/MasterStorableGenerator.java#L1227-L1248 |
7,845 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/gen/MasterStorableGenerator.java | MasterStorableGenerator.addNormalizationRollback | private void addNormalizationRollback(CodeBuilder b, Label doTryStart,
List<PropertyCopy> unnormalized)
{
if (unnormalized == null) {
return;
}
Label doTryEnd = b.createLabel().setLocation();
b.dup();
Label suc... | java | private void addNormalizationRollback(CodeBuilder b, Label doTryStart,
List<PropertyCopy> unnormalized)
{
if (unnormalized == null) {
return;
}
Label doTryEnd = b.createLabel().setLocation();
b.dup();
Label suc... | [
"private",
"void",
"addNormalizationRollback",
"(",
"CodeBuilder",
"b",
",",
"Label",
"doTryStart",
",",
"List",
"<",
"PropertyCopy",
">",
"unnormalized",
")",
"{",
"if",
"(",
"unnormalized",
"==",
"null",
")",
"{",
"return",
";",
"}",
"Label",
"doTryEnd",
"... | Assumes a boolean is on the stack, as returned by doTryInsert or doTryUpdate. | [
"Assumes",
"a",
"boolean",
"is",
"on",
"the",
"stack",
"as",
"returned",
"by",
"doTryInsert",
"or",
"doTryUpdate",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/gen/MasterStorableGenerator.java#L1329-L1359 |
7,846 | cose-wg/COSE-JAVA | src/main/java/COSE/Encrypt0Message.java | Encrypt0Message.EncodeCBORObject | @Override
protected CBORObject EncodeCBORObject() throws CoseException {
if (rgbEncrypt == null) throw new CoseException("Encrypt function not called");
CBORObject obj = CBORObject.NewArray();
if (objProtected.size() > 0) obj.Add(objProtected.EncodeToBytes());
else obj.Add(C... | java | @Override
protected CBORObject EncodeCBORObject() throws CoseException {
if (rgbEncrypt == null) throw new CoseException("Encrypt function not called");
CBORObject obj = CBORObject.NewArray();
if (objProtected.size() > 0) obj.Add(objProtected.EncodeToBytes());
else obj.Add(C... | [
"@",
"Override",
"protected",
"CBORObject",
"EncodeCBORObject",
"(",
")",
"throws",
"CoseException",
"{",
"if",
"(",
"rgbEncrypt",
"==",
"null",
")",
"throw",
"new",
"CoseException",
"(",
"\"Encrypt function not called\"",
")",
";",
"CBORObject",
"obj",
"=",
"CBOR... | Internal function used to construct the CBORObject
@return the constructed CBORObject
@throws CoseException if the content has not yet been encrypted | [
"Internal",
"function",
"used",
"to",
"construct",
"the",
"CBORObject"
] | f972b11ab4c9a18f911bc49a15225a6951cf6f63 | https://github.com/cose-wg/COSE-JAVA/blob/f972b11ab4c9a18f911bc49a15225a6951cf6f63/src/main/java/COSE/Encrypt0Message.java#L74-L88 |
7,847 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/KeyEncoder.java | KeyEncoder.encodeDesc | public static int encodeDesc(Integer value, byte[] dst, int dstOffset) {
if (value == null) {
dst[dstOffset] = NULL_BYTE_LOW;
return 1;
} else {
dst[dstOffset] = NOT_NULL_BYTE_LOW;
DataEncoder.encode(~value.intValue(), dst, dstOffset + 1);
... | java | public static int encodeDesc(Integer value, byte[] dst, int dstOffset) {
if (value == null) {
dst[dstOffset] = NULL_BYTE_LOW;
return 1;
} else {
dst[dstOffset] = NOT_NULL_BYTE_LOW;
DataEncoder.encode(~value.intValue(), dst, dstOffset + 1);
... | [
"public",
"static",
"int",
"encodeDesc",
"(",
"Integer",
"value",
",",
"byte",
"[",
"]",
"dst",
",",
"int",
"dstOffset",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"dst",
"[",
"dstOffset",
"]",
"=",
"NULL_BYTE_LOW",
";",
"return",
"1",
";"... | Encodes the given signed Integer object into exactly 1 or 5 bytes for
descending order. If the Integer object is never expected to be null,
consider encoding as an int primitive.
@param value optional signed Integer value to encode
@param dst destination for encoded bytes
@param dstOffset offset into destination array... | [
"Encodes",
"the",
"given",
"signed",
"Integer",
"object",
"into",
"exactly",
"1",
"or",
"5",
"bytes",
"for",
"descending",
"order",
".",
"If",
"the",
"Integer",
"object",
"is",
"never",
"expected",
"to",
"be",
"null",
"consider",
"encoding",
"as",
"an",
"i... | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/KeyEncoder.java#L62-L71 |
7,848 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/KeyEncoder.java | KeyEncoder.encodeDesc | public static int encodeDesc(Long value, byte[] dst, int dstOffset) {
if (value == null) {
dst[dstOffset] = NULL_BYTE_LOW;
return 1;
} else {
dst[dstOffset] = NOT_NULL_BYTE_LOW;
DataEncoder.encode(~value.longValue(), dst, dstOffset + 1);
... | java | public static int encodeDesc(Long value, byte[] dst, int dstOffset) {
if (value == null) {
dst[dstOffset] = NULL_BYTE_LOW;
return 1;
} else {
dst[dstOffset] = NOT_NULL_BYTE_LOW;
DataEncoder.encode(~value.longValue(), dst, dstOffset + 1);
... | [
"public",
"static",
"int",
"encodeDesc",
"(",
"Long",
"value",
",",
"byte",
"[",
"]",
"dst",
",",
"int",
"dstOffset",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"dst",
"[",
"dstOffset",
"]",
"=",
"NULL_BYTE_LOW",
";",
"return",
"1",
";",
... | Encodes the given signed Long object into exactly 1 or 9 bytes for
descending order. If the Long object is never expected to be null,
consider encoding as a long primitive.
@param value optional signed Long value to encode
@param dst destination for encoded bytes
@param dstOffset offset into destination array
@return ... | [
"Encodes",
"the",
"given",
"signed",
"Long",
"object",
"into",
"exactly",
"1",
"or",
"9",
"bytes",
"for",
"descending",
"order",
".",
"If",
"the",
"Long",
"object",
"is",
"never",
"expected",
"to",
"be",
"null",
"consider",
"encoding",
"as",
"a",
"long",
... | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/KeyEncoder.java#L94-L103 |
7,849 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/KeyEncoder.java | KeyEncoder.encodeDesc | public static int encodeDesc(Byte value, byte[] dst, int dstOffset) {
if (value == null) {
dst[dstOffset] = NULL_BYTE_LOW;
return 1;
} else {
dst[dstOffset] = NOT_NULL_BYTE_LOW;
dst[dstOffset + 1] = (byte)(value ^ 0x7f);
return 2;
... | java | public static int encodeDesc(Byte value, byte[] dst, int dstOffset) {
if (value == null) {
dst[dstOffset] = NULL_BYTE_LOW;
return 1;
} else {
dst[dstOffset] = NOT_NULL_BYTE_LOW;
dst[dstOffset + 1] = (byte)(value ^ 0x7f);
return 2;
... | [
"public",
"static",
"int",
"encodeDesc",
"(",
"Byte",
"value",
",",
"byte",
"[",
"]",
"dst",
",",
"int",
"dstOffset",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"dst",
"[",
"dstOffset",
"]",
"=",
"NULL_BYTE_LOW",
";",
"return",
"1",
";",
... | Encodes the given signed Byte object into exactly 1 or 2 bytes for
descending order. If the Byte object is never expected to be null,
consider encoding as a byte primitive.
@param value optional signed Byte value to encode
@param dst destination for encoded bytes
@param dstOffset offset into destination array
@return ... | [
"Encodes",
"the",
"given",
"signed",
"Byte",
"object",
"into",
"exactly",
"1",
"or",
"2",
"bytes",
"for",
"descending",
"order",
".",
"If",
"the",
"Byte",
"object",
"is",
"never",
"expected",
"to",
"be",
"null",
"consider",
"encoding",
"as",
"a",
"byte",
... | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/KeyEncoder.java#L126-L135 |
7,850 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/KeyEncoder.java | KeyEncoder.encodeDesc | public static int encodeDesc(Short value, byte[] dst, int dstOffset) {
if (value == null) {
dst[dstOffset] = NULL_BYTE_LOW;
return 1;
} else {
dst[dstOffset] = NOT_NULL_BYTE_LOW;
DataEncoder.encode((short) ~value.shortValue(), dst, dstOffset + 1);
... | java | public static int encodeDesc(Short value, byte[] dst, int dstOffset) {
if (value == null) {
dst[dstOffset] = NULL_BYTE_LOW;
return 1;
} else {
dst[dstOffset] = NOT_NULL_BYTE_LOW;
DataEncoder.encode((short) ~value.shortValue(), dst, dstOffset + 1);
... | [
"public",
"static",
"int",
"encodeDesc",
"(",
"Short",
"value",
",",
"byte",
"[",
"]",
"dst",
",",
"int",
"dstOffset",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"dst",
"[",
"dstOffset",
"]",
"=",
"NULL_BYTE_LOW",
";",
"return",
"1",
";",
... | Encodes the given signed Short object into exactly 1 or 3 bytes for
descending order. If the Short object is never expected to be null,
consider encoding as a short primitive.
@param value optional signed Short value to encode
@param dst destination for encoded bytes
@param dstOffset offset into destination array
@ret... | [
"Encodes",
"the",
"given",
"signed",
"Short",
"object",
"into",
"exactly",
"1",
"or",
"3",
"bytes",
"for",
"descending",
"order",
".",
"If",
"the",
"Short",
"object",
"is",
"never",
"expected",
"to",
"be",
"null",
"consider",
"encoding",
"as",
"a",
"short"... | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/KeyEncoder.java#L159-L168 |
7,851 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/KeyEncoder.java | KeyEncoder.encodeDesc | public static int encodeDesc(Character value, byte[] dst, int dstOffset) {
if (value == null) {
dst[dstOffset] = NULL_BYTE_LOW;
return 1;
} else {
dst[dstOffset] = NOT_NULL_BYTE_LOW;
DataEncoder.encode((char) ~value.charValue(), dst, dstOffset + 1);
... | java | public static int encodeDesc(Character value, byte[] dst, int dstOffset) {
if (value == null) {
dst[dstOffset] = NULL_BYTE_LOW;
return 1;
} else {
dst[dstOffset] = NOT_NULL_BYTE_LOW;
DataEncoder.encode((char) ~value.charValue(), dst, dstOffset + 1);
... | [
"public",
"static",
"int",
"encodeDesc",
"(",
"Character",
"value",
",",
"byte",
"[",
"]",
"dst",
",",
"int",
"dstOffset",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"dst",
"[",
"dstOffset",
"]",
"=",
"NULL_BYTE_LOW",
";",
"return",
"1",
"... | Encodes the given Character object into exactly 1 or 3 bytes for
descending order. If the Character object is never expected to be null,
consider encoding as a char primitive.
@param value optional Character value to encode
@param dst destination for encoded bytes
@param dstOffset offset into destination array
@return... | [
"Encodes",
"the",
"given",
"Character",
"object",
"into",
"exactly",
"1",
"or",
"3",
"bytes",
"for",
"descending",
"order",
".",
"If",
"the",
"Character",
"object",
"is",
"never",
"expected",
"to",
"be",
"null",
"consider",
"encoding",
"as",
"a",
"char",
"... | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/KeyEncoder.java#L191-L200 |
7,852 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/KeyEncoder.java | KeyEncoder.encodeDesc | public static void encodeDesc(Boolean value, byte[] dst, int dstOffset) {
if (value == null) {
dst[dstOffset] = NULL_BYTE_LOW;
} else {
dst[dstOffset] = value.booleanValue() ? (byte)127 : (byte)128;
}
} | java | public static void encodeDesc(Boolean value, byte[] dst, int dstOffset) {
if (value == null) {
dst[dstOffset] = NULL_BYTE_LOW;
} else {
dst[dstOffset] = value.booleanValue() ? (byte)127 : (byte)128;
}
} | [
"public",
"static",
"void",
"encodeDesc",
"(",
"Boolean",
"value",
",",
"byte",
"[",
"]",
"dst",
",",
"int",
"dstOffset",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"dst",
"[",
"dstOffset",
"]",
"=",
"NULL_BYTE_LOW",
";",
"}",
"else",
"{",... | Encodes the given Boolean object into exactly 1 byte for descending
order.
@param value optional Boolean value to encode
@param dst destination for encoded bytes
@param dstOffset offset into destination array | [
"Encodes",
"the",
"given",
"Boolean",
"object",
"into",
"exactly",
"1",
"byte",
"for",
"descending",
"order",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/KeyEncoder.java#L221-L227 |
7,853 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/KeyEncoder.java | KeyEncoder.encodeDesc | public static void encodeDesc(float value, byte[] dst, int dstOffset) {
int bits = Float.floatToIntBits(value);
if (bits >= 0) {
bits ^= 0x7fffffff;
}
dst[dstOffset ] = (byte)(bits >> 24);
dst[dstOffset + 1] = (byte)(bits >> 16);
dst[dstOffset + 2] =... | java | public static void encodeDesc(float value, byte[] dst, int dstOffset) {
int bits = Float.floatToIntBits(value);
if (bits >= 0) {
bits ^= 0x7fffffff;
}
dst[dstOffset ] = (byte)(bits >> 24);
dst[dstOffset + 1] = (byte)(bits >> 16);
dst[dstOffset + 2] =... | [
"public",
"static",
"void",
"encodeDesc",
"(",
"float",
"value",
",",
"byte",
"[",
"]",
"dst",
",",
"int",
"dstOffset",
")",
"{",
"int",
"bits",
"=",
"Float",
".",
"floatToIntBits",
"(",
"value",
")",
";",
"if",
"(",
"bits",
">=",
"0",
")",
"{",
"b... | Encodes the given float into exactly 4 bytes for descending order.
@param value float value to encode
@param dst destination for encoded bytes
@param dstOffset offset into destination array | [
"Encodes",
"the",
"given",
"float",
"into",
"exactly",
"4",
"bytes",
"for",
"descending",
"order",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/KeyEncoder.java#L236-L245 |
7,854 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/KeyEncoder.java | KeyEncoder.encodeDesc | public static void encodeDesc(Float value, byte[] dst, int dstOffset) {
if (value == null) {
DataEncoder.encode(~0x7fffffff, dst, dstOffset);
} else {
encodeDesc(value.floatValue(), dst, dstOffset);
}
} | java | public static void encodeDesc(Float value, byte[] dst, int dstOffset) {
if (value == null) {
DataEncoder.encode(~0x7fffffff, dst, dstOffset);
} else {
encodeDesc(value.floatValue(), dst, dstOffset);
}
} | [
"public",
"static",
"void",
"encodeDesc",
"(",
"Float",
"value",
",",
"byte",
"[",
"]",
"dst",
",",
"int",
"dstOffset",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"DataEncoder",
".",
"encode",
"(",
"~",
"0x7fffffff",
",",
"dst",
",",
"dstO... | Encodes the given Float object into exactly 4 bytes for descending
order. A non-canonical NaN value is used to represent null.
@param value optional Float value to encode
@param dst destination for encoded bytes
@param dstOffset offset into destination array | [
"Encodes",
"the",
"given",
"Float",
"object",
"into",
"exactly",
"4",
"bytes",
"for",
"descending",
"order",
".",
"A",
"non",
"-",
"canonical",
"NaN",
"value",
"is",
"used",
"to",
"represent",
"null",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/KeyEncoder.java#L255-L261 |
7,855 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/KeyEncoder.java | KeyEncoder.encodeDesc | public static void encodeDesc(double value, byte[] dst, int dstOffset) {
long bits = Double.doubleToLongBits(value);
if (bits >= 0) {
bits ^= 0x7fffffffffffffffL;
}
int w = (int)(bits >> 32);
dst[dstOffset ] = (byte)(w >> 24);
dst[dstOffset + 1] = (b... | java | public static void encodeDesc(double value, byte[] dst, int dstOffset) {
long bits = Double.doubleToLongBits(value);
if (bits >= 0) {
bits ^= 0x7fffffffffffffffL;
}
int w = (int)(bits >> 32);
dst[dstOffset ] = (byte)(w >> 24);
dst[dstOffset + 1] = (b... | [
"public",
"static",
"void",
"encodeDesc",
"(",
"double",
"value",
",",
"byte",
"[",
"]",
"dst",
",",
"int",
"dstOffset",
")",
"{",
"long",
"bits",
"=",
"Double",
".",
"doubleToLongBits",
"(",
"value",
")",
";",
"if",
"(",
"bits",
">=",
"0",
")",
"{",... | Encodes the given double into exactly 8 bytes for descending order.
@param value double value to encode
@param dst destination for encoded bytes
@param dstOffset offset into destination array | [
"Encodes",
"the",
"given",
"double",
"into",
"exactly",
"8",
"bytes",
"for",
"descending",
"order",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/KeyEncoder.java#L270-L285 |
7,856 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/KeyEncoder.java | KeyEncoder.encodeDesc | public static void encodeDesc(Double value, byte[] dst, int dstOffset) {
if (value == null) {
DataEncoder.encode(~0x7fffffffffffffffL, dst, dstOffset);
} else {
encodeDesc(value.doubleValue(), dst, dstOffset);
}
} | java | public static void encodeDesc(Double value, byte[] dst, int dstOffset) {
if (value == null) {
DataEncoder.encode(~0x7fffffffffffffffL, dst, dstOffset);
} else {
encodeDesc(value.doubleValue(), dst, dstOffset);
}
} | [
"public",
"static",
"void",
"encodeDesc",
"(",
"Double",
"value",
",",
"byte",
"[",
"]",
"dst",
",",
"int",
"dstOffset",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"DataEncoder",
".",
"encode",
"(",
"~",
"0x7fffffffffffffff",
"L",
",",
"dst"... | Encodes the given Double object into exactly 8 bytes for descending
order. A non-canonical NaN value is used to represent null.
@param value optional Double value to encode
@param dst destination for encoded bytes
@param dstOffset offset into destination array | [
"Encodes",
"the",
"given",
"Double",
"object",
"into",
"exactly",
"8",
"bytes",
"for",
"descending",
"order",
".",
"A",
"non",
"-",
"canonical",
"NaN",
"value",
"is",
"used",
"to",
"represent",
"null",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/KeyEncoder.java#L295-L301 |
7,857 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/KeyEncoder.java | KeyEncoder.encodeDesc | public static int encodeDesc(BigInteger value, byte[] dst, int dstOffset) {
/* Encoding of first byte:
0x00: null high (unused)
0x01: positive signum; four bytes follow for value length
0x02..0x7f: positive signum; value length 7e range, 1..126
0x80..0xfd: nega... | java | public static int encodeDesc(BigInteger value, byte[] dst, int dstOffset) {
/* Encoding of first byte:
0x00: null high (unused)
0x01: positive signum; four bytes follow for value length
0x02..0x7f: positive signum; value length 7e range, 1..126
0x80..0xfd: nega... | [
"public",
"static",
"int",
"encodeDesc",
"(",
"BigInteger",
"value",
",",
"byte",
"[",
"]",
"dst",
",",
"int",
"dstOffset",
")",
"{",
"/* Encoding of first byte:\r\n\r\n 0x00: null high (unused)\r\n 0x01: positive signum; four bytes follow for value length... | Encodes the given optional BigInteger into a variable amount of bytes
for descending order. If the BigInteger is null, exactly 1 byte is
written. Otherwise, the amount written can be determined by calling
calculateEncodedLength.
@param value BigInteger value to encode, may be null
@param dst destination for encoded by... | [
"Encodes",
"the",
"given",
"optional",
"BigInteger",
"into",
"a",
"variable",
"amount",
"of",
"bytes",
"for",
"descending",
"order",
".",
"If",
"the",
"BigInteger",
"is",
"null",
"exactly",
"1",
"byte",
"is",
"written",
".",
"Otherwise",
"the",
"amount",
"wr... | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/KeyEncoder.java#L366-L407 |
7,858 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/KeyEncoder.java | KeyEncoder.calculateEncodedLength | public static int calculateEncodedLength(BigInteger value) {
if (value == null) {
return 1;
}
int bytesLength = (value.bitLength() >> 3) + 1;
return bytesLength < 0x7f ? (1 + bytesLength) : (5 + bytesLength);
} | java | public static int calculateEncodedLength(BigInteger value) {
if (value == null) {
return 1;
}
int bytesLength = (value.bitLength() >> 3) + 1;
return bytesLength < 0x7f ? (1 + bytesLength) : (5 + bytesLength);
} | [
"public",
"static",
"int",
"calculateEncodedLength",
"(",
"BigInteger",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"1",
";",
"}",
"int",
"bytesLength",
"=",
"(",
"value",
".",
"bitLength",
"(",
")",
">>",
"3",
")",
"+",
... | Returns the amount of bytes required to encode a BigInteger.
@param value BigInteger value to encode, may be null
@return amount of bytes needed to encode
@since 1.2 | [
"Returns",
"the",
"amount",
"of",
"bytes",
"required",
"to",
"encode",
"a",
"BigInteger",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/KeyEncoder.java#L416-L422 |
7,859 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/KeyEncoder.java | KeyEncoder.encodeDesc | public static int encodeDesc(BigDecimal value, byte[] dst, int dstOffset) {
if (value == null) {
dst[dstOffset] = NULL_BYTE_LOW;
return 1;
}
if (value.signum() == 0) {
dst[dstOffset] = (byte) 0x7f;
return 1;
}
return en... | java | public static int encodeDesc(BigDecimal value, byte[] dst, int dstOffset) {
if (value == null) {
dst[dstOffset] = NULL_BYTE_LOW;
return 1;
}
if (value.signum() == 0) {
dst[dstOffset] = (byte) 0x7f;
return 1;
}
return en... | [
"public",
"static",
"int",
"encodeDesc",
"(",
"BigDecimal",
"value",
",",
"byte",
"[",
"]",
"dst",
",",
"int",
"dstOffset",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"dst",
"[",
"dstOffset",
"]",
"=",
"NULL_BYTE_LOW",
";",
"return",
"1",
... | Encodes the given optional BigDecimal into a variable amount of bytes
for descending order. If the BigDecimal is null, exactly 1 byte is
written. Otherwise, the amount written can be determined by calling
calculateEncodedLength.
<p><i>Note:</i> It is recommended that value be normalized by stripping
trailing zeros. Th... | [
"Encodes",
"the",
"given",
"optional",
"BigDecimal",
"into",
"a",
"variable",
"amount",
"of",
"bytes",
"for",
"descending",
"order",
".",
"If",
"the",
"BigDecimal",
"is",
"null",
"exactly",
"1",
"byte",
"is",
"written",
".",
"Otherwise",
"the",
"amount",
"wr... | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/KeyEncoder.java#L467-L479 |
7,860 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/KeyEncoder.java | KeyEncoder.calculateEncodedLength | public static int calculateEncodedLength(BigDecimal value) {
if (value == null || value.signum() == 0) {
return 1;
}
return encode(value).mLength;
} | java | public static int calculateEncodedLength(BigDecimal value) {
if (value == null || value.signum() == 0) {
return 1;
}
return encode(value).mLength;
} | [
"public",
"static",
"int",
"calculateEncodedLength",
"(",
"BigDecimal",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
"||",
"value",
".",
"signum",
"(",
")",
"==",
"0",
")",
"{",
"return",
"1",
";",
"}",
"return",
"encode",
"(",
"value",
")",
... | Returns the amount of bytes required to encode a BigDecimal.
<p><i>Note:</i> It is recommended that value be normalized by stripping
trailing zeros. This makes searching by value much simpler.
@param value BigDecimal value to encode, may be null
@return amount of bytes needed to encode
@since 1.2 | [
"Returns",
"the",
"amount",
"of",
"bytes",
"required",
"to",
"encode",
"a",
"BigDecimal",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/KeyEncoder.java#L491-L497 |
7,861 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/KeyEncoder.java | KeyEncoder.encode | public static int encode(byte[] value, int valueOffset, int valueLength,
byte[] dst, int dstOffset) {
return encode(value, valueOffset, valueLength, dst, dstOffset, 0);
} | java | public static int encode(byte[] value, int valueOffset, int valueLength,
byte[] dst, int dstOffset) {
return encode(value, valueOffset, valueLength, dst, dstOffset, 0);
} | [
"public",
"static",
"int",
"encode",
"(",
"byte",
"[",
"]",
"value",
",",
"int",
"valueOffset",
",",
"int",
"valueLength",
",",
"byte",
"[",
"]",
"dst",
",",
"int",
"dstOffset",
")",
"{",
"return",
"encode",
"(",
"value",
",",
"valueOffset",
",",
"valu... | Encodes the given optional unsigned byte array into a variable amount of
bytes. If the byte array is null, exactly 1 byte is written. Otherwise,
the amount written can be determined by calling calculateEncodedLength.
@param value byte array value to encode, may be null
@param valueOffset offset into byte array
@param ... | [
"Encodes",
"the",
"given",
"optional",
"unsigned",
"byte",
"array",
"into",
"a",
"variable",
"amount",
"of",
"bytes",
".",
"If",
"the",
"byte",
"array",
"is",
"null",
"exactly",
"1",
"byte",
"is",
"written",
".",
"Otherwise",
"the",
"amount",
"written",
"c... | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/KeyEncoder.java#L712-L715 |
7,862 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/KeyEncoder.java | KeyEncoder.encodeDesc | public static int encodeDesc(byte[] value, byte[] dst, int dstOffset) {
if (value == null) {
dst[dstOffset] = NULL_BYTE_LOW;
return 1;
}
return encode(value, 0, value.length, dst, dstOffset, -1);
} | java | public static int encodeDesc(byte[] value, byte[] dst, int dstOffset) {
if (value == null) {
dst[dstOffset] = NULL_BYTE_LOW;
return 1;
}
return encode(value, 0, value.length, dst, dstOffset, -1);
} | [
"public",
"static",
"int",
"encodeDesc",
"(",
"byte",
"[",
"]",
"value",
",",
"byte",
"[",
"]",
"dst",
",",
"int",
"dstOffset",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"dst",
"[",
"dstOffset",
"]",
"=",
"NULL_BYTE_LOW",
";",
"return",
... | Encodes the given optional unsigned byte array into a variable amount of
bytes for descending order. If the byte array is null, exactly 1 byte is
written. Otherwise, the amount written is determined by calling
calculateEncodedLength.
@param value byte array value to encode, may be null
@param dst destination for encod... | [
"Encodes",
"the",
"given",
"optional",
"unsigned",
"byte",
"array",
"into",
"a",
"variable",
"amount",
"of",
"bytes",
"for",
"descending",
"order",
".",
"If",
"the",
"byte",
"array",
"is",
"null",
"exactly",
"1",
"byte",
"is",
"written",
".",
"Otherwise",
... | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/KeyEncoder.java#L728-L734 |
7,863 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/KeyEncoder.java | KeyEncoder.emitDigit | private static void emitDigit(int value, byte[] dst, int dstOffset, int xorMask) {
// The first byte is computed as ((value / 192) + 32) and the second
// byte is computed as ((value % 192) + 32). To speed things up a bit,
// the integer division and remainder operations are replaced with a
... | java | private static void emitDigit(int value, byte[] dst, int dstOffset, int xorMask) {
// The first byte is computed as ((value / 192) + 32) and the second
// byte is computed as ((value % 192) + 32). To speed things up a bit,
// the integer division and remainder operations are replaced with a
... | [
"private",
"static",
"void",
"emitDigit",
"(",
"int",
"value",
",",
"byte",
"[",
"]",
"dst",
",",
"int",
"dstOffset",
",",
"int",
"xorMask",
")",
"{",
"// The first byte is computed as ((value / 192) + 32) and the second\r",
"// byte is computed as ((value % 192) + 32). To ... | Emits a base-32768 digit using exactly two bytes. The first byte is in the range
32..202 and the second byte is in the range 32..223.
@param value digit value in the range 0..32767
@param dst destination for encoded bytes
@param dstOffset offset into destination array
@param xorMask 0 for normal encoding, -1 for desce... | [
"Emits",
"a",
"base",
"-",
"32768",
"digit",
"using",
"exactly",
"two",
"bytes",
".",
"The",
"first",
"byte",
"is",
"in",
"the",
"range",
"32",
"..",
"202",
"and",
"the",
"second",
"byte",
"is",
"in",
"the",
"range",
"32",
"..",
"223",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/KeyEncoder.java#L826-L847 |
7,864 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/KeyEncoder.java | KeyEncoder.calculateEncodedStringLength | public static int calculateEncodedStringLength(String value) {
int encodedLen = 1;
if (value != null) {
int valueLength = value.length();
for (int i = 0; i < valueLength; i++) {
int c = value.charAt(i);
if (c <= (0x7f - 2)) {
... | java | public static int calculateEncodedStringLength(String value) {
int encodedLen = 1;
if (value != null) {
int valueLength = value.length();
for (int i = 0; i < valueLength; i++) {
int c = value.charAt(i);
if (c <= (0x7f - 2)) {
... | [
"public",
"static",
"int",
"calculateEncodedStringLength",
"(",
"String",
"value",
")",
"{",
"int",
"encodedLen",
"=",
"1",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"int",
"valueLength",
"=",
"value",
".",
"length",
"(",
")",
";",
"for",
"(",
"... | Returns the amount of bytes required to encode the given String.
@param value String to encode, may be null | [
"Returns",
"the",
"amount",
"of",
"bytes",
"required",
"to",
"encode",
"the",
"given",
"String",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/KeyEncoder.java#L1015-L1041 |
7,865 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/KeyEncoder.java | KeyEncoder.encodeSingleDesc | public static byte[] encodeSingleDesc(byte[] value, int prefixPadding, int suffixPadding) {
int length = value.length;
if (prefixPadding <= 0 && suffixPadding <= 0 && length == 0) {
return value;
}
byte[] dst = new byte[prefixPadding + length + suffixPadding];
w... | java | public static byte[] encodeSingleDesc(byte[] value, int prefixPadding, int suffixPadding) {
int length = value.length;
if (prefixPadding <= 0 && suffixPadding <= 0 && length == 0) {
return value;
}
byte[] dst = new byte[prefixPadding + length + suffixPadding];
w... | [
"public",
"static",
"byte",
"[",
"]",
"encodeSingleDesc",
"(",
"byte",
"[",
"]",
"value",
",",
"int",
"prefixPadding",
",",
"int",
"suffixPadding",
")",
"{",
"int",
"length",
"=",
"value",
".",
"length",
";",
"if",
"(",
"prefixPadding",
"<=",
"0",
"&&",
... | Encodes the given byte array for use when there is only a single
required property, descending order, whose type is a byte array. The
original byte array is returned if the length and padding lengths are
zero.
@param prefixPadding amount of extra bytes to allocate at start of encoded byte array
@param suffixPadding am... | [
"Encodes",
"the",
"given",
"byte",
"array",
"for",
"use",
"when",
"there",
"is",
"only",
"a",
"single",
"required",
"property",
"descending",
"order",
"whose",
"type",
"is",
"a",
"byte",
"array",
".",
"The",
"original",
"byte",
"array",
"is",
"returned",
"... | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/KeyEncoder.java#L1061-L1071 |
7,866 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/KeyEncoder.java | KeyEncoder.encodeSingleNullableDesc | public static byte[] encodeSingleNullableDesc(byte[] value,
int prefixPadding, int suffixPadding) {
if (prefixPadding <= 0 && suffixPadding <= 0) {
if (value == null) {
return new byte[] {NULL_BYTE_LOW};
}
... | java | public static byte[] encodeSingleNullableDesc(byte[] value,
int prefixPadding, int suffixPadding) {
if (prefixPadding <= 0 && suffixPadding <= 0) {
if (value == null) {
return new byte[] {NULL_BYTE_LOW};
}
... | [
"public",
"static",
"byte",
"[",
"]",
"encodeSingleNullableDesc",
"(",
"byte",
"[",
"]",
"value",
",",
"int",
"prefixPadding",
",",
"int",
"suffixPadding",
")",
"{",
"if",
"(",
"prefixPadding",
"<=",
"0",
"&&",
"suffixPadding",
"<=",
"0",
")",
"{",
"if",
... | Encodes the given byte array for use when there is only a single
nullable property, descending order, whose type is a byte array.
@param prefixPadding amount of extra bytes to allocate at start of encoded byte array
@param suffixPadding amount of extra bytes to allocate at end of encoded byte array | [
"Encodes",
"the",
"given",
"byte",
"array",
"for",
"use",
"when",
"there",
"is",
"only",
"a",
"single",
"nullable",
"property",
"descending",
"order",
"whose",
"type",
"is",
"a",
"byte",
"array",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/KeyEncoder.java#L1088-L1121 |
7,867 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/DataEncoder.java | DataEncoder.encode | public static void encode(int value, byte[] dst, int dstOffset) {
value ^= 0x80000000;
dst[dstOffset ] = (byte)(value >> 24);
dst[dstOffset + 1] = (byte)(value >> 16);
dst[dstOffset + 2] = (byte)(value >> 8);
dst[dstOffset + 3] = (byte)value;
} | java | public static void encode(int value, byte[] dst, int dstOffset) {
value ^= 0x80000000;
dst[dstOffset ] = (byte)(value >> 24);
dst[dstOffset + 1] = (byte)(value >> 16);
dst[dstOffset + 2] = (byte)(value >> 8);
dst[dstOffset + 3] = (byte)value;
} | [
"public",
"static",
"void",
"encode",
"(",
"int",
"value",
",",
"byte",
"[",
"]",
"dst",
",",
"int",
"dstOffset",
")",
"{",
"value",
"^=",
"0x80000000",
";",
"dst",
"[",
"dstOffset",
"]",
"=",
"(",
"byte",
")",
"(",
"value",
">>",
"24",
")",
";",
... | Encodes the given signed integer into exactly 4 bytes.
@param value signed integer value to encode
@param dst destination for encoded bytes
@param dstOffset offset into destination array | [
"Encodes",
"the",
"given",
"signed",
"integer",
"into",
"exactly",
"4",
"bytes",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/DataEncoder.java#L47-L53 |
7,868 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/DataEncoder.java | DataEncoder.encode | public static int encode(Integer value, byte[] dst, int dstOffset) {
if (value == null) {
dst[dstOffset] = NULL_BYTE_HIGH;
return 1;
} else {
dst[dstOffset] = NOT_NULL_BYTE_HIGH;
encode(value.intValue(), dst, dstOffset + 1);
return 5;
... | java | public static int encode(Integer value, byte[] dst, int dstOffset) {
if (value == null) {
dst[dstOffset] = NULL_BYTE_HIGH;
return 1;
} else {
dst[dstOffset] = NOT_NULL_BYTE_HIGH;
encode(value.intValue(), dst, dstOffset + 1);
return 5;
... | [
"public",
"static",
"int",
"encode",
"(",
"Integer",
"value",
",",
"byte",
"[",
"]",
"dst",
",",
"int",
"dstOffset",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"dst",
"[",
"dstOffset",
"]",
"=",
"NULL_BYTE_HIGH",
";",
"return",
"1",
";",
... | Encodes the given signed Integer object into exactly 1 or 5 bytes. If
the Integer object is never expected to be null, consider encoding as an
int primitive.
@param value optional signed Integer value to encode
@param dst destination for encoded bytes
@param dstOffset offset into destination array
@return amount of by... | [
"Encodes",
"the",
"given",
"signed",
"Integer",
"object",
"into",
"exactly",
"1",
"or",
"5",
"bytes",
".",
"If",
"the",
"Integer",
"object",
"is",
"never",
"expected",
"to",
"be",
"null",
"consider",
"encoding",
"as",
"an",
"int",
"primitive",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/DataEncoder.java#L65-L74 |
7,869 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/DataEncoder.java | DataEncoder.encode | public static void encode(long value, byte[] dst, int dstOffset) {
int w = ((int)(value >> 32)) ^ 0x80000000;
dst[dstOffset ] = (byte)(w >> 24);
dst[dstOffset + 1] = (byte)(w >> 16);
dst[dstOffset + 2] = (byte)(w >> 8);
dst[dstOffset + 3] = (byte)w;
w = (int)valu... | java | public static void encode(long value, byte[] dst, int dstOffset) {
int w = ((int)(value >> 32)) ^ 0x80000000;
dst[dstOffset ] = (byte)(w >> 24);
dst[dstOffset + 1] = (byte)(w >> 16);
dst[dstOffset + 2] = (byte)(w >> 8);
dst[dstOffset + 3] = (byte)w;
w = (int)valu... | [
"public",
"static",
"void",
"encode",
"(",
"long",
"value",
",",
"byte",
"[",
"]",
"dst",
",",
"int",
"dstOffset",
")",
"{",
"int",
"w",
"=",
"(",
"(",
"int",
")",
"(",
"value",
">>",
"32",
")",
")",
"^",
"0x80000000",
";",
"dst",
"[",
"dstOffset... | Encodes the given signed long into exactly 8 bytes.
@param value signed long value to encode
@param dst destination for encoded bytes
@param dstOffset offset into destination array | [
"Encodes",
"the",
"given",
"signed",
"long",
"into",
"exactly",
"8",
"bytes",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/DataEncoder.java#L83-L94 |
7,870 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/DataEncoder.java | DataEncoder.encode | public static int encode(Long value, byte[] dst, int dstOffset) {
if (value == null) {
dst[dstOffset] = NULL_BYTE_HIGH;
return 1;
} else {
dst[dstOffset] = NOT_NULL_BYTE_HIGH;
encode(value.longValue(), dst, dstOffset + 1);
return 9;
... | java | public static int encode(Long value, byte[] dst, int dstOffset) {
if (value == null) {
dst[dstOffset] = NULL_BYTE_HIGH;
return 1;
} else {
dst[dstOffset] = NOT_NULL_BYTE_HIGH;
encode(value.longValue(), dst, dstOffset + 1);
return 9;
... | [
"public",
"static",
"int",
"encode",
"(",
"Long",
"value",
",",
"byte",
"[",
"]",
"dst",
",",
"int",
"dstOffset",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"dst",
"[",
"dstOffset",
"]",
"=",
"NULL_BYTE_HIGH",
";",
"return",
"1",
";",
"}... | Encodes the given signed Long object into exactly 1 or 9 bytes. If the
Long object is never expected to be null, consider encoding as a long
primitive.
@param value optional signed Long value to encode
@param dst destination for encoded bytes
@param dstOffset offset into destination array
@return amount of bytes writt... | [
"Encodes",
"the",
"given",
"signed",
"Long",
"object",
"into",
"exactly",
"1",
"or",
"9",
"bytes",
".",
"If",
"the",
"Long",
"object",
"is",
"never",
"expected",
"to",
"be",
"null",
"consider",
"encoding",
"as",
"a",
"long",
"primitive",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/DataEncoder.java#L106-L115 |
7,871 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/DataEncoder.java | DataEncoder.encode | public static int encode(Byte value, byte[] dst, int dstOffset) {
if (value == null) {
dst[dstOffset] = NULL_BYTE_HIGH;
return 1;
} else {
dst[dstOffset] = NOT_NULL_BYTE_HIGH;
dst[dstOffset + 1] = (byte)(value ^ 0x80);
return 2;
... | java | public static int encode(Byte value, byte[] dst, int dstOffset) {
if (value == null) {
dst[dstOffset] = NULL_BYTE_HIGH;
return 1;
} else {
dst[dstOffset] = NOT_NULL_BYTE_HIGH;
dst[dstOffset + 1] = (byte)(value ^ 0x80);
return 2;
... | [
"public",
"static",
"int",
"encode",
"(",
"Byte",
"value",
",",
"byte",
"[",
"]",
"dst",
",",
"int",
"dstOffset",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"dst",
"[",
"dstOffset",
"]",
"=",
"NULL_BYTE_HIGH",
";",
"return",
"1",
";",
"}... | Encodes the given signed Byte object into exactly 1 or 2 bytes. If the
Byte object is never expected to be null, consider encoding as a byte
primitive.
@param value optional signed Byte value to encode
@param dst destination for encoded bytes
@param dstOffset offset into destination array
@return amount of bytes writt... | [
"Encodes",
"the",
"given",
"signed",
"Byte",
"object",
"into",
"exactly",
"1",
"or",
"2",
"bytes",
".",
"If",
"the",
"Byte",
"object",
"is",
"never",
"expected",
"to",
"be",
"null",
"consider",
"encoding",
"as",
"a",
"byte",
"primitive",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/DataEncoder.java#L138-L147 |
7,872 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/DataEncoder.java | DataEncoder.encode | public static void encode(short value, byte[] dst, int dstOffset) {
value ^= 0x8000;
dst[dstOffset ] = (byte)(value >> 8);
dst[dstOffset + 1] = (byte)value;
} | java | public static void encode(short value, byte[] dst, int dstOffset) {
value ^= 0x8000;
dst[dstOffset ] = (byte)(value >> 8);
dst[dstOffset + 1] = (byte)value;
} | [
"public",
"static",
"void",
"encode",
"(",
"short",
"value",
",",
"byte",
"[",
"]",
"dst",
",",
"int",
"dstOffset",
")",
"{",
"value",
"^=",
"0x8000",
";",
"dst",
"[",
"dstOffset",
"]",
"=",
"(",
"byte",
")",
"(",
"value",
">>",
"8",
")",
";",
"d... | Encodes the given signed short into exactly 2 bytes.
@param value signed short value to encode
@param dst destination for encoded bytes
@param dstOffset offset into destination array | [
"Encodes",
"the",
"given",
"signed",
"short",
"into",
"exactly",
"2",
"bytes",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/DataEncoder.java#L156-L160 |
7,873 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/DataEncoder.java | DataEncoder.encode | public static int encode(Short value, byte[] dst, int dstOffset) {
if (value == null) {
dst[dstOffset] = NULL_BYTE_HIGH;
return 1;
} else {
dst[dstOffset] = NOT_NULL_BYTE_HIGH;
encode(value.shortValue(), dst, dstOffset + 1);
return 3;
... | java | public static int encode(Short value, byte[] dst, int dstOffset) {
if (value == null) {
dst[dstOffset] = NULL_BYTE_HIGH;
return 1;
} else {
dst[dstOffset] = NOT_NULL_BYTE_HIGH;
encode(value.shortValue(), dst, dstOffset + 1);
return 3;
... | [
"public",
"static",
"int",
"encode",
"(",
"Short",
"value",
",",
"byte",
"[",
"]",
"dst",
",",
"int",
"dstOffset",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"dst",
"[",
"dstOffset",
"]",
"=",
"NULL_BYTE_HIGH",
";",
"return",
"1",
";",
"... | Encodes the given signed Short object into exactly 1 or 3 bytes. If the
Short object is never expected to be null, consider encoding as a short
primitive.
@param value optional signed Short value to encode
@param dst destination for encoded bytes
@param dstOffset offset into destination array
@return amount of bytes w... | [
"Encodes",
"the",
"given",
"signed",
"Short",
"object",
"into",
"exactly",
"1",
"or",
"3",
"bytes",
".",
"If",
"the",
"Short",
"object",
"is",
"never",
"expected",
"to",
"be",
"null",
"consider",
"encoding",
"as",
"a",
"short",
"primitive",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/DataEncoder.java#L172-L181 |
7,874 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/DataEncoder.java | DataEncoder.encode | public static int encode(Character value, byte[] dst, int dstOffset) {
if (value == null) {
dst[dstOffset] = NULL_BYTE_HIGH;
return 1;
} else {
dst[dstOffset] = NOT_NULL_BYTE_HIGH;
encode(value.charValue(), dst, dstOffset + 1);
return 3;... | java | public static int encode(Character value, byte[] dst, int dstOffset) {
if (value == null) {
dst[dstOffset] = NULL_BYTE_HIGH;
return 1;
} else {
dst[dstOffset] = NOT_NULL_BYTE_HIGH;
encode(value.charValue(), dst, dstOffset + 1);
return 3;... | [
"public",
"static",
"int",
"encode",
"(",
"Character",
"value",
",",
"byte",
"[",
"]",
"dst",
",",
"int",
"dstOffset",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"dst",
"[",
"dstOffset",
"]",
"=",
"NULL_BYTE_HIGH",
";",
"return",
"1",
";",... | Encodes the given Character object into exactly 1 or 3 bytes. If the
Character object is never expected to be null, consider encoding as a
char primitive.
@param value optional Character value to encode
@param dst destination for encoded bytes
@param dstOffset offset into destination array
@return amount of bytes writ... | [
"Encodes",
"the",
"given",
"Character",
"object",
"into",
"exactly",
"1",
"or",
"3",
"bytes",
".",
"If",
"the",
"Character",
"object",
"is",
"never",
"expected",
"to",
"be",
"null",
"consider",
"encoding",
"as",
"a",
"char",
"primitive",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/DataEncoder.java#L205-L214 |
7,875 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/DataEncoder.java | DataEncoder.encode | public static void encode(Boolean value, byte[] dst, int dstOffset) {
if (value == null) {
dst[dstOffset] = NULL_BYTE_HIGH;
} else {
dst[dstOffset] = value.booleanValue() ? (byte)128 : (byte)127;
}
} | java | public static void encode(Boolean value, byte[] dst, int dstOffset) {
if (value == null) {
dst[dstOffset] = NULL_BYTE_HIGH;
} else {
dst[dstOffset] = value.booleanValue() ? (byte)128 : (byte)127;
}
} | [
"public",
"static",
"void",
"encode",
"(",
"Boolean",
"value",
",",
"byte",
"[",
"]",
"dst",
",",
"int",
"dstOffset",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"dst",
"[",
"dstOffset",
"]",
"=",
"NULL_BYTE_HIGH",
";",
"}",
"else",
"{",
... | Encodes the given Boolean object into exactly 1 byte.
@param value optional Boolean value to encode
@param dst destination for encoded bytes
@param dstOffset offset into destination array | [
"Encodes",
"the",
"given",
"Boolean",
"object",
"into",
"exactly",
"1",
"byte",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/DataEncoder.java#L234-L240 |
7,876 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/DataEncoder.java | DataEncoder.encode | public static void encode(float value, byte[] dst, int dstOffset) {
int bits = Float.floatToIntBits(value);
bits ^= (bits < 0) ? 0xffffffff : 0x80000000;
dst[dstOffset ] = (byte)(bits >> 24);
dst[dstOffset + 1] = (byte)(bits >> 16);
dst[dstOffset + 2] = (byte)(bits >> 8);... | java | public static void encode(float value, byte[] dst, int dstOffset) {
int bits = Float.floatToIntBits(value);
bits ^= (bits < 0) ? 0xffffffff : 0x80000000;
dst[dstOffset ] = (byte)(bits >> 24);
dst[dstOffset + 1] = (byte)(bits >> 16);
dst[dstOffset + 2] = (byte)(bits >> 8);... | [
"public",
"static",
"void",
"encode",
"(",
"float",
"value",
",",
"byte",
"[",
"]",
"dst",
",",
"int",
"dstOffset",
")",
"{",
"int",
"bits",
"=",
"Float",
".",
"floatToIntBits",
"(",
"value",
")",
";",
"bits",
"^=",
"(",
"bits",
"<",
"0",
")",
"?",... | Encodes the given float into exactly 4 bytes.
@param value float value to encode
@param dst destination for encoded bytes
@param dstOffset offset into destination array | [
"Encodes",
"the",
"given",
"float",
"into",
"exactly",
"4",
"bytes",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/DataEncoder.java#L249-L256 |
7,877 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/DataEncoder.java | DataEncoder.encode | public static void encode(Float value, byte[] dst, int dstOffset) {
if (value == null) {
encode(0x7fffffff, dst, dstOffset);
} else {
encode(value.floatValue(), dst, dstOffset);
}
} | java | public static void encode(Float value, byte[] dst, int dstOffset) {
if (value == null) {
encode(0x7fffffff, dst, dstOffset);
} else {
encode(value.floatValue(), dst, dstOffset);
}
} | [
"public",
"static",
"void",
"encode",
"(",
"Float",
"value",
",",
"byte",
"[",
"]",
"dst",
",",
"int",
"dstOffset",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"encode",
"(",
"0x7fffffff",
",",
"dst",
",",
"dstOffset",
")",
";",
"}",
"els... | Encodes the given Float object into exactly 4 bytes. A non-canonical NaN
value is used to represent null.
@param value optional Float value to encode
@param dst destination for encoded bytes
@param dstOffset offset into destination array | [
"Encodes",
"the",
"given",
"Float",
"object",
"into",
"exactly",
"4",
"bytes",
".",
"A",
"non",
"-",
"canonical",
"NaN",
"value",
"is",
"used",
"to",
"represent",
"null",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/DataEncoder.java#L266-L272 |
7,878 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/DataEncoder.java | DataEncoder.calculateEncodedLength | public static int calculateEncodedLength(BigInteger value) {
if (value == null) {
return 1;
}
int byteCount = (value.bitLength() >> 3) + 1;
return unsignedVarIntLength(byteCount) + byteCount;
} | java | public static int calculateEncodedLength(BigInteger value) {
if (value == null) {
return 1;
}
int byteCount = (value.bitLength() >> 3) + 1;
return unsignedVarIntLength(byteCount) + byteCount;
} | [
"public",
"static",
"int",
"calculateEncodedLength",
"(",
"BigInteger",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"1",
";",
"}",
"int",
"byteCount",
"=",
"(",
"value",
".",
"bitLength",
"(",
")",
">>",
"3",
")",
"+",
"1... | Returns the amount of bytes required to encode the given BigInteger.
@param value BigInteger value to encode, may be null
@return amount of bytes needed to encode
@since 1.2 | [
"Returns",
"the",
"amount",
"of",
"bytes",
"required",
"to",
"encode",
"the",
"given",
"BigInteger",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/DataEncoder.java#L347-L353 |
7,879 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/DataEncoder.java | DataEncoder.calculateEncodedLength | public static int calculateEncodedLength(BigDecimal value) {
if (value == null) {
return 1;
}
return signedVarIntLength(value.scale()) + calculateEncodedLength(value.unscaledValue());
} | java | public static int calculateEncodedLength(BigDecimal value) {
if (value == null) {
return 1;
}
return signedVarIntLength(value.scale()) + calculateEncodedLength(value.unscaledValue());
} | [
"public",
"static",
"int",
"calculateEncodedLength",
"(",
"BigDecimal",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"1",
";",
"}",
"return",
"signedVarIntLength",
"(",
"value",
".",
"scale",
"(",
")",
")",
"+",
"calculateEncode... | Returns the amount of bytes required to encode the given BigDecimal.
@param value BigDecimal value to encode, may be null
@return amount of bytes needed to encode
@since 1.2 | [
"Returns",
"the",
"amount",
"of",
"bytes",
"required",
"to",
"encode",
"the",
"given",
"BigDecimal",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/DataEncoder.java#L382-L387 |
7,880 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/DataEncoder.java | DataEncoder.writeLength | public static int writeLength(int valueLength, OutputStream out) throws IOException {
if (valueLength < 128) {
out.write(valueLength);
return 1;
} else if (valueLength < 16384) {
out.write((valueLength >> 8) | 0x80);
out.write(valueLength);
... | java | public static int writeLength(int valueLength, OutputStream out) throws IOException {
if (valueLength < 128) {
out.write(valueLength);
return 1;
} else if (valueLength < 16384) {
out.write((valueLength >> 8) | 0x80);
out.write(valueLength);
... | [
"public",
"static",
"int",
"writeLength",
"(",
"int",
"valueLength",
",",
"OutputStream",
"out",
")",
"throws",
"IOException",
"{",
"if",
"(",
"valueLength",
"<",
"128",
")",
"{",
"out",
".",
"write",
"(",
"valueLength",
")",
";",
"return",
"1",
";",
"}"... | Writes a positive length value in up to five bytes.
@return number of bytes written
@since 1.2 | [
"Writes",
"a",
"positive",
"length",
"value",
"in",
"up",
"to",
"five",
"bytes",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/DataEncoder.java#L616-L643 |
7,881 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/DataEncoder.java | DataEncoder.encodeSingle | public static byte[] encodeSingle(byte[] value, int prefixPadding, int suffixPadding) {
if (prefixPadding <= 0 && suffixPadding <= 0) {
return value;
}
int length = value.length;
byte[] dst = new byte[prefixPadding + length + suffixPadding];
System.arraycopy(val... | java | public static byte[] encodeSingle(byte[] value, int prefixPadding, int suffixPadding) {
if (prefixPadding <= 0 && suffixPadding <= 0) {
return value;
}
int length = value.length;
byte[] dst = new byte[prefixPadding + length + suffixPadding];
System.arraycopy(val... | [
"public",
"static",
"byte",
"[",
"]",
"encodeSingle",
"(",
"byte",
"[",
"]",
"value",
",",
"int",
"prefixPadding",
",",
"int",
"suffixPadding",
")",
"{",
"if",
"(",
"prefixPadding",
"<=",
"0",
"&&",
"suffixPadding",
"<=",
"0",
")",
"{",
"return",
"value"... | Encodes the given byte array for use when there is only a single
property, whose type is a byte array. The original byte array is
returned if the padding lengths are zero.
@param prefixPadding amount of extra bytes to allocate at start of encoded byte array
@param suffixPadding amount of extra bytes to allocate at end... | [
"Encodes",
"the",
"given",
"byte",
"array",
"for",
"use",
"when",
"there",
"is",
"only",
"a",
"single",
"property",
"whose",
"type",
"is",
"a",
"byte",
"array",
".",
"The",
"original",
"byte",
"array",
"is",
"returned",
"if",
"the",
"padding",
"lengths",
... | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/DataEncoder.java#L653-L661 |
7,882 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/DataEncoder.java | DataEncoder.encodeSingleNullable | public static byte[] encodeSingleNullable(byte[] value, int prefixPadding, int suffixPadding) {
if (prefixPadding <= 0 && suffixPadding <= 0) {
if (value == null) {
return new byte[] {NULL_BYTE_HIGH};
}
int length = value.length;
if (length... | java | public static byte[] encodeSingleNullable(byte[] value, int prefixPadding, int suffixPadding) {
if (prefixPadding <= 0 && suffixPadding <= 0) {
if (value == null) {
return new byte[] {NULL_BYTE_HIGH};
}
int length = value.length;
if (length... | [
"public",
"static",
"byte",
"[",
"]",
"encodeSingleNullable",
"(",
"byte",
"[",
"]",
"value",
",",
"int",
"prefixPadding",
",",
"int",
"suffixPadding",
")",
"{",
"if",
"(",
"prefixPadding",
"<=",
"0",
"&&",
"suffixPadding",
"<=",
"0",
")",
"{",
"if",
"("... | Encodes the given byte array for use when there is only a single
nullable property, whose type is a byte array.
@param prefixPadding amount of extra bytes to allocate at start of encoded byte array
@param suffixPadding amount of extra bytes to allocate at end of encoded byte array | [
"Encodes",
"the",
"given",
"byte",
"array",
"for",
"use",
"when",
"there",
"is",
"only",
"a",
"single",
"nullable",
"property",
"whose",
"type",
"is",
"a",
"byte",
"array",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/DataEncoder.java#L678-L706 |
7,883 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/spi/AbstractRepository.java | AbstractRepository.getCapability | @SuppressWarnings("unchecked")
public <C extends Capability> C getCapability(Class<C> capabilityType) {
if (capabilityType.isInstance(this)) {
return (C) this;
}
return null;
} | java | @SuppressWarnings("unchecked")
public <C extends Capability> C getCapability(Class<C> capabilityType) {
if (capabilityType.isInstance(this)) {
return (C) this;
}
return null;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"C",
"extends",
"Capability",
">",
"C",
"getCapability",
"(",
"Class",
"<",
"C",
">",
"capabilityType",
")",
"{",
"if",
"(",
"capabilityType",
".",
"isInstance",
"(",
"this",
")",
")",
"{",... | Default implementation checks if Repository implements Capability
interface, and if so, returns the Repository. | [
"Default",
"implementation",
"checks",
"if",
"Repository",
"implements",
"Capability",
"interface",
"and",
"if",
"so",
"returns",
"the",
"Repository",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/spi/AbstractRepository.java#L134-L140 |
7,884 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/spi/AbstractRepository.java | AbstractRepository.setAutoShutdownEnabled | public synchronized void setAutoShutdownEnabled(boolean enabled) {
try {
if (mShutdownHook == null) {
if (enabled) {
ShutdownHook hook = new ShutdownHook(this);
Runtime.getRuntime().addShutdownHook(hook);
mShutdownHook... | java | public synchronized void setAutoShutdownEnabled(boolean enabled) {
try {
if (mShutdownHook == null) {
if (enabled) {
ShutdownHook hook = new ShutdownHook(this);
Runtime.getRuntime().addShutdownHook(hook);
mShutdownHook... | [
"public",
"synchronized",
"void",
"setAutoShutdownEnabled",
"(",
"boolean",
"enabled",
")",
"{",
"try",
"{",
"if",
"(",
"mShutdownHook",
"==",
"null",
")",
"{",
"if",
"(",
"enabled",
")",
"{",
"ShutdownHook",
"hook",
"=",
"new",
"ShutdownHook",
"(",
"this",
... | Required by ShutdownCapability. | [
"Required",
"by",
"ShutdownCapability",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/spi/AbstractRepository.java#L157-L174 |
7,885 | michael-rapp/AndroidMaterialValidation | library/src/main/java/de/mrapp/android/validation/validators/NegateValidator.java | NegateValidator.setValidator | public final void setValidator(@NonNull final Validator<Type> validator) {
Condition.INSTANCE.ensureNotNull(validator, "The validator may not be null");
this.validator = validator;
} | java | public final void setValidator(@NonNull final Validator<Type> validator) {
Condition.INSTANCE.ensureNotNull(validator, "The validator may not be null");
this.validator = validator;
} | [
"public",
"final",
"void",
"setValidator",
"(",
"@",
"NonNull",
"final",
"Validator",
"<",
"Type",
">",
"validator",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureNotNull",
"(",
"validator",
",",
"\"The validator may not be null\"",
")",
";",
"this",
".",
... | Sets the validator, whose result should be negated.
@param validator
The validator, which should be set, as an instance of the type {@link Validator}. The
validator may not be null | [
"Sets",
"the",
"validator",
"whose",
"result",
"should",
"be",
"negated",
"."
] | ac8693baeac7abddf2e38a47da4c1849d4661a8b | https://github.com/michael-rapp/AndroidMaterialValidation/blob/ac8693baeac7abddf2e38a47da4c1849d4661a8b/library/src/main/java/de/mrapp/android/validation/validators/NegateValidator.java#L133-L136 |
7,886 | cose-wg/COSE-JAVA | src/main/java/COSE/Signer.java | Signer.setupKey | private void setupKey(OneKey key) throws CoseException {
CBORObject cn2;
CBORObject cn;
cnKey = key;
if (rgbSignature != null) return;
cn = key.get(KeyKeys.Algorithm);
if (cn != null) {
cn2 = findAttribute(HeaderKeys.Algorithm);
... | java | private void setupKey(OneKey key) throws CoseException {
CBORObject cn2;
CBORObject cn;
cnKey = key;
if (rgbSignature != null) return;
cn = key.get(KeyKeys.Algorithm);
if (cn != null) {
cn2 = findAttribute(HeaderKeys.Algorithm);
... | [
"private",
"void",
"setupKey",
"(",
"OneKey",
"key",
")",
"throws",
"CoseException",
"{",
"CBORObject",
"cn2",
";",
"CBORObject",
"cn",
";",
"cnKey",
"=",
"key",
";",
"if",
"(",
"rgbSignature",
"!=",
"null",
")",
"return",
";",
"cn",
"=",
"key",
".",
"... | Set the key on the object, if there is not a signature on this object then set
the algorithm and the key id from the key if they exist on the key and do not exist in the message.
@param key key to be used] | [
"Set",
"the",
"key",
"on",
"the",
"object",
"if",
"there",
"is",
"not",
"a",
"signature",
"on",
"this",
"object",
"then",
"set",
"the",
"algorithm",
"and",
"the",
"key",
"id",
"from",
"the",
"key",
"if",
"they",
"exist",
"on",
"the",
"key",
"and",
"d... | f972b11ab4c9a18f911bc49a15225a6951cf6f63 | https://github.com/cose-wg/COSE-JAVA/blob/f972b11ab4c9a18f911bc49a15225a6951cf6f63/src/main/java/COSE/Signer.java#L72-L91 |
7,887 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/repo/map/MapRepositoryBuilder.java | MapRepositoryBuilder.newRepository | public static Repository newRepository() {
try {
MapRepositoryBuilder builder = new MapRepositoryBuilder();
return builder.build();
} catch (RepositoryException e) {
// Not expected.
throw new RuntimeException(e);
}
} | java | public static Repository newRepository() {
try {
MapRepositoryBuilder builder = new MapRepositoryBuilder();
return builder.build();
} catch (RepositoryException e) {
// Not expected.
throw new RuntimeException(e);
}
} | [
"public",
"static",
"Repository",
"newRepository",
"(",
")",
"{",
"try",
"{",
"MapRepositoryBuilder",
"builder",
"=",
"new",
"MapRepositoryBuilder",
"(",
")",
";",
"return",
"builder",
".",
"build",
"(",
")",
";",
"}",
"catch",
"(",
"RepositoryException",
"e",... | Convenience method to build a new MapRepository. | [
"Convenience",
"method",
"to",
"build",
"a",
"new",
"MapRepository",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/repo/map/MapRepositoryBuilder.java#L61-L69 |
7,888 | Carbonado/Carbonado | src/main/java/com/amazon/carbonado/repo/map/MapRepositoryBuilder.java | MapRepositoryBuilder.setLockTimeout | public void setLockTimeout(int timeout, TimeUnit unit) {
if (timeout < 0 || unit == null) {
throw new IllegalArgumentException();
}
mLockTimeout = timeout;
mLockTimeoutUnit = unit;
} | java | public void setLockTimeout(int timeout, TimeUnit unit) {
if (timeout < 0 || unit == null) {
throw new IllegalArgumentException();
}
mLockTimeout = timeout;
mLockTimeoutUnit = unit;
} | [
"public",
"void",
"setLockTimeout",
"(",
"int",
"timeout",
",",
"TimeUnit",
"unit",
")",
"{",
"if",
"(",
"timeout",
"<",
"0",
"||",
"unit",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"mLockTimeout",
"=",
"time... | Set the lock timeout. Default value is 500 milliseconds. | [
"Set",
"the",
"lock",
"timeout",
".",
"Default",
"value",
"is",
"500",
"milliseconds",
"."
] | eee29b365a61c8f03e1a1dc6bed0692e6b04b1db | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/repo/map/MapRepositoryBuilder.java#L130-L136 |
7,889 | michael-rapp/AndroidMaterialValidation | library/src/main/java/de/mrapp/android/validation/validators/AbstractValidator.java | AbstractValidator.setIcon | public final void setIcon(@NonNull final Context context, @DrawableRes final int resourceId) {
Condition.INSTANCE.ensureNotNull(context, "The context may not be null");
this.icon = ContextCompat.getDrawable(context, resourceId);
} | java | public final void setIcon(@NonNull final Context context, @DrawableRes final int resourceId) {
Condition.INSTANCE.ensureNotNull(context, "The context may not be null");
this.icon = ContextCompat.getDrawable(context, resourceId);
} | [
"public",
"final",
"void",
"setIcon",
"(",
"@",
"NonNull",
"final",
"Context",
"context",
",",
"@",
"DrawableRes",
"final",
"int",
"resourceId",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureNotNull",
"(",
"context",
",",
"\"The context may not be null\"",
... | Sets the icon, which should be shown, if the validation fails.
@param context
The context, which should be used to retrieve the icon, as an instance of the class
{@link Context}. The context may not be null
@param resourceId
The resource ID of the drawable resource, which contains the icon, which should be
set, as an ... | [
"Sets",
"the",
"icon",
"which",
"should",
"be",
"shown",
"if",
"the",
"validation",
"fails",
"."
] | ac8693baeac7abddf2e38a47da4c1849d4661a8b | https://github.com/michael-rapp/AndroidMaterialValidation/blob/ac8693baeac7abddf2e38a47da4c1849d4661a8b/library/src/main/java/de/mrapp/android/validation/validators/AbstractValidator.java#L126-L129 |
7,890 | michael-rapp/AndroidMaterialValidation | library/src/main/java/de/mrapp/android/validation/PasswordEditText.java | PasswordEditText.obtainPasswordVerificationPrefix | private void obtainPasswordVerificationPrefix(@NonNull final TypedArray typedArray) {
String format =
typedArray.getString(R.styleable.PasswordEditText_passwordVerificationPrefix);
if (format == null) {
format = getResources().getString(R.string.password_verification_prefix)... | java | private void obtainPasswordVerificationPrefix(@NonNull final TypedArray typedArray) {
String format =
typedArray.getString(R.styleable.PasswordEditText_passwordVerificationPrefix);
if (format == null) {
format = getResources().getString(R.string.password_verification_prefix)... | [
"private",
"void",
"obtainPasswordVerificationPrefix",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"String",
"format",
"=",
"typedArray",
".",
"getString",
"(",
"R",
".",
"styleable",
".",
"PasswordEditText_passwordVerificationPrefix",
")",
";"... | Obtains the prefix of helper texts, which are shown depending on the password strength, from
a specific typed array.
@param typedArray
The typed array, the prefix should be obtained from, as an instance of the class
{@link TypedArray}. The typed array may not be null | [
"Obtains",
"the",
"prefix",
"of",
"helper",
"texts",
"which",
"are",
"shown",
"depending",
"on",
"the",
"password",
"strength",
"from",
"a",
"specific",
"typed",
"array",
"."
] | ac8693baeac7abddf2e38a47da4c1849d4661a8b | https://github.com/michael-rapp/AndroidMaterialValidation/blob/ac8693baeac7abddf2e38a47da4c1849d4661a8b/library/src/main/java/de/mrapp/android/validation/PasswordEditText.java#L127-L136 |
7,891 | michael-rapp/AndroidMaterialValidation | library/src/main/java/de/mrapp/android/validation/PasswordEditText.java | PasswordEditText.createTextChangeListener | private TextWatcher createTextChangeListener() {
return new TextWatcher() {
@Override
public final void beforeTextChanged(final CharSequence s, final int start,
final int count, final int after) {
}
@Override
... | java | private TextWatcher createTextChangeListener() {
return new TextWatcher() {
@Override
public final void beforeTextChanged(final CharSequence s, final int start,
final int count, final int after) {
}
@Override
... | [
"private",
"TextWatcher",
"createTextChangeListener",
"(",
")",
"{",
"return",
"new",
"TextWatcher",
"(",
")",
"{",
"@",
"Override",
"public",
"final",
"void",
"beforeTextChanged",
"(",
"final",
"CharSequence",
"s",
",",
"final",
"int",
"start",
",",
"final",
... | Creates and returns a listener, which allows to verify the password strength, when the
password has been changed.
@return The listener, which has been created, as an instance of the type {@link TextWatcher} | [
"Creates",
"and",
"returns",
"a",
"listener",
"which",
"allows",
"to",
"verify",
"the",
"password",
"strength",
"when",
"the",
"password",
"has",
"been",
"changed",
"."
] | ac8693baeac7abddf2e38a47da4c1849d4661a8b | https://github.com/michael-rapp/AndroidMaterialValidation/blob/ac8693baeac7abddf2e38a47da4c1849d4661a8b/library/src/main/java/de/mrapp/android/validation/PasswordEditText.java#L144-L165 |
7,892 | michael-rapp/AndroidMaterialValidation | library/src/main/java/de/mrapp/android/validation/PasswordEditText.java | PasswordEditText.verifyPasswordStrength | private void verifyPasswordStrength() {
if (isEnabled() && !constraints.isEmpty() && !TextUtils.isEmpty(getText())) {
float score = getPasswordStrength();
adaptHelperText(score);
} else {
setHelperText(regularHelperText);
}
} | java | private void verifyPasswordStrength() {
if (isEnabled() && !constraints.isEmpty() && !TextUtils.isEmpty(getText())) {
float score = getPasswordStrength();
adaptHelperText(score);
} else {
setHelperText(regularHelperText);
}
} | [
"private",
"void",
"verifyPasswordStrength",
"(",
")",
"{",
"if",
"(",
"isEnabled",
"(",
")",
"&&",
"!",
"constraints",
".",
"isEmpty",
"(",
")",
"&&",
"!",
"TextUtils",
".",
"isEmpty",
"(",
"getText",
"(",
")",
")",
")",
"{",
"float",
"score",
"=",
... | Verifies the strength of the current password, depending on the constraints, which have been
added and adapts the appearance of the view accordingly. | [
"Verifies",
"the",
"strength",
"of",
"the",
"current",
"password",
"depending",
"on",
"the",
"constraints",
"which",
"have",
"been",
"added",
"and",
"adapts",
"the",
"appearance",
"of",
"the",
"view",
"accordingly",
"."
] | ac8693baeac7abddf2e38a47da4c1849d4661a8b | https://github.com/michael-rapp/AndroidMaterialValidation/blob/ac8693baeac7abddf2e38a47da4c1849d4661a8b/library/src/main/java/de/mrapp/android/validation/PasswordEditText.java#L171-L178 |
7,893 | michael-rapp/AndroidMaterialValidation | library/src/main/java/de/mrapp/android/validation/PasswordEditText.java | PasswordEditText.getPasswordStrength | private float getPasswordStrength() {
int absoluteScore = 0;
CharSequence password = getView().getText();
for (Constraint<CharSequence> constraint : constraints) {
if (constraint.isSatisfied(password)) {
absoluteScore++;
}
}
return ((floa... | java | private float getPasswordStrength() {
int absoluteScore = 0;
CharSequence password = getView().getText();
for (Constraint<CharSequence> constraint : constraints) {
if (constraint.isSatisfied(password)) {
absoluteScore++;
}
}
return ((floa... | [
"private",
"float",
"getPasswordStrength",
"(",
")",
"{",
"int",
"absoluteScore",
"=",
"0",
";",
"CharSequence",
"password",
"=",
"getView",
"(",
")",
".",
"getText",
"(",
")",
";",
"for",
"(",
"Constraint",
"<",
"CharSequence",
">",
"constraint",
":",
"co... | Returns the strength of the current password, depending on the constraints, which have been
added.
@return The fraction of constraints, which are satisfied, as a {@link Float} value between
0.0 and 1.0 | [
"Returns",
"the",
"strength",
"of",
"the",
"current",
"password",
"depending",
"on",
"the",
"constraints",
"which",
"have",
"been",
"added",
"."
] | ac8693baeac7abddf2e38a47da4c1849d4661a8b | https://github.com/michael-rapp/AndroidMaterialValidation/blob/ac8693baeac7abddf2e38a47da4c1849d4661a8b/library/src/main/java/de/mrapp/android/validation/PasswordEditText.java#L187-L198 |
7,894 | michael-rapp/AndroidMaterialValidation | library/src/main/java/de/mrapp/android/validation/PasswordEditText.java | PasswordEditText.adaptHelperText | private void adaptHelperText(final float score) {
if (!helperTexts.isEmpty()) {
CharSequence helperText = getHelperText(score);
if (helperText != null) {
int color = getHelperTextColor(score);
helperText = "<font color=\"" + color + "\">" + helperText + "... | java | private void adaptHelperText(final float score) {
if (!helperTexts.isEmpty()) {
CharSequence helperText = getHelperText(score);
if (helperText != null) {
int color = getHelperTextColor(score);
helperText = "<font color=\"" + color + "\">" + helperText + "... | [
"private",
"void",
"adaptHelperText",
"(",
"final",
"float",
"score",
")",
"{",
"if",
"(",
"!",
"helperTexts",
".",
"isEmpty",
"(",
")",
")",
"{",
"CharSequence",
"helperText",
"=",
"getHelperText",
"(",
"score",
")",
";",
"if",
"(",
"helperText",
"!=",
... | Adapts the helper text, depending on a specific password strength.
@param score
The password strength as a {@link Float} value between 0.0 and 1.0, which represents
the fraction of constraints, which are satisfied | [
"Adapts",
"the",
"helper",
"text",
"depending",
"on",
"a",
"specific",
"password",
"strength",
"."
] | ac8693baeac7abddf2e38a47da4c1849d4661a8b | https://github.com/michael-rapp/AndroidMaterialValidation/blob/ac8693baeac7abddf2e38a47da4c1849d4661a8b/library/src/main/java/de/mrapp/android/validation/PasswordEditText.java#L207-L230 |
7,895 | michael-rapp/AndroidMaterialValidation | library/src/main/java/de/mrapp/android/validation/PasswordEditText.java | PasswordEditText.getHelperText | private CharSequence getHelperText(final float score) {
if (!helperTexts.isEmpty()) {
float interval = 1.0f / helperTexts.size();
int index = (int) Math.floor(score / interval) - 1;
index = Math.max(index, 0);
index = Math.min(index, helperTexts.size() - 1);
... | java | private CharSequence getHelperText(final float score) {
if (!helperTexts.isEmpty()) {
float interval = 1.0f / helperTexts.size();
int index = (int) Math.floor(score / interval) - 1;
index = Math.max(index, 0);
index = Math.min(index, helperTexts.size() - 1);
... | [
"private",
"CharSequence",
"getHelperText",
"(",
"final",
"float",
"score",
")",
"{",
"if",
"(",
"!",
"helperTexts",
".",
"isEmpty",
"(",
")",
")",
"{",
"float",
"interval",
"=",
"1.0f",
"/",
"helperTexts",
".",
"size",
"(",
")",
";",
"int",
"index",
"... | Returns the helper text, which corresponds to a specific password strength.
@param score
The password strength as a {@link Float} value between 0.0 and 1.0, which represents
the fraction of constraints, which are satisfied
@return The helper text as an instance of the type {@link CharSequence} or null, if no helper
te... | [
"Returns",
"the",
"helper",
"text",
"which",
"corresponds",
"to",
"a",
"specific",
"password",
"strength",
"."
] | ac8693baeac7abddf2e38a47da4c1849d4661a8b | https://github.com/michael-rapp/AndroidMaterialValidation/blob/ac8693baeac7abddf2e38a47da4c1849d4661a8b/library/src/main/java/de/mrapp/android/validation/PasswordEditText.java#L241-L251 |
7,896 | michael-rapp/AndroidMaterialValidation | library/src/main/java/de/mrapp/android/validation/PasswordEditText.java | PasswordEditText.getHelperTextColor | private int getHelperTextColor(final float score) {
if (!helperTextColors.isEmpty()) {
float interval = 1.0f / helperTextColors.size();
int index = (int) Math.floor(score / interval) - 1;
index = Math.max(index, 0);
index = Math.min(index, helperTextColors.size() ... | java | private int getHelperTextColor(final float score) {
if (!helperTextColors.isEmpty()) {
float interval = 1.0f / helperTextColors.size();
int index = (int) Math.floor(score / interval) - 1;
index = Math.max(index, 0);
index = Math.min(index, helperTextColors.size() ... | [
"private",
"int",
"getHelperTextColor",
"(",
"final",
"float",
"score",
")",
"{",
"if",
"(",
"!",
"helperTextColors",
".",
"isEmpty",
"(",
")",
")",
"{",
"float",
"interval",
"=",
"1.0f",
"/",
"helperTextColors",
".",
"size",
"(",
")",
";",
"int",
"index... | Returns the color of the helper text, which corresponds to a specific password strength.
@param score
The password strength as a {@link Float} value between 0.0 and 1.0, which represents
the fraction of constraints, which are satisfied
@return The color of the helper text as an {@link Integer} value | [
"Returns",
"the",
"color",
"of",
"the",
"helper",
"text",
"which",
"corresponds",
"to",
"a",
"specific",
"password",
"strength",
"."
] | ac8693baeac7abddf2e38a47da4c1849d4661a8b | https://github.com/michael-rapp/AndroidMaterialValidation/blob/ac8693baeac7abddf2e38a47da4c1849d4661a8b/library/src/main/java/de/mrapp/android/validation/PasswordEditText.java#L261-L271 |
7,897 | michael-rapp/AndroidMaterialValidation | library/src/main/java/de/mrapp/android/validation/PasswordEditText.java | PasswordEditText.addConstraint | public final void addConstraint(@NonNull final Constraint<CharSequence> constraint) {
Condition.INSTANCE.ensureNotNull(constraint, "The constraint may not be null");
if (!constraints.contains(constraint)) {
constraints.add(constraint);
verifyPasswordStrength();
}
} | java | public final void addConstraint(@NonNull final Constraint<CharSequence> constraint) {
Condition.INSTANCE.ensureNotNull(constraint, "The constraint may not be null");
if (!constraints.contains(constraint)) {
constraints.add(constraint);
verifyPasswordStrength();
}
} | [
"public",
"final",
"void",
"addConstraint",
"(",
"@",
"NonNull",
"final",
"Constraint",
"<",
"CharSequence",
">",
"constraint",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureNotNull",
"(",
"constraint",
",",
"\"The constraint may not be null\"",
")",
";",
"i... | Adds a new constraint, which should be used to verify the password strength.
@param constraint
The constraint, which should be added, as an instance of the type {@link Constraint}.
The constraint may not be null | [
"Adds",
"a",
"new",
"constraint",
"which",
"should",
"be",
"used",
"to",
"verify",
"the",
"password",
"strength",
"."
] | ac8693baeac7abddf2e38a47da4c1849d4661a8b | https://github.com/michael-rapp/AndroidMaterialValidation/blob/ac8693baeac7abddf2e38a47da4c1849d4661a8b/library/src/main/java/de/mrapp/android/validation/PasswordEditText.java#L367-L374 |
7,898 | michael-rapp/AndroidMaterialValidation | library/src/main/java/de/mrapp/android/validation/PasswordEditText.java | PasswordEditText.addAllConstraints | public final void addAllConstraints(
@NonNull final Collection<Constraint<CharSequence>> constraints) {
Condition.INSTANCE.ensureNotNull(constraints, "The collection may not be null");
for (Constraint<CharSequence> constraint : constraints) {
addConstraint(constraint);
}... | java | public final void addAllConstraints(
@NonNull final Collection<Constraint<CharSequence>> constraints) {
Condition.INSTANCE.ensureNotNull(constraints, "The collection may not be null");
for (Constraint<CharSequence> constraint : constraints) {
addConstraint(constraint);
}... | [
"public",
"final",
"void",
"addAllConstraints",
"(",
"@",
"NonNull",
"final",
"Collection",
"<",
"Constraint",
"<",
"CharSequence",
">",
">",
"constraints",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureNotNull",
"(",
"constraints",
",",
"\"The collection ma... | Adds all constraints, which are contained by a specific collection.
@param constraints
A collection, which contains the constraints, which should be added, as an instance
of the type {@link Collection} or an empty collection, if no constraints should be
added | [
"Adds",
"all",
"constraints",
"which",
"are",
"contained",
"by",
"a",
"specific",
"collection",
"."
] | ac8693baeac7abddf2e38a47da4c1849d4661a8b | https://github.com/michael-rapp/AndroidMaterialValidation/blob/ac8693baeac7abddf2e38a47da4c1849d4661a8b/library/src/main/java/de/mrapp/android/validation/PasswordEditText.java#L384-L391 |
7,899 | michael-rapp/AndroidMaterialValidation | library/src/main/java/de/mrapp/android/validation/PasswordEditText.java | PasswordEditText.removeConstraint | public final void removeConstraint(@NonNull final Constraint<CharSequence> constraint) {
Condition.INSTANCE.ensureNotNull(constraint, "The constraint may not be null");
constraints.remove(constraint);
verifyPasswordStrength();
} | java | public final void removeConstraint(@NonNull final Constraint<CharSequence> constraint) {
Condition.INSTANCE.ensureNotNull(constraint, "The constraint may not be null");
constraints.remove(constraint);
verifyPasswordStrength();
} | [
"public",
"final",
"void",
"removeConstraint",
"(",
"@",
"NonNull",
"final",
"Constraint",
"<",
"CharSequence",
">",
"constraint",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureNotNull",
"(",
"constraint",
",",
"\"The constraint may not be null\"",
")",
";",
... | Removes a specific constraint, which should not be used to verify the password strength,
anymore.
@param constraint
The constraint, which should be removed, as an instance of the type {@link
Constraint}. The constraint may not be null | [
"Removes",
"a",
"specific",
"constraint",
"which",
"should",
"not",
"be",
"used",
"to",
"verify",
"the",
"password",
"strength",
"anymore",
"."
] | ac8693baeac7abddf2e38a47da4c1849d4661a8b | https://github.com/michael-rapp/AndroidMaterialValidation/blob/ac8693baeac7abddf2e38a47da4c1849d4661a8b/library/src/main/java/de/mrapp/android/validation/PasswordEditText.java#L414-L418 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.