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
153,300
carewebframework/carewebframework-vista
org.carewebframework.vista.api-parent/org.carewebframework.vista.api.esig/src/main/java/org/carewebframework/vista/esig/ESigList.java
ESigList.findItems
public List<ESigItem> findItems(ESigFilter filter) { List<ESigItem> list = new ArrayList<ESigItem>(); if (filter == null) { list.addAll(items); } else { for (ESigItem item : items) { if (filter.matches(item)) { list.add(item); } } } return list; }
java
public List<ESigItem> findItems(ESigFilter filter) { List<ESigItem> list = new ArrayList<ESigItem>(); if (filter == null) { list.addAll(items); } else { for (ESigItem item : items) { if (filter.matches(item)) { list.add(item); } } } return list; }
[ "public", "List", "<", "ESigItem", ">", "findItems", "(", "ESigFilter", "filter", ")", "{", "List", "<", "ESigItem", ">", "list", "=", "new", "ArrayList", "<", "ESigItem", ">", "(", ")", ";", "if", "(", "filter", "==", "null", ")", "{", "list", ".", "addAll", "(", "items", ")", ";", "}", "else", "{", "for", "(", "ESigItem", "item", ":", "items", ")", "{", "if", "(", "filter", ".", "matches", "(", "item", ")", ")", "{", "list", ".", "add", "(", "item", ")", ";", "}", "}", "}", "return", "list", ";", "}" ]
Returns a list of sig items that match the specified filter. If the filter is null, all sig items are returned. @param filter The esignature filter. @return List of matching sig items.
[ "Returns", "a", "list", "of", "sig", "items", "that", "match", "the", "specified", "filter", ".", "If", "the", "filter", "is", "null", "all", "sig", "items", "are", "returned", "." ]
883b2cbe395d9e8a21cd19db820f0876bda6b1c6
https://github.com/carewebframework/carewebframework-vista/blob/883b2cbe395d9e8a21cd19db820f0876bda6b1c6/org.carewebframework.vista.api-parent/org.carewebframework.vista.api.esig/src/main/java/org/carewebframework/vista/esig/ESigList.java#L117-L131
153,301
carewebframework/carewebframework-vista
org.carewebframework.vista.api-parent/org.carewebframework.vista.api.esig/src/main/java/org/carewebframework/vista/esig/ESigList.java
ESigList.add
public ESigItem add(IESigType eSigType, String id, String text, String subGroupName, SignState signState, String data, String session) { ESigItem item = new ESigItem(eSigType, id); item.setText(text); item.setSubGroupName(subGroupName); item.setSignState(signState); item.setData(data); item.setSession(session); return add(item); }
java
public ESigItem add(IESigType eSigType, String id, String text, String subGroupName, SignState signState, String data, String session) { ESigItem item = new ESigItem(eSigType, id); item.setText(text); item.setSubGroupName(subGroupName); item.setSignState(signState); item.setData(data); item.setSession(session); return add(item); }
[ "public", "ESigItem", "add", "(", "IESigType", "eSigType", ",", "String", "id", ",", "String", "text", ",", "String", "subGroupName", ",", "SignState", "signState", ",", "String", "data", ",", "String", "session", ")", "{", "ESigItem", "item", "=", "new", "ESigItem", "(", "eSigType", ",", "id", ")", ";", "item", ".", "setText", "(", "text", ")", ";", "item", ".", "setSubGroupName", "(", "subGroupName", ")", ";", "item", ".", "setSignState", "(", "signState", ")", ";", "item", ".", "setData", "(", "data", ")", ";", "item", ".", "setSession", "(", "session", ")", ";", "return", "add", "(", "item", ")", ";", "}" ]
Ads a new sig item to the list, given the required elements. @param eSigType The esignature type. @param id The item id. @param text The description text. @param subGroupName The sub group name. @param signState The signature state. @param data The data object. @param session The session id. @return New sig item.
[ "Ads", "a", "new", "sig", "item", "to", "the", "list", "given", "the", "required", "elements", "." ]
883b2cbe395d9e8a21cd19db820f0876bda6b1c6
https://github.com/carewebframework/carewebframework-vista/blob/883b2cbe395d9e8a21cd19db820f0876bda6b1c6/org.carewebframework.vista.api-parent/org.carewebframework.vista.api.esig/src/main/java/org/carewebframework/vista/esig/ESigList.java#L171-L180
153,302
carewebframework/carewebframework-vista
org.carewebframework.vista.api-parent/org.carewebframework.vista.api.esig/src/main/java/org/carewebframework/vista/esig/ESigList.java
ESigList.add
public ESigItem add(ESigItem item) { if (!items.contains(item)) { items.add(item); fireEvent("ADD", item); } return item; }
java
public ESigItem add(ESigItem item) { if (!items.contains(item)) { items.add(item); fireEvent("ADD", item); } return item; }
[ "public", "ESigItem", "add", "(", "ESigItem", "item", ")", "{", "if", "(", "!", "items", ".", "contains", "(", "item", ")", ")", "{", "items", ".", "add", "(", "item", ")", ";", "fireEvent", "(", "\"ADD\"", ",", "item", ")", ";", "}", "return", "item", ";", "}" ]
Adds a sig item to the list. Requests to add items already in the list are ignored. If an item is successfully added, an ESIG.ADD event is fired. @param item A sig item. @return The item that was added.
[ "Adds", "a", "sig", "item", "to", "the", "list", ".", "Requests", "to", "add", "items", "already", "in", "the", "list", "are", "ignored", ".", "If", "an", "item", "is", "successfully", "added", "an", "ESIG", ".", "ADD", "event", "is", "fired", "." ]
883b2cbe395d9e8a21cd19db820f0876bda6b1c6
https://github.com/carewebframework/carewebframework-vista/blob/883b2cbe395d9e8a21cd19db820f0876bda6b1c6/org.carewebframework.vista.api-parent/org.carewebframework.vista.api.esig/src/main/java/org/carewebframework/vista/esig/ESigList.java#L189-L196
153,303
carewebframework/carewebframework-vista
org.carewebframework.vista.api-parent/org.carewebframework.vista.api.esig/src/main/java/org/carewebframework/vista/esig/ESigList.java
ESigList.remove
public boolean remove(ESigItem item) { boolean result = items.remove(item); if (result) { removed(item); } return result; }
java
public boolean remove(ESigItem item) { boolean result = items.remove(item); if (result) { removed(item); } return result; }
[ "public", "boolean", "remove", "(", "ESigItem", "item", ")", "{", "boolean", "result", "=", "items", ".", "remove", "(", "item", ")", ";", "if", "(", "result", ")", "{", "removed", "(", "item", ")", ";", "}", "return", "result", ";", "}" ]
Removes a sig item from the list. Fires an ESIG.DELETE event if successful. @param item Item to remove. @return True if the operation was successful.
[ "Removes", "a", "sig", "item", "from", "the", "list", ".", "Fires", "an", "ESIG", ".", "DELETE", "event", "if", "successful", "." ]
883b2cbe395d9e8a21cd19db820f0876bda6b1c6
https://github.com/carewebframework/carewebframework-vista/blob/883b2cbe395d9e8a21cd19db820f0876bda6b1c6/org.carewebframework.vista.api-parent/org.carewebframework.vista.api.esig/src/main/java/org/carewebframework/vista/esig/ESigList.java#L233-L241
153,304
js-lib-com/commons
src/main/java/js/util/Types.java
Types.isConcrete
public static boolean isConcrete(Type t) { if(t instanceof Class) { final Class<?> c = (Class<?>)t; return !c.isInterface() && !Modifier.isAbstract(c.getModifiers()); } if(t instanceof ParameterizedType) { final ParameterizedType p = (ParameterizedType)t; return isConcrete(p.getRawType()); } return false; }
java
public static boolean isConcrete(Type t) { if(t instanceof Class) { final Class<?> c = (Class<?>)t; return !c.isInterface() && !Modifier.isAbstract(c.getModifiers()); } if(t instanceof ParameterizedType) { final ParameterizedType p = (ParameterizedType)t; return isConcrete(p.getRawType()); } return false; }
[ "public", "static", "boolean", "isConcrete", "(", "Type", "t", ")", "{", "if", "(", "t", "instanceof", "Class", ")", "{", "final", "Class", "<", "?", ">", "c", "=", "(", "Class", "<", "?", ">", ")", "t", ";", "return", "!", "c", ".", "isInterface", "(", ")", "&&", "!", "Modifier", ".", "isAbstract", "(", "c", ".", "getModifiers", "(", ")", ")", ";", "}", "if", "(", "t", "instanceof", "ParameterizedType", ")", "{", "final", "ParameterizedType", "p", "=", "(", "ParameterizedType", ")", "t", ";", "return", "isConcrete", "(", "p", ".", "getRawType", "(", ")", ")", ";", "}", "return", "false", ";", "}" ]
Test if type is concrete, that is, is not interface or abstract. If type to test is parameterized uses its raw type. If type to test is null returns false. @param t type to test, possible null. @return true if type is concrete.
[ "Test", "if", "type", "is", "concrete", "that", "is", "is", "not", "interface", "or", "abstract", ".", "If", "type", "to", "test", "is", "parameterized", "uses", "its", "raw", "type", ".", "If", "type", "to", "test", "is", "null", "returns", "false", "." ]
f8c64482142b163487745da74feb106f0765c16b
https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Types.java#L192-L205
153,305
js-lib-com/commons
src/main/java/js/util/Types.java
Types.isNumber
public static boolean isNumber(Type t) { for(int i = 0; i < NUMERICAL_TYPES.length; i++) { if(NUMERICAL_TYPES[i] == t) { return true; } } return false; }
java
public static boolean isNumber(Type t) { for(int i = 0; i < NUMERICAL_TYPES.length; i++) { if(NUMERICAL_TYPES[i] == t) { return true; } } return false; }
[ "public", "static", "boolean", "isNumber", "(", "Type", "t", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "NUMERICAL_TYPES", ".", "length", ";", "i", "++", ")", "{", "if", "(", "NUMERICAL_TYPES", "[", "i", "]", "==", "t", ")", "{", "return", "true", ";", "}", "}", "return", "false", ";", "}" ]
Test if type is numeric. A type is considered numeric if is a Java standard class representing a number. @param t type to test. @return true if <code>type</code> is numeric.
[ "Test", "if", "type", "is", "numeric", ".", "A", "type", "is", "considered", "numeric", "if", "is", "a", "Java", "standard", "class", "representing", "a", "number", "." ]
f8c64482142b163487745da74feb106f0765c16b
https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Types.java#L232-L240
153,306
js-lib-com/commons
src/main/java/js/util/Types.java
Types.isPrimitiveLike
public static boolean isPrimitiveLike(Type t) { if(isNumber(t)) { return true; } if(isBoolean(t)) { return true; } if(isEnum(t)) { return true; } if(isCharacter(t)) { return true; } if(isDate(t)) { return true; } if(t == String.class) { return true; } return false; }
java
public static boolean isPrimitiveLike(Type t) { if(isNumber(t)) { return true; } if(isBoolean(t)) { return true; } if(isEnum(t)) { return true; } if(isCharacter(t)) { return true; } if(isDate(t)) { return true; } if(t == String.class) { return true; } return false; }
[ "public", "static", "boolean", "isPrimitiveLike", "(", "Type", "t", ")", "{", "if", "(", "isNumber", "(", "t", ")", ")", "{", "return", "true", ";", "}", "if", "(", "isBoolean", "(", "t", ")", ")", "{", "return", "true", ";", "}", "if", "(", "isEnum", "(", "t", ")", ")", "{", "return", "true", ";", "}", "if", "(", "isCharacter", "(", "t", ")", ")", "{", "return", "true", ";", "}", "if", "(", "isDate", "(", "t", ")", ")", "{", "return", "true", ";", "}", "if", "(", "t", "==", "String", ".", "class", ")", "{", "return", "true", ";", "}", "return", "false", ";", "}" ]
Test if type is like a primitive? Return true only if given type is a number, boolean, enumeration, character or string. @param t type to test. @return true if this type is like a primitive.
[ "Test", "if", "type", "is", "like", "a", "primitive?", "Return", "true", "only", "if", "given", "type", "is", "a", "number", "boolean", "enumeration", "character", "or", "string", "." ]
f8c64482142b163487745da74feb106f0765c16b
https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Types.java#L360-L381
153,307
js-lib-com/commons
src/main/java/js/util/Types.java
Types.isClass
public static boolean isClass(String name) { if(name == null) { return false; } Matcher matcher = CLASS_NAME_PATTERN.matcher(name); return matcher.find(); }
java
public static boolean isClass(String name) { if(name == null) { return false; } Matcher matcher = CLASS_NAME_PATTERN.matcher(name); return matcher.find(); }
[ "public", "static", "boolean", "isClass", "(", "String", "name", ")", "{", "if", "(", "name", "==", "null", ")", "{", "return", "false", ";", "}", "Matcher", "matcher", "=", "CLASS_NAME_PATTERN", ".", "matcher", "(", "name", ")", ";", "return", "matcher", ".", "find", "(", ")", ";", "}" ]
Test if given name is a valid Java class name. This predicate returns false if name to test is null. @param name name to test, possible null. @return true if given name is a valid Java class name.
[ "Test", "if", "given", "name", "is", "a", "valid", "Java", "class", "name", ".", "This", "predicate", "returns", "false", "if", "name", "to", "test", "is", "null", "." ]
f8c64482142b163487745da74feb106f0765c16b
https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Types.java#L515-L522
153,308
tvesalainen/util
util/src/main/java/org/vesalainen/graph/DiGraphIterator.java
DiGraphIterator.getInstance
public static <T> DiGraphIterator<T> getInstance(T root, Function<? super T, ? extends Collection<T>> edges) { return new DiGraphIterator<>(root, (y)->edges.apply(y).stream()); }
java
public static <T> DiGraphIterator<T> getInstance(T root, Function<? super T, ? extends Collection<T>> edges) { return new DiGraphIterator<>(root, (y)->edges.apply(y).stream()); }
[ "public", "static", "<", "T", ">", "DiGraphIterator", "<", "T", ">", "getInstance", "(", "T", "root", ",", "Function", "<", "?", "super", "T", ",", "?", "extends", "Collection", "<", "T", ">", ">", "edges", ")", "{", "return", "new", "DiGraphIterator", "<>", "(", "root", ",", "(", "y", ")", "-", ">", "edges", ".", "apply", "(", "y", ")", ".", "stream", "(", ")", ")", ";", "}" ]
Creates a DiGraphIterator. It will iterate once for every node. @param root @param edges
[ "Creates", "a", "DiGraphIterator", ".", "It", "will", "iterate", "once", "for", "every", "node", "." ]
bba7a44689f638ffabc8be40a75bdc9a33676433
https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/graph/DiGraphIterator.java#L62-L65
153,309
tvesalainen/util
util/src/main/java/org/vesalainen/graph/DiGraphIterator.java
DiGraphIterator.spliterator
public static <T> Spliterator<T> spliterator(T root, Function<? super T, ? extends Stream<T>> edges) { DiGraphIterator dgi = new DiGraphIterator(root, edges); return Spliterators.spliteratorUnknownSize(dgi, 0); }
java
public static <T> Spliterator<T> spliterator(T root, Function<? super T, ? extends Stream<T>> edges) { DiGraphIterator dgi = new DiGraphIterator(root, edges); return Spliterators.spliteratorUnknownSize(dgi, 0); }
[ "public", "static", "<", "T", ">", "Spliterator", "<", "T", ">", "spliterator", "(", "T", "root", ",", "Function", "<", "?", "super", "T", ",", "?", "extends", "Stream", "<", "T", ">", ">", "edges", ")", "{", "DiGraphIterator", "dgi", "=", "new", "DiGraphIterator", "(", "root", ",", "edges", ")", ";", "return", "Spliterators", ".", "spliteratorUnknownSize", "(", "dgi", ",", "0", ")", ";", "}" ]
Creates a Spliterator @param <T> @param root @param edges @return
[ "Creates", "a", "Spliterator" ]
bba7a44689f638ffabc8be40a75bdc9a33676433
https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/graph/DiGraphIterator.java#L84-L88
153,310
fuwjax/ev-oss
funco/src/main/java/org/fuwjax/oss/util/assertion/Assert2.java
Assert2.containsAll
public static void containsAll(final Path expected, final Path actual) throws IOException { final Assertion<Path> exists = existsIn(expected, actual); if(Files.exists(expected)) { walkFileTree(expected, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(final Path file, final BasicFileAttributes attrs) throws IOException { assertThat(file, exists); return super.visitFile(file, attrs); } }); } }
java
public static void containsAll(final Path expected, final Path actual) throws IOException { final Assertion<Path> exists = existsIn(expected, actual); if(Files.exists(expected)) { walkFileTree(expected, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(final Path file, final BasicFileAttributes attrs) throws IOException { assertThat(file, exists); return super.visitFile(file, attrs); } }); } }
[ "public", "static", "void", "containsAll", "(", "final", "Path", "expected", ",", "final", "Path", "actual", ")", "throws", "IOException", "{", "final", "Assertion", "<", "Path", ">", "exists", "=", "existsIn", "(", "expected", ",", "actual", ")", ";", "if", "(", "Files", ".", "exists", "(", "expected", ")", ")", "{", "walkFileTree", "(", "expected", ",", "new", "SimpleFileVisitor", "<", "Path", ">", "(", ")", "{", "@", "Override", "public", "FileVisitResult", "visitFile", "(", "final", "Path", "file", ",", "final", "BasicFileAttributes", "attrs", ")", "throws", "IOException", "{", "assertThat", "(", "file", ",", "exists", ")", ";", "return", "super", ".", "visitFile", "(", "file", ",", "attrs", ")", ";", "}", "}", ")", ";", "}", "}" ]
Asserts that every file that exists relative to expected also exists relative to actual. @param expected the expected path @param actual the actual path @throws IOException if the paths cannot be walked
[ "Asserts", "that", "every", "file", "that", "exists", "relative", "to", "expected", "also", "exists", "relative", "to", "actual", "." ]
cbd88592e9b2fa9547c3bdd41e52e790061a2253
https://github.com/fuwjax/ev-oss/blob/cbd88592e9b2fa9547c3bdd41e52e790061a2253/funco/src/main/java/org/fuwjax/oss/util/assertion/Assert2.java#L107-L118
153,311
fuwjax/ev-oss
funco/src/main/java/org/fuwjax/oss/util/assertion/Assert2.java
Assert2.assertEquals
public static void assertEquals(final Path expected, final Path actual) throws IOException { containsAll(actual, expected); if(Files.exists(expected)) { containsAll(expected, actual); walkFileTree(expected, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(final Path file, final BasicFileAttributes attrs) throws IOException { final Path sub = relativize(expected, file); final Path therePath = resolve(actual, sub); final long hereSize = Files.size(file); final long thereSize = Files.size(therePath); assertThat(thereSize, asserts(() -> sub + " is " + hereSize + " bytes", t -> t == hereSize)); assertByteEquals(sub, file, therePath); return super.visitFile(file, attrs); } }); } }
java
public static void assertEquals(final Path expected, final Path actual) throws IOException { containsAll(actual, expected); if(Files.exists(expected)) { containsAll(expected, actual); walkFileTree(expected, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(final Path file, final BasicFileAttributes attrs) throws IOException { final Path sub = relativize(expected, file); final Path therePath = resolve(actual, sub); final long hereSize = Files.size(file); final long thereSize = Files.size(therePath); assertThat(thereSize, asserts(() -> sub + " is " + hereSize + " bytes", t -> t == hereSize)); assertByteEquals(sub, file, therePath); return super.visitFile(file, attrs); } }); } }
[ "public", "static", "void", "assertEquals", "(", "final", "Path", "expected", ",", "final", "Path", "actual", ")", "throws", "IOException", "{", "containsAll", "(", "actual", ",", "expected", ")", ";", "if", "(", "Files", ".", "exists", "(", "expected", ")", ")", "{", "containsAll", "(", "expected", ",", "actual", ")", ";", "walkFileTree", "(", "expected", ",", "new", "SimpleFileVisitor", "<", "Path", ">", "(", ")", "{", "@", "Override", "public", "FileVisitResult", "visitFile", "(", "final", "Path", "file", ",", "final", "BasicFileAttributes", "attrs", ")", "throws", "IOException", "{", "final", "Path", "sub", "=", "relativize", "(", "expected", ",", "file", ")", ";", "final", "Path", "therePath", "=", "resolve", "(", "actual", ",", "sub", ")", ";", "final", "long", "hereSize", "=", "Files", ".", "size", "(", "file", ")", ";", "final", "long", "thereSize", "=", "Files", ".", "size", "(", "therePath", ")", ";", "assertThat", "(", "thereSize", ",", "asserts", "(", "(", ")", "->", "sub", "+", "\" is \"", "+", "hereSize", "+", "\" bytes\"", ",", "t", "->", "t", "==", "hereSize", ")", ")", ";", "assertByteEquals", "(", "sub", ",", "file", ",", "therePath", ")", ";", "return", "super", ".", "visitFile", "(", "file", ",", "attrs", ")", ";", "}", "}", ")", ";", "}", "}" ]
Asserts that two paths are deeply byte-equivalent. @param expected one of the paths @param actual the other path @throws IOException if the paths cannot be traversed
[ "Asserts", "that", "two", "paths", "are", "deeply", "byte", "-", "equivalent", "." ]
cbd88592e9b2fa9547c3bdd41e52e790061a2253
https://github.com/fuwjax/ev-oss/blob/cbd88592e9b2fa9547c3bdd41e52e790061a2253/funco/src/main/java/org/fuwjax/oss/util/assertion/Assert2.java#L126-L143
153,312
fuwjax/ev-oss
funco/src/main/java/org/fuwjax/oss/util/assertion/Assert2.java
Assert2.assertByteEquals
public static void assertByteEquals(final Path sub, final Path expected, final Path actual) throws IOException { final int length = 4096; final byte[] hereBuffer = new byte[length]; final byte[] thereBuffer = new byte[length]; long hereLimit = 0; long thereLimit = 0; try(InputStream hereStream = newInputStream(expected); InputStream thereStream = newInputStream(actual)) { int line = 1; int ch = 0; for(long i = 0; i < Files.size(expected); i++) { if(i >= hereLimit) { hereLimit += read(hereStream, hereBuffer, hereLimit); } if(i >= thereLimit) { thereLimit += read(thereStream, thereBuffer, thereLimit); } final int c = hereBuffer[(int) (i % length)]; assertThat(thereBuffer[(int) (i % length)], asserts(message(sub, i, line, ch), t -> t == c)); if(c == '\n') { ch = 0; line++; } else { ch++; } } } }
java
public static void assertByteEquals(final Path sub, final Path expected, final Path actual) throws IOException { final int length = 4096; final byte[] hereBuffer = new byte[length]; final byte[] thereBuffer = new byte[length]; long hereLimit = 0; long thereLimit = 0; try(InputStream hereStream = newInputStream(expected); InputStream thereStream = newInputStream(actual)) { int line = 1; int ch = 0; for(long i = 0; i < Files.size(expected); i++) { if(i >= hereLimit) { hereLimit += read(hereStream, hereBuffer, hereLimit); } if(i >= thereLimit) { thereLimit += read(thereStream, thereBuffer, thereLimit); } final int c = hereBuffer[(int) (i % length)]; assertThat(thereBuffer[(int) (i % length)], asserts(message(sub, i, line, ch), t -> t == c)); if(c == '\n') { ch = 0; line++; } else { ch++; } } } }
[ "public", "static", "void", "assertByteEquals", "(", "final", "Path", "sub", ",", "final", "Path", "expected", ",", "final", "Path", "actual", ")", "throws", "IOException", "{", "final", "int", "length", "=", "4096", ";", "final", "byte", "[", "]", "hereBuffer", "=", "new", "byte", "[", "length", "]", ";", "final", "byte", "[", "]", "thereBuffer", "=", "new", "byte", "[", "length", "]", ";", "long", "hereLimit", "=", "0", ";", "long", "thereLimit", "=", "0", ";", "try", "(", "InputStream", "hereStream", "=", "newInputStream", "(", "expected", ")", ";", "InputStream", "thereStream", "=", "newInputStream", "(", "actual", ")", ")", "{", "int", "line", "=", "1", ";", "int", "ch", "=", "0", ";", "for", "(", "long", "i", "=", "0", ";", "i", "<", "Files", ".", "size", "(", "expected", ")", ";", "i", "++", ")", "{", "if", "(", "i", ">=", "hereLimit", ")", "{", "hereLimit", "+=", "read", "(", "hereStream", ",", "hereBuffer", ",", "hereLimit", ")", ";", "}", "if", "(", "i", ">=", "thereLimit", ")", "{", "thereLimit", "+=", "read", "(", "thereStream", ",", "thereBuffer", ",", "thereLimit", ")", ";", "}", "final", "int", "c", "=", "hereBuffer", "[", "(", "int", ")", "(", "i", "%", "length", ")", "]", ";", "assertThat", "(", "thereBuffer", "[", "(", "int", ")", "(", "i", "%", "length", ")", "]", ",", "asserts", "(", "message", "(", "sub", ",", "i", ",", "line", ",", "ch", ")", ",", "t", "->", "t", "==", "c", ")", ")", ";", "if", "(", "c", "==", "'", "'", ")", "{", "ch", "=", "0", ";", "line", "++", ";", "}", "else", "{", "ch", "++", ";", "}", "}", "}", "}" ]
Asserts that two paths are byte-equivalent. @param sub the shared portion of the two paths @param expected the expected path @param actual the actual path @throws IOException if the paths cannot be opened and consumed
[ "Asserts", "that", "two", "paths", "are", "byte", "-", "equivalent", "." ]
cbd88592e9b2fa9547c3bdd41e52e790061a2253
https://github.com/fuwjax/ev-oss/blob/cbd88592e9b2fa9547c3bdd41e52e790061a2253/funco/src/main/java/org/fuwjax/oss/util/assertion/Assert2.java#L152-L178
153,313
lightblueseas/file-worker
src/main/java/de/alpharogroup/file/checksum/ChecksumExtensions.java
ChecksumExtensions.getChecksum
public static String getChecksum(final Algorithm algorithm, final byte[]... byteArrays) throws NoSuchAlgorithmException { StringBuilder sb = new StringBuilder(); for (byte[] byteArray : byteArrays) { sb.append(getChecksum(byteArray, algorithm.getAlgorithm())); } return sb.toString(); }
java
public static String getChecksum(final Algorithm algorithm, final byte[]... byteArrays) throws NoSuchAlgorithmException { StringBuilder sb = new StringBuilder(); for (byte[] byteArray : byteArrays) { sb.append(getChecksum(byteArray, algorithm.getAlgorithm())); } return sb.toString(); }
[ "public", "static", "String", "getChecksum", "(", "final", "Algorithm", "algorithm", ",", "final", "byte", "[", "]", "...", "byteArrays", ")", "throws", "NoSuchAlgorithmException", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "byte", "[", "]", "byteArray", ":", "byteArrays", ")", "{", "sb", ".", "append", "(", "getChecksum", "(", "byteArray", ",", "algorithm", ".", "getAlgorithm", "(", ")", ")", ")", ";", "}", "return", "sb", ".", "toString", "(", ")", ";", "}" ]
Gets the checksum from the given byte arrays with the given algorithm @param algorithm the algorithm to get the checksum. This could be for instance "MD4", "MD5", "SHA-1", "SHA-256", "SHA-384" or "SHA-512". @param byteArrays the array of byte arrays @return The checksum from the given byte arrays as a String object. @throws NoSuchAlgorithmException Is thrown if the algorithm is not supported or does not exists. {@link java.security.MessageDigest} object.
[ "Gets", "the", "checksum", "from", "the", "given", "byte", "arrays", "with", "the", "given", "algorithm" ]
2c81de10fb5d68de64c1abc3ed64ca681ce76da8
https://github.com/lightblueseas/file-worker/blob/2c81de10fb5d68de64c1abc3ed64ca681ce76da8/src/main/java/de/alpharogroup/file/checksum/ChecksumExtensions.java#L80-L89
153,314
tvesalainen/util
ham/src/main/java/org/vesalainen/ham/itshfbc/GeoDB.java
GeoDB.search
public GeoLocation search(double deltaNM, GeoSearch... searches) { List<GeoLocation> list = search(false, searches); if (!list.isEmpty() && GeoDB.isUnique(list, deltaNM)) { return list.get(0); } else { list.removeIf((gl)->!gl.match(true, searches)); if (!list.isEmpty() && GeoDB.isUnique(list, deltaNM)) { return list.get(0); } else { return null; } } }
java
public GeoLocation search(double deltaNM, GeoSearch... searches) { List<GeoLocation> list = search(false, searches); if (!list.isEmpty() && GeoDB.isUnique(list, deltaNM)) { return list.get(0); } else { list.removeIf((gl)->!gl.match(true, searches)); if (!list.isEmpty() && GeoDB.isUnique(list, deltaNM)) { return list.get(0); } else { return null; } } }
[ "public", "GeoLocation", "search", "(", "double", "deltaNM", ",", "GeoSearch", "...", "searches", ")", "{", "List", "<", "GeoLocation", ">", "list", "=", "search", "(", "false", ",", "searches", ")", ";", "if", "(", "!", "list", ".", "isEmpty", "(", ")", "&&", "GeoDB", ".", "isUnique", "(", "list", ",", "deltaNM", ")", ")", "{", "return", "list", ".", "get", "(", "0", ")", ";", "}", "else", "{", "list", ".", "removeIf", "(", "(", "gl", ")", "-", ">", "!", "gl", ".", "match", "(", "true", ",", "searches", ")", ")", ";", "if", "(", "!", "list", ".", "isEmpty", "(", ")", "&&", "GeoDB", ".", "isUnique", "(", "list", ",", "deltaNM", ")", ")", "{", "return", "list", ".", "get", "(", "0", ")", ";", "}", "else", "{", "return", "null", ";", "}", "}", "}" ]
Returns any GeoLocation which matches all tests and is unique in deltaNM range. @param deltaNM @param searches @return
[ "Returns", "any", "GeoLocation", "which", "matches", "all", "tests", "and", "is", "unique", "in", "deltaNM", "range", "." ]
bba7a44689f638ffabc8be40a75bdc9a33676433
https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/ham/src/main/java/org/vesalainen/ham/itshfbc/GeoDB.java#L60-L79
153,315
tvesalainen/util
ham/src/main/java/org/vesalainen/ham/itshfbc/GeoDB.java
GeoDB.search
public List<GeoLocation> search(boolean strict, GeoSearch... searches) { List<GeoLocation> list = new ArrayList<>(); for (GeoFile gf : files) { gf.search(strict, list, searches); } return list; }
java
public List<GeoLocation> search(boolean strict, GeoSearch... searches) { List<GeoLocation> list = new ArrayList<>(); for (GeoFile gf : files) { gf.search(strict, list, searches); } return list; }
[ "public", "List", "<", "GeoLocation", ">", "search", "(", "boolean", "strict", ",", "GeoSearch", "...", "searches", ")", "{", "List", "<", "GeoLocation", ">", "list", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "GeoFile", "gf", ":", "files", ")", "{", "gf", ".", "search", "(", "strict", ",", "list", ",", "searches", ")", ";", "}", "return", "list", ";", "}" ]
Returns a list of GeoLocations which match all the searches @param searches @return
[ "Returns", "a", "list", "of", "GeoLocations", "which", "match", "all", "the", "searches" ]
bba7a44689f638ffabc8be40a75bdc9a33676433
https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/ham/src/main/java/org/vesalainen/ham/itshfbc/GeoDB.java#L85-L93
153,316
tvesalainen/util
ham/src/main/java/org/vesalainen/ham/itshfbc/GeoDB.java
GeoDB.isUnique
public static boolean isUnique(List<GeoLocation> list, double delta) { Location[] array = new Location[list.size()]; int index = 0; for (GeoLocation gl : list) { array[index++] = gl.getLocation(); } return (Location.radius(array) <= delta); }
java
public static boolean isUnique(List<GeoLocation> list, double delta) { Location[] array = new Location[list.size()]; int index = 0; for (GeoLocation gl : list) { array[index++] = gl.getLocation(); } return (Location.radius(array) <= delta); }
[ "public", "static", "boolean", "isUnique", "(", "List", "<", "GeoLocation", ">", "list", ",", "double", "delta", ")", "{", "Location", "[", "]", "array", "=", "new", "Location", "[", "list", ".", "size", "(", ")", "]", ";", "int", "index", "=", "0", ";", "for", "(", "GeoLocation", "gl", ":", "list", ")", "{", "array", "[", "index", "++", "]", "=", "gl", ".", "getLocation", "(", ")", ";", "}", "return", "(", "Location", ".", "radius", "(", "array", ")", "<=", "delta", ")", ";", "}" ]
Returns true if greatest distance of any location from their center is less than given delta in nm. @param list @param delta @return
[ "Returns", "true", "if", "greatest", "distance", "of", "any", "location", "from", "their", "center", "is", "less", "than", "given", "delta", "in", "nm", "." ]
bba7a44689f638ffabc8be40a75bdc9a33676433
https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/ham/src/main/java/org/vesalainen/ham/itshfbc/GeoDB.java#L101-L110
153,317
mlhartme/jasmin
src/main/java/net/oneandone/jasmin/model/Repository.java
Repository.load
public static Repository load(Resolver resolver) throws IOException { Repository repository; repository = new Repository(); repository.loadClasspath(resolver); repository.link(); return repository; }
java
public static Repository load(Resolver resolver) throws IOException { Repository repository; repository = new Repository(); repository.loadClasspath(resolver); repository.link(); return repository; }
[ "public", "static", "Repository", "load", "(", "Resolver", "resolver", ")", "throws", "IOException", "{", "Repository", "repository", ";", "repository", "=", "new", "Repository", "(", ")", ";", "repository", ".", "loadClasspath", "(", "resolver", ")", ";", "repository", ".", "link", "(", ")", ";", "return", "repository", ";", "}" ]
simplified load method for testing
[ "simplified", "load", "method", "for", "testing" ]
1c44339a2555ae7ffb7d40fd3a7d80d81c3fc39d
https://github.com/mlhartme/jasmin/blob/1c44339a2555ae7ffb7d40fd3a7d80d81c3fc39d/src/main/java/net/oneandone/jasmin/model/Repository.java#L47-L54
153,318
mlhartme/jasmin
src/main/java/net/oneandone/jasmin/model/Repository.java
Repository.loadClasspath
public void loadClasspath(Resolver resolver) throws IOException { Enumeration<URL> e; e = getClass().getClassLoader().getResources(MODULE_DESCRIPTOR); while (e.hasMoreElements()) { loadModule(resolver, e.nextElement()); } }
java
public void loadClasspath(Resolver resolver) throws IOException { Enumeration<URL> e; e = getClass().getClassLoader().getResources(MODULE_DESCRIPTOR); while (e.hasMoreElements()) { loadModule(resolver, e.nextElement()); } }
[ "public", "void", "loadClasspath", "(", "Resolver", "resolver", ")", "throws", "IOException", "{", "Enumeration", "<", "URL", ">", "e", ";", "e", "=", "getClass", "(", ")", ".", "getClassLoader", "(", ")", ".", "getResources", "(", "MODULE_DESCRIPTOR", ")", ";", "while", "(", "e", ".", "hasMoreElements", "(", ")", ")", "{", "loadModule", "(", "resolver", ",", "e", ".", "nextElement", "(", ")", ")", ";", "}", "}" ]
Loads modules from classpath
[ "Loads", "modules", "from", "classpath" ]
1c44339a2555ae7ffb7d40fd3a7d80d81c3fc39d
https://github.com/mlhartme/jasmin/blob/1c44339a2555ae7ffb7d40fd3a7d80d81c3fc39d/src/main/java/net/oneandone/jasmin/model/Repository.java#L237-L244
153,319
mlhartme/jasmin
src/main/java/net/oneandone/jasmin/model/Repository.java
Repository.loadLibrary
public void loadLibrary(Resolver resolver, Node base, Node descriptor, Node properties) throws IOException { Source source; Module module; Library library; File file; addReload(descriptor); source = Source.load(properties, base); library = (Library) Library.TYPE.loadXml(descriptor).get(); autoFiles(resolver, library, source); for (net.oneandone.jasmin.descriptor.Module descriptorModule : library.modules()) { module = new Module(descriptorModule.getName(), source); notLinked.put(module, descriptorModule.dependencies()); for (Resource resource : descriptorModule.resources()) { file = resolver.resolve(source.classpathBase, resource); addReload(file); resolver.resolve(source.classpathBase, resource); module.files().add(file); } add(module); } }
java
public void loadLibrary(Resolver resolver, Node base, Node descriptor, Node properties) throws IOException { Source source; Module module; Library library; File file; addReload(descriptor); source = Source.load(properties, base); library = (Library) Library.TYPE.loadXml(descriptor).get(); autoFiles(resolver, library, source); for (net.oneandone.jasmin.descriptor.Module descriptorModule : library.modules()) { module = new Module(descriptorModule.getName(), source); notLinked.put(module, descriptorModule.dependencies()); for (Resource resource : descriptorModule.resources()) { file = resolver.resolve(source.classpathBase, resource); addReload(file); resolver.resolve(source.classpathBase, resource); module.files().add(file); } add(module); } }
[ "public", "void", "loadLibrary", "(", "Resolver", "resolver", ",", "Node", "base", ",", "Node", "descriptor", ",", "Node", "properties", ")", "throws", "IOException", "{", "Source", "source", ";", "Module", "module", ";", "Library", "library", ";", "File", "file", ";", "addReload", "(", "descriptor", ")", ";", "source", "=", "Source", ".", "load", "(", "properties", ",", "base", ")", ";", "library", "=", "(", "Library", ")", "Library", ".", "TYPE", ".", "loadXml", "(", "descriptor", ")", ".", "get", "(", ")", ";", "autoFiles", "(", "resolver", ",", "library", ",", "source", ")", ";", "for", "(", "net", ".", "oneandone", ".", "jasmin", ".", "descriptor", ".", "Module", "descriptorModule", ":", "library", ".", "modules", "(", ")", ")", "{", "module", "=", "new", "Module", "(", "descriptorModule", ".", "getName", "(", ")", ",", "source", ")", ";", "notLinked", ".", "put", "(", "module", ",", "descriptorModule", ".", "dependencies", "(", ")", ")", ";", "for", "(", "Resource", "resource", ":", "descriptorModule", ".", "resources", "(", ")", ")", "{", "file", "=", "resolver", ".", "resolve", "(", "source", ".", "classpathBase", ",", "resource", ")", ";", "addReload", "(", "file", ")", ";", "resolver", ".", "resolve", "(", "source", ".", "classpathBase", ",", "resource", ")", ";", "module", ".", "files", "(", ")", ".", "add", "(", "file", ")", ";", "}", "add", "(", "module", ")", ";", "}", "}" ]
Core method for loading. A library is a module or an application @param base jar file for module, docroot for application
[ "Core", "method", "for", "loading", ".", "A", "library", "is", "a", "module", "or", "an", "application" ]
1c44339a2555ae7ffb7d40fd3a7d80d81c3fc39d
https://github.com/mlhartme/jasmin/blob/1c44339a2555ae7ffb7d40fd3a7d80d81c3fc39d/src/main/java/net/oneandone/jasmin/model/Repository.java#L279-L300
153,320
mlhartme/jasmin
src/main/java/net/oneandone/jasmin/model/Repository.java
Repository.link
public List<Node> link() { List<Module> dependencies; Module module; Module resolved; StringBuilder problems; List<Node> result; problems = new StringBuilder(); for (Map.Entry<Module, List<String>> entry : notLinked.entrySet()) { module = entry.getKey(); dependencies = module.dependencies(); for (String name : entry.getValue()) { resolved = lookup(name); if (resolved == null) { problems.append("module '" + module.getName() + "': cannot resolve dependency '" + name + "'\n"); } else { dependencies.add(resolved); } } } if (problems.length() > 0) { throw new IllegalArgumentException(problems.toString()); } result = reloadFiles; notLinked = null; reloadFiles = null; return result; }
java
public List<Node> link() { List<Module> dependencies; Module module; Module resolved; StringBuilder problems; List<Node> result; problems = new StringBuilder(); for (Map.Entry<Module, List<String>> entry : notLinked.entrySet()) { module = entry.getKey(); dependencies = module.dependencies(); for (String name : entry.getValue()) { resolved = lookup(name); if (resolved == null) { problems.append("module '" + module.getName() + "': cannot resolve dependency '" + name + "'\n"); } else { dependencies.add(resolved); } } } if (problems.length() > 0) { throw new IllegalArgumentException(problems.toString()); } result = reloadFiles; notLinked = null; reloadFiles = null; return result; }
[ "public", "List", "<", "Node", ">", "link", "(", ")", "{", "List", "<", "Module", ">", "dependencies", ";", "Module", "module", ";", "Module", "resolved", ";", "StringBuilder", "problems", ";", "List", "<", "Node", ">", "result", ";", "problems", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "Map", ".", "Entry", "<", "Module", ",", "List", "<", "String", ">", ">", "entry", ":", "notLinked", ".", "entrySet", "(", ")", ")", "{", "module", "=", "entry", ".", "getKey", "(", ")", ";", "dependencies", "=", "module", ".", "dependencies", "(", ")", ";", "for", "(", "String", "name", ":", "entry", ".", "getValue", "(", ")", ")", "{", "resolved", "=", "lookup", "(", "name", ")", ";", "if", "(", "resolved", "==", "null", ")", "{", "problems", ".", "append", "(", "\"module '\"", "+", "module", ".", "getName", "(", ")", "+", "\"': cannot resolve dependency '\"", "+", "name", "+", "\"'\\n\"", ")", ";", "}", "else", "{", "dependencies", ".", "add", "(", "resolved", ")", ";", "}", "}", "}", "if", "(", "problems", ".", "length", "(", ")", ">", "0", ")", "{", "throw", "new", "IllegalArgumentException", "(", "problems", ".", "toString", "(", ")", ")", ";", "}", "result", "=", "reloadFiles", ";", "notLinked", "=", "null", ";", "reloadFiles", "=", "null", ";", "return", "result", ";", "}" ]
Call this after you've loaded all libraries @return reload files
[ "Call", "this", "after", "you", "ve", "loaded", "all", "libraries" ]
1c44339a2555ae7ffb7d40fd3a7d80d81c3fc39d
https://github.com/mlhartme/jasmin/blob/1c44339a2555ae7ffb7d40fd3a7d80d81c3fc39d/src/main/java/net/oneandone/jasmin/model/Repository.java#L501-L528
153,321
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/field/event/InitOnceFieldHandler.java
InitOnceFieldHandler.doSetData
public int doSetData(Object objData, boolean bDisplayOption, int iMoveMode) { int iErrorCode = DBConstants.NORMAL_RETURN; if ((m_bFirstTime) || (iMoveMode == DBConstants.READ_MOVE) || (iMoveMode == DBConstants.SCREEN_MOVE)) iErrorCode = super.doSetData(objData, bDisplayOption, iMoveMode); m_bFirstTime = false; // No more Inits allowed return iErrorCode; }
java
public int doSetData(Object objData, boolean bDisplayOption, int iMoveMode) { int iErrorCode = DBConstants.NORMAL_RETURN; if ((m_bFirstTime) || (iMoveMode == DBConstants.READ_MOVE) || (iMoveMode == DBConstants.SCREEN_MOVE)) iErrorCode = super.doSetData(objData, bDisplayOption, iMoveMode); m_bFirstTime = false; // No more Inits allowed return iErrorCode; }
[ "public", "int", "doSetData", "(", "Object", "objData", ",", "boolean", "bDisplayOption", ",", "int", "iMoveMode", ")", "{", "int", "iErrorCode", "=", "DBConstants", ".", "NORMAL_RETURN", ";", "if", "(", "(", "m_bFirstTime", ")", "||", "(", "iMoveMode", "==", "DBConstants", ".", "READ_MOVE", ")", "||", "(", "iMoveMode", "==", "DBConstants", ".", "SCREEN_MOVE", ")", ")", "iErrorCode", "=", "super", ".", "doSetData", "(", "objData", ",", "bDisplayOption", ",", "iMoveMode", ")", ";", "m_bFirstTime", "=", "false", ";", "// No more Inits allowed", "return", "iErrorCode", ";", "}" ]
Move the physical binary data to this field. If this is an init set, only does it until the first change. @param objData the raw data to set the basefield to. @param bDisplayOption If true, display the change. @param iMoveMode The type of move being done (init/read/screen). @return The error code (or NORMAL_RETURN if okay).
[ "Move", "the", "physical", "binary", "data", "to", "this", "field", ".", "If", "this", "is", "an", "init", "set", "only", "does", "it", "until", "the", "first", "change", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/event/InitOnceFieldHandler.java#L120-L127
153,322
jbundle/jbundle
thin/base/screen/util-misc/src/main/java/org/jbundle/thin/base/screen/util/html/JHtmlEditor.java
JHtmlEditor.init
public void init(BaseApplet applet, URL url) { m_applet = applet; this.setContentType(HTML_CONTENT); this.setEditable(false); this.addHyperlinkListener(this.createHyperLinkListener()); this.setOpaque(false); this.setSize(new Dimension(500, 800)); if (url != null) this.linkActivated(url, applet, 0); }
java
public void init(BaseApplet applet, URL url) { m_applet = applet; this.setContentType(HTML_CONTENT); this.setEditable(false); this.addHyperlinkListener(this.createHyperLinkListener()); this.setOpaque(false); this.setSize(new Dimension(500, 800)); if (url != null) this.linkActivated(url, applet, 0); }
[ "public", "void", "init", "(", "BaseApplet", "applet", ",", "URL", "url", ")", "{", "m_applet", "=", "applet", ";", "this", ".", "setContentType", "(", "HTML_CONTENT", ")", ";", "this", ".", "setEditable", "(", "false", ")", ";", "this", ".", "addHyperlinkListener", "(", "this", ".", "createHyperLinkListener", "(", ")", ")", ";", "this", ".", "setOpaque", "(", "false", ")", ";", "this", ".", "setSize", "(", "new", "Dimension", "(", "500", ",", "800", ")", ")", ";", "if", "(", "url", "!=", "null", ")", "this", ".", "linkActivated", "(", "url", ",", "applet", ",", "0", ")", ";", "}" ]
HTMLView Constructor.
[ "HTMLView", "Constructor", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/util-misc/src/main/java/org/jbundle/thin/base/screen/util/html/JHtmlEditor.java#L66-L78
153,323
jbundle/jbundle
thin/base/screen/util-misc/src/main/java/org/jbundle/thin/base/screen/util/html/JHtmlEditor.java
JHtmlEditor.createHyperLinkListener
public HyperlinkListener createHyperLinkListener() { return new HyperlinkListener() { public void hyperlinkUpdate(HyperlinkEvent e) { if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { if (e instanceof HTMLFrameHyperlinkEvent) { ((HTMLDocument)getDocument()).processHTMLFrameHyperlinkEvent((HTMLFrameHyperlinkEvent)e); } else { URL url = e.getURL(); if (getCallingApplet() != null) if (getHelpPane() != null) { String strQuery = url.getQuery(); if ((strQuery != null) && (strQuery.length() > 0) && (strQuery.indexOf(Params.HELP + "=") == -1)) { // This is a command, not a new help screen if (BaseApplet.handleAction("?" + strQuery, getCallingApplet(), null, 0)) // Try to have my calling screen handle it url = null; // Handled } } if (url != null) linkActivated(url, m_applet, 0); } } } }; }
java
public HyperlinkListener createHyperLinkListener() { return new HyperlinkListener() { public void hyperlinkUpdate(HyperlinkEvent e) { if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { if (e instanceof HTMLFrameHyperlinkEvent) { ((HTMLDocument)getDocument()).processHTMLFrameHyperlinkEvent((HTMLFrameHyperlinkEvent)e); } else { URL url = e.getURL(); if (getCallingApplet() != null) if (getHelpPane() != null) { String strQuery = url.getQuery(); if ((strQuery != null) && (strQuery.length() > 0) && (strQuery.indexOf(Params.HELP + "=") == -1)) { // This is a command, not a new help screen if (BaseApplet.handleAction("?" + strQuery, getCallingApplet(), null, 0)) // Try to have my calling screen handle it url = null; // Handled } } if (url != null) linkActivated(url, m_applet, 0); } } } }; }
[ "public", "HyperlinkListener", "createHyperLinkListener", "(", ")", "{", "return", "new", "HyperlinkListener", "(", ")", "{", "public", "void", "hyperlinkUpdate", "(", "HyperlinkEvent", "e", ")", "{", "if", "(", "e", ".", "getEventType", "(", ")", "==", "HyperlinkEvent", ".", "EventType", ".", "ACTIVATED", ")", "{", "if", "(", "e", "instanceof", "HTMLFrameHyperlinkEvent", ")", "{", "(", "(", "HTMLDocument", ")", "getDocument", "(", ")", ")", ".", "processHTMLFrameHyperlinkEvent", "(", "(", "HTMLFrameHyperlinkEvent", ")", "e", ")", ";", "}", "else", "{", "URL", "url", "=", "e", ".", "getURL", "(", ")", ";", "if", "(", "getCallingApplet", "(", ")", "!=", "null", ")", "if", "(", "getHelpPane", "(", ")", "!=", "null", ")", "{", "String", "strQuery", "=", "url", ".", "getQuery", "(", ")", ";", "if", "(", "(", "strQuery", "!=", "null", ")", "&&", "(", "strQuery", ".", "length", "(", ")", ">", "0", ")", "&&", "(", "strQuery", ".", "indexOf", "(", "Params", ".", "HELP", "+", "\"=\"", ")", "==", "-", "1", ")", ")", "{", "// This is a command, not a new help screen", "if", "(", "BaseApplet", ".", "handleAction", "(", "\"?\"", "+", "strQuery", ",", "getCallingApplet", "(", ")", ",", "null", ",", "0", ")", ")", "// Try to have my calling screen handle it", "url", "=", "null", ";", "// Handled", "}", "}", "if", "(", "url", "!=", "null", ")", "linkActivated", "(", "url", ",", "m_applet", ",", "0", ")", ";", "}", "}", "}", "}", ";", "}" ]
Create the hyperlink listener. @return The hyperlink listener.
[ "Create", "the", "hyperlink", "listener", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/util-misc/src/main/java/org/jbundle/thin/base/screen/util/html/JHtmlEditor.java#L142-L172
153,324
jbundle/jbundle
thin/base/screen/util-misc/src/main/java/org/jbundle/thin/base/screen/util/html/JHtmlEditor.java
JHtmlEditor.setHTMLText
public void setHTMLText(String strHtmlText) { if (m_helpPane != null) m_helpPane.setVisible(strHtmlText != null); this.getTaskScheduler().addTask(PrivateTaskScheduler.CLEAR_JOBS); // Dump any stacked tasks Thread thread = new SwingSyncPageWorker(this, new SyncPageLoader(null, strHtmlText, this, m_applet, false)); this.getTaskScheduler().addTask(thread); }
java
public void setHTMLText(String strHtmlText) { if (m_helpPane != null) m_helpPane.setVisible(strHtmlText != null); this.getTaskScheduler().addTask(PrivateTaskScheduler.CLEAR_JOBS); // Dump any stacked tasks Thread thread = new SwingSyncPageWorker(this, new SyncPageLoader(null, strHtmlText, this, m_applet, false)); this.getTaskScheduler().addTask(thread); }
[ "public", "void", "setHTMLText", "(", "String", "strHtmlText", ")", "{", "if", "(", "m_helpPane", "!=", "null", ")", "m_helpPane", ".", "setVisible", "(", "strHtmlText", "!=", "null", ")", ";", "this", ".", "getTaskScheduler", "(", ")", ".", "addTask", "(", "PrivateTaskScheduler", ".", "CLEAR_JOBS", ")", ";", "// Dump any stacked tasks", "Thread", "thread", "=", "new", "SwingSyncPageWorker", "(", "this", ",", "new", "SyncPageLoader", "(", "null", ",", "strHtmlText", ",", "this", ",", "m_applet", ",", "false", ")", ")", ";", "this", ".", "getTaskScheduler", "(", ")", ".", "addTask", "(", "thread", ")", ";", "}" ]
Set this control to this html text. @param strHtmlText
[ "Set", "this", "control", "to", "this", "html", "text", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/util-misc/src/main/java/org/jbundle/thin/base/screen/util/html/JHtmlEditor.java#L177-L185
153,325
jbundle/jbundle
thin/base/screen/util-misc/src/main/java/org/jbundle/thin/base/screen/util/html/JHtmlEditor.java
JHtmlEditor.getTaskScheduler
public TaskScheduler getTaskScheduler() { if (m_taskScheduler == null) m_taskScheduler = new PrivateTaskScheduler(this.getBaseApplet().getApplication(), 0, true); return m_taskScheduler; }
java
public TaskScheduler getTaskScheduler() { if (m_taskScheduler == null) m_taskScheduler = new PrivateTaskScheduler(this.getBaseApplet().getApplication(), 0, true); return m_taskScheduler; }
[ "public", "TaskScheduler", "getTaskScheduler", "(", ")", "{", "if", "(", "m_taskScheduler", "==", "null", ")", "m_taskScheduler", "=", "new", "PrivateTaskScheduler", "(", "this", ".", "getBaseApplet", "(", ")", ".", "getApplication", "(", ")", ",", "0", ",", "true", ")", ";", "return", "m_taskScheduler", ";", "}" ]
Get my private task scheduler. @return The scheduler.
[ "Get", "my", "private", "task", "scheduler", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/util-misc/src/main/java/org/jbundle/thin/base/screen/util/html/JHtmlEditor.java#L228-L233
153,326
arxanchain/java-common
src/main/java/com/arxanfintech/common/util/Utils.java
Utils.addressStringToBytes
public static byte[] addressStringToBytes(String hex) { final byte[] addr; try { addr = Hex.decode(hex); } catch (DecoderException addressIsNotValid) { return null; } if (isValidAddress(addr)) return addr; return null; }
java
public static byte[] addressStringToBytes(String hex) { final byte[] addr; try { addr = Hex.decode(hex); } catch (DecoderException addressIsNotValid) { return null; } if (isValidAddress(addr)) return addr; return null; }
[ "public", "static", "byte", "[", "]", "addressStringToBytes", "(", "String", "hex", ")", "{", "final", "byte", "[", "]", "addr", ";", "try", "{", "addr", "=", "Hex", ".", "decode", "(", "hex", ")", ";", "}", "catch", "(", "DecoderException", "addressIsNotValid", ")", "{", "return", "null", ";", "}", "if", "(", "isValidAddress", "(", "addr", ")", ")", "return", "addr", ";", "return", "null", ";", "}" ]
Decodes a hex string to address bytes and checks validity @param hex - a hex string of the address, e.g., 6c386a4b26f73c802f34673f7248bb118f97424a @return - decode and validated address byte[]
[ "Decodes", "a", "hex", "string", "to", "address", "bytes", "and", "checks", "validity" ]
3ddfedfd948f5bab3fee0b74b85cdce4702ed84e
https://github.com/arxanchain/java-common/blob/3ddfedfd948f5bab3fee0b74b85cdce4702ed84e/src/main/java/com/arxanfintech/common/util/Utils.java#L109-L120
153,327
nwillc/almost-functional
src/main/java/almost/functional/Stream.java
Stream.of
public static <R> Stream<R> of(R... elements) { return new Stream<R>(new ArrayIterable.ArrayIterator<R>(elements)); }
java
public static <R> Stream<R> of(R... elements) { return new Stream<R>(new ArrayIterable.ArrayIterator<R>(elements)); }
[ "public", "static", "<", "R", ">", "Stream", "<", "R", ">", "of", "(", "R", "...", "elements", ")", "{", "return", "new", "Stream", "<", "R", ">", "(", "new", "ArrayIterable", ".", "ArrayIterator", "<", "R", ">", "(", "elements", ")", ")", ";", "}" ]
Create a stream of the elements provided. @param elements elements of the new stream @param <R> type of elements @return a new stream
[ "Create", "a", "stream", "of", "the", "elements", "provided", "." ]
a6cc7c73b2be475ed1bce5128c24b2eb9c27d666
https://github.com/nwillc/almost-functional/blob/a6cc7c73b2be475ed1bce5128c24b2eb9c27d666/src/main/java/almost/functional/Stream.java#L58-L60
153,328
nwillc/almost-functional
src/main/java/almost/functional/Stream.java
Stream.of
public static <R> Stream<R> of(Iterator<R> iterator) { return new Stream<R>(iterator); }
java
public static <R> Stream<R> of(Iterator<R> iterator) { return new Stream<R>(iterator); }
[ "public", "static", "<", "R", ">", "Stream", "<", "R", ">", "of", "(", "Iterator", "<", "R", ">", "iterator", ")", "{", "return", "new", "Stream", "<", "R", ">", "(", "iterator", ")", ";", "}" ]
Create a stream based on an iterator. @param iterator the iterator @param <R> type of elements @return a new stream @since 1.9.1
[ "Create", "a", "stream", "based", "on", "an", "iterator", "." ]
a6cc7c73b2be475ed1bce5128c24b2eb9c27d666
https://github.com/nwillc/almost-functional/blob/a6cc7c73b2be475ed1bce5128c24b2eb9c27d666/src/main/java/almost/functional/Stream.java#L70-L72
153,329
nwillc/almost-functional
src/main/java/almost/functional/Stream.java
Stream.reduce
public Optional<T> reduce(final BiFunction<T, ? super T, T> accumulator) { boolean found = false; T result = null; while (iterator.hasNext()) { if (!found) { result = iterator.next(); found = true; } else { result = accumulator.apply(result, iterator.next()); } } return found ? Optional.of(result) : Optional.<T>empty(); }
java
public Optional<T> reduce(final BiFunction<T, ? super T, T> accumulator) { boolean found = false; T result = null; while (iterator.hasNext()) { if (!found) { result = iterator.next(); found = true; } else { result = accumulator.apply(result, iterator.next()); } } return found ? Optional.of(result) : Optional.<T>empty(); }
[ "public", "Optional", "<", "T", ">", "reduce", "(", "final", "BiFunction", "<", "T", ",", "?", "super", "T", ",", "T", ">", "accumulator", ")", "{", "boolean", "found", "=", "false", ";", "T", "result", "=", "null", ";", "while", "(", "iterator", ".", "hasNext", "(", ")", ")", "{", "if", "(", "!", "found", ")", "{", "result", "=", "iterator", ".", "next", "(", ")", ";", "found", "=", "true", ";", "}", "else", "{", "result", "=", "accumulator", ".", "apply", "(", "result", ",", "iterator", ".", "next", "(", ")", ")", ";", "}", "}", "return", "found", "?", "Optional", ".", "of", "(", "result", ")", ":", "Optional", ".", "<", "T", ">", "empty", "(", ")", ";", "}" ]
Performs a reduction on the elements of the stream, using an accumulation function, and returns an Optional describing the reduced value, if any. @param accumulator an associative function for combining two values @return value of the reduction if any
[ "Performs", "a", "reduction", "on", "the", "elements", "of", "the", "stream", "using", "an", "accumulation", "function", "and", "returns", "an", "Optional", "describing", "the", "reduced", "value", "if", "any", "." ]
a6cc7c73b2be475ed1bce5128c24b2eb9c27d666
https://github.com/nwillc/almost-functional/blob/a6cc7c73b2be475ed1bce5128c24b2eb9c27d666/src/main/java/almost/functional/Stream.java#L95-L107
153,330
nwillc/almost-functional
src/main/java/almost/functional/Stream.java
Stream.reduce
public <R> R reduce(final R initial, final BiFunction<R, ? super T, R> accumulator) { R returnValue = initial; while (iterator.hasNext()) { returnValue = accumulator.apply(returnValue, iterator.next()); } return returnValue; }
java
public <R> R reduce(final R initial, final BiFunction<R, ? super T, R> accumulator) { R returnValue = initial; while (iterator.hasNext()) { returnValue = accumulator.apply(returnValue, iterator.next()); } return returnValue; }
[ "public", "<", "R", ">", "R", "reduce", "(", "final", "R", "initial", ",", "final", "BiFunction", "<", "R", ",", "?", "super", "T", ",", "R", ">", "accumulator", ")", "{", "R", "returnValue", "=", "initial", ";", "while", "(", "iterator", ".", "hasNext", "(", ")", ")", "{", "returnValue", "=", "accumulator", ".", "apply", "(", "returnValue", ",", "iterator", ".", "next", "(", ")", ")", ";", "}", "return", "returnValue", ";", "}" ]
Performs a reduction on the elements of this stream, using the provided initial value and accumulation functions. @param initial the initial value @param accumulator the acummulation function @param <R> return type @return the result of the reduction
[ "Performs", "a", "reduction", "on", "the", "elements", "of", "this", "stream", "using", "the", "provided", "initial", "value", "and", "accumulation", "functions", "." ]
a6cc7c73b2be475ed1bce5128c24b2eb9c27d666
https://github.com/nwillc/almost-functional/blob/a6cc7c73b2be475ed1bce5128c24b2eb9c27d666/src/main/java/almost/functional/Stream.java#L117-L123
153,331
nwillc/almost-functional
src/main/java/almost/functional/Stream.java
Stream.map
public <R> Stream<R> map(Function<? super T, ? extends R> mapper) { List<R> list = new ArrayList<R>(); while (iterator.hasNext()) { list.add(mapper.apply(iterator.next())); } return Stream.of(list); }
java
public <R> Stream<R> map(Function<? super T, ? extends R> mapper) { List<R> list = new ArrayList<R>(); while (iterator.hasNext()) { list.add(mapper.apply(iterator.next())); } return Stream.of(list); }
[ "public", "<", "R", ">", "Stream", "<", "R", ">", "map", "(", "Function", "<", "?", "super", "T", ",", "?", "extends", "R", ">", "mapper", ")", "{", "List", "<", "R", ">", "list", "=", "new", "ArrayList", "<", "R", ">", "(", ")", ";", "while", "(", "iterator", ".", "hasNext", "(", ")", ")", "{", "list", ".", "add", "(", "mapper", ".", "apply", "(", "iterator", ".", "next", "(", ")", ")", ")", ";", "}", "return", "Stream", ".", "of", "(", "list", ")", ";", "}" ]
Returns a stream consisting of the results of applying the given function to the elements of this stream. @param mapper function to apply to each element @param <R> The element type of the new stream @return the new stream
[ "Returns", "a", "stream", "consisting", "of", "the", "results", "of", "applying", "the", "given", "function", "to", "the", "elements", "of", "this", "stream", "." ]
a6cc7c73b2be475ed1bce5128c24b2eb9c27d666
https://github.com/nwillc/almost-functional/blob/a6cc7c73b2be475ed1bce5128c24b2eb9c27d666/src/main/java/almost/functional/Stream.java#L149-L155
153,332
nwillc/almost-functional
src/main/java/almost/functional/Stream.java
Stream.anyMatch
public boolean anyMatch(Predicate<? super T> predicate) { while (iterator.hasNext()) { if (predicate.test(iterator.next())) { return true; } } return false; }
java
public boolean anyMatch(Predicate<? super T> predicate) { while (iterator.hasNext()) { if (predicate.test(iterator.next())) { return true; } } return false; }
[ "public", "boolean", "anyMatch", "(", "Predicate", "<", "?", "super", "T", ">", "predicate", ")", "{", "while", "(", "iterator", ".", "hasNext", "(", ")", ")", "{", "if", "(", "predicate", ".", "test", "(", "iterator", ".", "next", "(", ")", ")", ")", "{", "return", "true", ";", "}", "}", "return", "false", ";", "}" ]
Returns whether any elements of this stream match the provided predicate. If the stream is empty then false is returned and the predicate is not evaluated. @param predicate to apply to elements of this stream @return true if any elements of the stream match the provided predicate
[ "Returns", "whether", "any", "elements", "of", "this", "stream", "match", "the", "provided", "predicate", ".", "If", "the", "stream", "is", "empty", "then", "false", "is", "returned", "and", "the", "predicate", "is", "not", "evaluated", "." ]
a6cc7c73b2be475ed1bce5128c24b2eb9c27d666
https://github.com/nwillc/almost-functional/blob/a6cc7c73b2be475ed1bce5128c24b2eb9c27d666/src/main/java/almost/functional/Stream.java#L164-L171
153,333
nwillc/almost-functional
src/main/java/almost/functional/Stream.java
Stream.concat
@SuppressWarnings("unchecked") public static <T> Stream<T> concat(Stream<? extends T> a, Stream<? extends T> b) { return new Stream(Iterators.concat(a.iterator, b.iterator)); }
java
@SuppressWarnings("unchecked") public static <T> Stream<T> concat(Stream<? extends T> a, Stream<? extends T> b) { return new Stream(Iterators.concat(a.iterator, b.iterator)); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "T", ">", "Stream", "<", "T", ">", "concat", "(", "Stream", "<", "?", "extends", "T", ">", "a", ",", "Stream", "<", "?", "extends", "T", ">", "b", ")", "{", "return", "new", "Stream", "(", "Iterators", ".", "concat", "(", "a", ".", "iterator", ",", "b", ".", "iterator", ")", ")", ";", "}" ]
Creates a concatenated stream whose elements are all the elements of the first stream followed by all the elements of the second stream. @param a first stream @param b second stream @param <T> type of elements @return a stream concatenating first and second
[ "Creates", "a", "concatenated", "stream", "whose", "elements", "are", "all", "the", "elements", "of", "the", "first", "stream", "followed", "by", "all", "the", "elements", "of", "the", "second", "stream", "." ]
a6cc7c73b2be475ed1bce5128c24b2eb9c27d666
https://github.com/nwillc/almost-functional/blob/a6cc7c73b2be475ed1bce5128c24b2eb9c27d666/src/main/java/almost/functional/Stream.java#L223-L227
153,334
jbundle/jbundle
base/remote/src/main/java/org/jbundle/base/remote/proxy/TaskHolder.java
TaskHolder.init
public void init(ProxyTask proxyTask, RemoteTask remoteTask) { super.init(null, remoteTask); // TaskHolder doesn't have a parent (BaseHolder). m_proxyTask = proxyTask; }
java
public void init(ProxyTask proxyTask, RemoteTask remoteTask) { super.init(null, remoteTask); // TaskHolder doesn't have a parent (BaseHolder). m_proxyTask = proxyTask; }
[ "public", "void", "init", "(", "ProxyTask", "proxyTask", ",", "RemoteTask", "remoteTask", ")", "{", "super", ".", "init", "(", "null", ",", "remoteTask", ")", ";", "// TaskHolder doesn't have a parent (BaseHolder).", "m_proxyTask", "=", "proxyTask", ";", "}" ]
Creates a new instance of TaskHolder
[ "Creates", "a", "new", "instance", "of", "TaskHolder" ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/remote/src/main/java/org/jbundle/base/remote/proxy/TaskHolder.java#L58-L62
153,335
jbundle/jbundle
base/remote/src/main/java/org/jbundle/base/remote/proxy/TaskHolder.java
TaskHolder.getProperty
public String getProperty(String strKey, Map<String, Object> properties) { String strProperty = super.getProperty(strKey, properties); if (strProperty == null) if (!m_proxyTask.isShared()) strProperty = m_proxyTask.getProperty(strKey); return strProperty; }
java
public String getProperty(String strKey, Map<String, Object> properties) { String strProperty = super.getProperty(strKey, properties); if (strProperty == null) if (!m_proxyTask.isShared()) strProperty = m_proxyTask.getProperty(strKey); return strProperty; }
[ "public", "String", "getProperty", "(", "String", "strKey", ",", "Map", "<", "String", ",", "Object", ">", "properties", ")", "{", "String", "strProperty", "=", "super", ".", "getProperty", "(", "strKey", ",", "properties", ")", ";", "if", "(", "strProperty", "==", "null", ")", "if", "(", "!", "m_proxyTask", ".", "isShared", "(", ")", ")", "strProperty", "=", "m_proxyTask", ".", "getProperty", "(", "strKey", ")", ";", "return", "strProperty", ";", "}" ]
Get the servlet's property. For Ajax proxies, the top level proxy is shared among sessions. since it is not unique, don't return property.
[ "Get", "the", "servlet", "s", "property", ".", "For", "Ajax", "proxies", "the", "top", "level", "proxy", "is", "shared", "among", "sessions", ".", "since", "it", "is", "not", "unique", "don", "t", "return", "property", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/remote/src/main/java/org/jbundle/base/remote/proxy/TaskHolder.java#L152-L159
153,336
bremersee/pagebuilder
bremersee-pagebuilder/src/main/java/org/bremersee/pagebuilder/PageBuilderUtils.java
PageBuilderUtils.cast
@SuppressWarnings("unchecked") public static <E> Page<E> cast(final Page<?> page) { return (Page<E>) page; }
java
@SuppressWarnings("unchecked") public static <E> Page<E> cast(final Page<?> page) { return (Page<E>) page; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "E", ">", "Page", "<", "E", ">", "cast", "(", "final", "Page", "<", "?", ">", "page", ")", "{", "return", "(", "Page", "<", "E", ">", ")", "page", ";", "}" ]
Casts a page. @param page the page to cast @param <E> type of the page entries @return the casted page
[ "Casts", "a", "page", "." ]
498614b02f577b08d2d65131ba472a09f080a192
https://github.com/bremersee/pagebuilder/blob/498614b02f577b08d2d65131ba472a09f080a192/bremersee-pagebuilder/src/main/java/org/bremersee/pagebuilder/PageBuilderUtils.java#L77-L80
153,337
bremersee/pagebuilder
bremersee-pagebuilder/src/main/java/org/bremersee/pagebuilder/PageBuilderUtils.java
PageBuilderUtils.createPage
@SuppressWarnings("unchecked") public static <E, T> PageResult<T> createPage(final Iterable<? extends E> entries, final PageRequest pageRequest, final long totalSize, final PageEntryTransformer<T, E> transformer) { final PageResult<T> page = new PageResult<>(); page.setPageRequest(pageRequest == null ? new PageRequestDto() : pageRequest); page.setTotalSize(totalSize); if (entries != null) { for (E entry : entries) { if (transformer == null) { page.getEntries().add((T) entry); } else { T targetEntry = transformer.transform(entry); page.getEntries().add(targetEntry); } } } return page; }
java
@SuppressWarnings("unchecked") public static <E, T> PageResult<T> createPage(final Iterable<? extends E> entries, final PageRequest pageRequest, final long totalSize, final PageEntryTransformer<T, E> transformer) { final PageResult<T> page = new PageResult<>(); page.setPageRequest(pageRequest == null ? new PageRequestDto() : pageRequest); page.setTotalSize(totalSize); if (entries != null) { for (E entry : entries) { if (transformer == null) { page.getEntries().add((T) entry); } else { T targetEntry = transformer.transform(entry); page.getEntries().add(targetEntry); } } } return page; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "E", ",", "T", ">", "PageResult", "<", "T", ">", "createPage", "(", "final", "Iterable", "<", "?", "extends", "E", ">", "entries", ",", "final", "PageRequest", "pageRequest", ",", "final", "long", "totalSize", ",", "final", "PageEntryTransformer", "<", "T", ",", "E", ">", "transformer", ")", "{", "final", "PageResult", "<", "T", ">", "page", "=", "new", "PageResult", "<>", "(", ")", ";", "page", ".", "setPageRequest", "(", "pageRequest", "==", "null", "?", "new", "PageRequestDto", "(", ")", ":", "pageRequest", ")", ";", "page", ".", "setTotalSize", "(", "totalSize", ")", ";", "if", "(", "entries", "!=", "null", ")", "{", "for", "(", "E", "entry", ":", "entries", ")", "{", "if", "(", "transformer", "==", "null", ")", "{", "page", ".", "getEntries", "(", ")", ".", "add", "(", "(", "T", ")", "entry", ")", ";", "}", "else", "{", "T", "targetEntry", "=", "transformer", ".", "transform", "(", "entry", ")", ";", "page", ".", "getEntries", "(", ")", ".", "add", "(", "targetEntry", ")", ";", "}", "}", "}", "return", "page", ";", "}" ]
Creates a page. @param entries the page entries @param pageRequest the page request @param totalSize the total size @param transformer the entry transformer (may be {@code null} - than all entries will be added to the page without transforming) @param <E> type of the entries @param <T> target type of the page entries @return the page
[ "Creates", "a", "page", "." ]
498614b02f577b08d2d65131ba472a09f080a192
https://github.com/bremersee/pagebuilder/blob/498614b02f577b08d2d65131ba472a09f080a192/bremersee-pagebuilder/src/main/java/org/bremersee/pagebuilder/PageBuilderUtils.java#L94-L112
153,338
bremersee/pagebuilder
bremersee-pagebuilder/src/main/java/org/bremersee/pagebuilder/PageBuilderUtils.java
PageBuilderUtils.createPage
public static <E, T> Page<T> createPage(final Page<? extends E> sourcePage, final PageEntryTransformer<T, E> transformer) { if (sourcePage == null) { return null; } if (transformer == null) { return cast(sourcePage); } return createPage(sourcePage.getEntries(), sourcePage.getPageRequest(), sourcePage.getTotalSize(), transformer); }
java
public static <E, T> Page<T> createPage(final Page<? extends E> sourcePage, final PageEntryTransformer<T, E> transformer) { if (sourcePage == null) { return null; } if (transformer == null) { return cast(sourcePage); } return createPage(sourcePage.getEntries(), sourcePage.getPageRequest(), sourcePage.getTotalSize(), transformer); }
[ "public", "static", "<", "E", ",", "T", ">", "Page", "<", "T", ">", "createPage", "(", "final", "Page", "<", "?", "extends", "E", ">", "sourcePage", ",", "final", "PageEntryTransformer", "<", "T", ",", "E", ">", "transformer", ")", "{", "if", "(", "sourcePage", "==", "null", ")", "{", "return", "null", ";", "}", "if", "(", "transformer", "==", "null", ")", "{", "return", "cast", "(", "sourcePage", ")", ";", "}", "return", "createPage", "(", "sourcePage", ".", "getEntries", "(", ")", ",", "sourcePage", ".", "getPageRequest", "(", ")", ",", "sourcePage", ".", "getTotalSize", "(", ")", ",", "transformer", ")", ";", "}" ]
Transforms a page into another page. @param sourcePage the source page @param transformer the entry transformer (may be {@code null} - than all entries of the source page will be added to the target page without transforming) @param <E> source type of the page entries @param <T> target type of the page entries @return the target page
[ "Transforms", "a", "page", "into", "another", "page", "." ]
498614b02f577b08d2d65131ba472a09f080a192
https://github.com/bremersee/pagebuilder/blob/498614b02f577b08d2d65131ba472a09f080a192/bremersee-pagebuilder/src/main/java/org/bremersee/pagebuilder/PageBuilderUtils.java#L125-L134
153,339
bremersee/pagebuilder
bremersee-pagebuilder/src/main/java/org/bremersee/pagebuilder/PageBuilderUtils.java
PageBuilderUtils.createPageDto
public static <E, T> PageDto createPageDto(final Page<? extends E> page, final PageEntryTransformer<T, E> transformer) { if (page == null) { return null; } if (page instanceof PageDto && transformer == null) { return (PageDto) page; } final PageRequestDto pageRequestDto = createPageRequestDto(page.getPageRequest()); if (transformer == null) { return new PageDto(page.getEntries(), pageRequestDto, page.getTotalSize()); } final List<T> entries = new ArrayList<>(); for (E e : page.getEntries()) { entries.add(transformer.transform(e)); } final PageDto pageDto = new PageDto(); pageDto.setEntries(CastUtils.cast(entries)); pageDto.setPageRequest(pageRequestDto); pageDto.setTotalSize(page.getTotalSize()); return pageDto; }
java
public static <E, T> PageDto createPageDto(final Page<? extends E> page, final PageEntryTransformer<T, E> transformer) { if (page == null) { return null; } if (page instanceof PageDto && transformer == null) { return (PageDto) page; } final PageRequestDto pageRequestDto = createPageRequestDto(page.getPageRequest()); if (transformer == null) { return new PageDto(page.getEntries(), pageRequestDto, page.getTotalSize()); } final List<T> entries = new ArrayList<>(); for (E e : page.getEntries()) { entries.add(transformer.transform(e)); } final PageDto pageDto = new PageDto(); pageDto.setEntries(CastUtils.cast(entries)); pageDto.setPageRequest(pageRequestDto); pageDto.setTotalSize(page.getTotalSize()); return pageDto; }
[ "public", "static", "<", "E", ",", "T", ">", "PageDto", "createPageDto", "(", "final", "Page", "<", "?", "extends", "E", ">", "page", ",", "final", "PageEntryTransformer", "<", "T", ",", "E", ">", "transformer", ")", "{", "if", "(", "page", "==", "null", ")", "{", "return", "null", ";", "}", "if", "(", "page", "instanceof", "PageDto", "&&", "transformer", "==", "null", ")", "{", "return", "(", "PageDto", ")", "page", ";", "}", "final", "PageRequestDto", "pageRequestDto", "=", "createPageRequestDto", "(", "page", ".", "getPageRequest", "(", ")", ")", ";", "if", "(", "transformer", "==", "null", ")", "{", "return", "new", "PageDto", "(", "page", ".", "getEntries", "(", ")", ",", "pageRequestDto", ",", "page", ".", "getTotalSize", "(", ")", ")", ";", "}", "final", "List", "<", "T", ">", "entries", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "E", "e", ":", "page", ".", "getEntries", "(", ")", ")", "{", "entries", ".", "add", "(", "transformer", ".", "transform", "(", "e", ")", ")", ";", "}", "final", "PageDto", "pageDto", "=", "new", "PageDto", "(", ")", ";", "pageDto", ".", "setEntries", "(", "CastUtils", ".", "cast", "(", "entries", ")", ")", ";", "pageDto", ".", "setPageRequest", "(", "pageRequestDto", ")", ";", "pageDto", ".", "setTotalSize", "(", "page", ".", "getTotalSize", "(", ")", ")", ";", "return", "pageDto", ";", "}" ]
Transforms a page into a page DTO. @param page the page @param transformer the entry transformer (may be {@code null} - than all entries of the page will be added to the DTO without transforming) @param <E> source type of the page entries @param <T> target type of the page entries @return the page DTO
[ "Transforms", "a", "page", "into", "a", "page", "DTO", "." ]
498614b02f577b08d2d65131ba472a09f080a192
https://github.com/bremersee/pagebuilder/blob/498614b02f577b08d2d65131ba472a09f080a192/bremersee-pagebuilder/src/main/java/org/bremersee/pagebuilder/PageBuilderUtils.java#L146-L167
153,340
bremersee/pagebuilder
bremersee-pagebuilder/src/main/java/org/bremersee/pagebuilder/PageBuilderUtils.java
PageBuilderUtils.createPageRequestDto
public static PageRequestDto createPageRequestDto(final PageRequest pageRequest) { final PageRequestDto pageRequestDto; if (pageRequest == null) { pageRequestDto = null; } else if (pageRequest instanceof PageRequestDto) { pageRequestDto = (PageRequestDto) pageRequest; } else { pageRequestDto = new PageRequestDto(pageRequest); } return pageRequestDto; }
java
public static PageRequestDto createPageRequestDto(final PageRequest pageRequest) { final PageRequestDto pageRequestDto; if (pageRequest == null) { pageRequestDto = null; } else if (pageRequest instanceof PageRequestDto) { pageRequestDto = (PageRequestDto) pageRequest; } else { pageRequestDto = new PageRequestDto(pageRequest); } return pageRequestDto; }
[ "public", "static", "PageRequestDto", "createPageRequestDto", "(", "final", "PageRequest", "pageRequest", ")", "{", "final", "PageRequestDto", "pageRequestDto", ";", "if", "(", "pageRequest", "==", "null", ")", "{", "pageRequestDto", "=", "null", ";", "}", "else", "if", "(", "pageRequest", "instanceof", "PageRequestDto", ")", "{", "pageRequestDto", "=", "(", "PageRequestDto", ")", "pageRequest", ";", "}", "else", "{", "pageRequestDto", "=", "new", "PageRequestDto", "(", "pageRequest", ")", ";", "}", "return", "pageRequestDto", ";", "}" ]
Transforms a page request into a page request DTO. @param pageRequest the page request (can be {@code null}) @return the page request DTO (can be {@code null})
[ "Transforms", "a", "page", "request", "into", "a", "page", "request", "DTO", "." ]
498614b02f577b08d2d65131ba472a09f080a192
https://github.com/bremersee/pagebuilder/blob/498614b02f577b08d2d65131ba472a09f080a192/bremersee-pagebuilder/src/main/java/org/bremersee/pagebuilder/PageBuilderUtils.java#L175-L185
153,341
bremersee/pagebuilder
bremersee-pagebuilder/src/main/java/org/bremersee/pagebuilder/PageBuilderUtils.java
PageBuilderUtils.transform
@SuppressWarnings("unchecked") public static <T, S extends T> T transform(final Object xmlNodeOrJsonMap, final Class<T> valueType, final S defaultObject, final JAXBContext jaxbContext, final ObjectMapper objectMapper) throws Exception { // NOSONAR if (xmlNodeOrJsonMap == null) { return defaultObject; } Validate.notNull(valueType, "valueType must not be null"); // NOSONAR if (valueType.isAssignableFrom(xmlNodeOrJsonMap.getClass())) { return valueType.cast(xmlNodeOrJsonMap); } if (xmlNodeOrJsonMap instanceof Node) { return xmlNodeToObject((Node) xmlNodeOrJsonMap, valueType, jaxbContext); } if (xmlNodeOrJsonMap instanceof Map) { return jsonMapToObject((Map<String, Object>) xmlNodeOrJsonMap, valueType, objectMapper); } throw new IllegalArgumentException("xmlNodeOrJsonMap must be of type " + valueType + ", " + Node.class.getName() + " or of type " + Map.class.getName()); }
java
@SuppressWarnings("unchecked") public static <T, S extends T> T transform(final Object xmlNodeOrJsonMap, final Class<T> valueType, final S defaultObject, final JAXBContext jaxbContext, final ObjectMapper objectMapper) throws Exception { // NOSONAR if (xmlNodeOrJsonMap == null) { return defaultObject; } Validate.notNull(valueType, "valueType must not be null"); // NOSONAR if (valueType.isAssignableFrom(xmlNodeOrJsonMap.getClass())) { return valueType.cast(xmlNodeOrJsonMap); } if (xmlNodeOrJsonMap instanceof Node) { return xmlNodeToObject((Node) xmlNodeOrJsonMap, valueType, jaxbContext); } if (xmlNodeOrJsonMap instanceof Map) { return jsonMapToObject((Map<String, Object>) xmlNodeOrJsonMap, valueType, objectMapper); } throw new IllegalArgumentException("xmlNodeOrJsonMap must be of type " + valueType + ", " + Node.class.getName() + " or of type " + Map.class.getName()); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "T", ",", "S", "extends", "T", ">", "T", "transform", "(", "final", "Object", "xmlNodeOrJsonMap", ",", "final", "Class", "<", "T", ">", "valueType", ",", "final", "S", "defaultObject", ",", "final", "JAXBContext", "jaxbContext", ",", "final", "ObjectMapper", "objectMapper", ")", "throws", "Exception", "{", "// NOSONAR", "if", "(", "xmlNodeOrJsonMap", "==", "null", ")", "{", "return", "defaultObject", ";", "}", "Validate", ".", "notNull", "(", "valueType", ",", "\"valueType must not be null\"", ")", ";", "// NOSONAR", "if", "(", "valueType", ".", "isAssignableFrom", "(", "xmlNodeOrJsonMap", ".", "getClass", "(", ")", ")", ")", "{", "return", "valueType", ".", "cast", "(", "xmlNodeOrJsonMap", ")", ";", "}", "if", "(", "xmlNodeOrJsonMap", "instanceof", "Node", ")", "{", "return", "xmlNodeToObject", "(", "(", "Node", ")", "xmlNodeOrJsonMap", ",", "valueType", ",", "jaxbContext", ")", ";", "}", "if", "(", "xmlNodeOrJsonMap", "instanceof", "Map", ")", "{", "return", "jsonMapToObject", "(", "(", "Map", "<", "String", ",", "Object", ">", ")", "xmlNodeOrJsonMap", ",", "valueType", ",", "objectMapper", ")", ";", "}", "throw", "new", "IllegalArgumentException", "(", "\"xmlNodeOrJsonMap must be of type \"", "+", "valueType", "+", "\", \"", "+", "Node", ".", "class", ".", "getName", "(", ")", "+", "\" or of type \"", "+", "Map", ".", "class", ".", "getName", "(", ")", ")", ";", "}" ]
Transforms a XML node or a JSON map into an object. @param xmlNodeOrJsonMap the XML node or JSON map @param valueType the class of the target object @param defaultObject a default object (optional) @param jaxbContext the {@link JAXBContext} (can be null) @param objectMapper the JSON object mapper (optional) @param <T> value type @param <S> type of the default value @return the target object @throws Exception if transformation fails
[ "Transforms", "a", "XML", "node", "or", "a", "JSON", "map", "into", "an", "object", "." ]
498614b02f577b08d2d65131ba472a09f080a192
https://github.com/bremersee/pagebuilder/blob/498614b02f577b08d2d65131ba472a09f080a192/bremersee-pagebuilder/src/main/java/org/bremersee/pagebuilder/PageBuilderUtils.java#L200-L220
153,342
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/db/TableLink.java
TableLink.getLeftField
public BaseField getLeftField(int iFieldSeq) { if (m_rgiFldLeft.length <= iFieldSeq) return null; if ((m_rgiFldLeft[iFieldSeq] instanceof String)) if (!Utility.isNumeric((String)m_rgiFldLeft[iFieldSeq])) return this.getLeftRecord().getTable().getCurrentTable().getRecord().getField((String)m_rgiFldLeft[iFieldSeq]); if (!(m_rgiFldLeft[iFieldSeq] instanceof Integer)) return null; int fs = ((Integer)m_rgiFldLeft[iFieldSeq]).intValue(); return this.getLeftRecord().getTable().getCurrentTable().getRecord().getField(fs); }
java
public BaseField getLeftField(int iFieldSeq) { if (m_rgiFldLeft.length <= iFieldSeq) return null; if ((m_rgiFldLeft[iFieldSeq] instanceof String)) if (!Utility.isNumeric((String)m_rgiFldLeft[iFieldSeq])) return this.getLeftRecord().getTable().getCurrentTable().getRecord().getField((String)m_rgiFldLeft[iFieldSeq]); if (!(m_rgiFldLeft[iFieldSeq] instanceof Integer)) return null; int fs = ((Integer)m_rgiFldLeft[iFieldSeq]).intValue(); return this.getLeftRecord().getTable().getCurrentTable().getRecord().getField(fs); }
[ "public", "BaseField", "getLeftField", "(", "int", "iFieldSeq", ")", "{", "if", "(", "m_rgiFldLeft", ".", "length", "<=", "iFieldSeq", ")", "return", "null", ";", "if", "(", "(", "m_rgiFldLeft", "[", "iFieldSeq", "]", "instanceof", "String", ")", ")", "if", "(", "!", "Utility", ".", "isNumeric", "(", "(", "String", ")", "m_rgiFldLeft", "[", "iFieldSeq", "]", ")", ")", "return", "this", ".", "getLeftRecord", "(", ")", ".", "getTable", "(", ")", ".", "getCurrentTable", "(", ")", ".", "getRecord", "(", ")", ".", "getField", "(", "(", "String", ")", "m_rgiFldLeft", "[", "iFieldSeq", "]", ")", ";", "if", "(", "!", "(", "m_rgiFldLeft", "[", "iFieldSeq", "]", "instanceof", "Integer", ")", ")", "return", "null", ";", "int", "fs", "=", "(", "(", "Integer", ")", "m_rgiFldLeft", "[", "iFieldSeq", "]", ")", ".", "intValue", "(", ")", ";", "return", "this", ".", "getLeftRecord", "(", ")", ".", "getTable", "(", ")", ".", "getCurrentTable", "(", ")", ".", "getRecord", "(", ")", ".", "getField", "(", "fs", ")", ";", "}" ]
Get the equal field from the left table for this link. @param iFieldSeq The sequence of this field. @return The field.
[ "Get", "the", "equal", "field", "from", "the", "left", "table", "for", "this", "link", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/TableLink.java#L161-L172
153,343
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/db/TableLink.java
TableLink.getRightField
public BaseField getRightField(int iFieldSeq) { if (m_rgiFldRight.length <= iFieldSeq) return null; if (m_rgiFldRight[iFieldSeq] == null) return null; // Note that the right record does NOT get the current record (because you will need the BASE record to do a seek). return this.getRightRecord().getField(m_rgiFldRight[iFieldSeq]); }
java
public BaseField getRightField(int iFieldSeq) { if (m_rgiFldRight.length <= iFieldSeq) return null; if (m_rgiFldRight[iFieldSeq] == null) return null; // Note that the right record does NOT get the current record (because you will need the BASE record to do a seek). return this.getRightRecord().getField(m_rgiFldRight[iFieldSeq]); }
[ "public", "BaseField", "getRightField", "(", "int", "iFieldSeq", ")", "{", "if", "(", "m_rgiFldRight", ".", "length", "<=", "iFieldSeq", ")", "return", "null", ";", "if", "(", "m_rgiFldRight", "[", "iFieldSeq", "]", "==", "null", ")", "return", "null", ";", "// Note that the right record does NOT get the current record (because you will need the BASE record to do a seek).", "return", "this", ".", "getRightRecord", "(", ")", ".", "getField", "(", "m_rgiFldRight", "[", "iFieldSeq", "]", ")", ";", "}" ]
Get the equal field from the right table for this link. @param iFieldSeq The sequence of this field. @return The field.
[ "Get", "the", "equal", "field", "from", "the", "right", "table", "for", "this", "link", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/TableLink.java#L178-L186
153,344
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/db/TableLink.java
TableLink.getTableNames
public String getTableNames(boolean bAddQuotes, Map<String, Object> properties) { String strString = ""; strString += this.getLeftRecord().getTableNames(bAddQuotes); String strOn = "ON"; switch (m_JoinType) { case DBConstants.LEFT_INNER: if (properties.get("INNER_JOIN") != null) strString += ' ' + (String)properties.get("INNER_JOIN") + ' '; else strString += ' ' + "INNER_JOIN "; if (properties.get("INNER_JOIN_ON") != null) strOn = (String)properties.get("INNER_JOIN_ON"); break; case DBConstants.LEFT_OUTER: strString += " LEFT JOIN "; break; } strString += this.getRightRecord().getTableNames(bAddQuotes); strString += ' ' + strOn + ' '; for (int i = 1; i < m_rgiFldLeft.length; i++) { if (this.getLeftField(i) == null) break; if (i > 1) strString += " AND "; strString += this.getLeftFieldNameOrValue(i, bAddQuotes, true); // Include file name strString += " = "; strString += this.getRightField(i).getFieldName(bAddQuotes, true); // Include file name } return strString; }
java
public String getTableNames(boolean bAddQuotes, Map<String, Object> properties) { String strString = ""; strString += this.getLeftRecord().getTableNames(bAddQuotes); String strOn = "ON"; switch (m_JoinType) { case DBConstants.LEFT_INNER: if (properties.get("INNER_JOIN") != null) strString += ' ' + (String)properties.get("INNER_JOIN") + ' '; else strString += ' ' + "INNER_JOIN "; if (properties.get("INNER_JOIN_ON") != null) strOn = (String)properties.get("INNER_JOIN_ON"); break; case DBConstants.LEFT_OUTER: strString += " LEFT JOIN "; break; } strString += this.getRightRecord().getTableNames(bAddQuotes); strString += ' ' + strOn + ' '; for (int i = 1; i < m_rgiFldLeft.length; i++) { if (this.getLeftField(i) == null) break; if (i > 1) strString += " AND "; strString += this.getLeftFieldNameOrValue(i, bAddQuotes, true); // Include file name strString += " = "; strString += this.getRightField(i).getFieldName(bAddQuotes, true); // Include file name } return strString; }
[ "public", "String", "getTableNames", "(", "boolean", "bAddQuotes", ",", "Map", "<", "String", ",", "Object", ">", "properties", ")", "{", "String", "strString", "=", "\"\"", ";", "strString", "+=", "this", ".", "getLeftRecord", "(", ")", ".", "getTableNames", "(", "bAddQuotes", ")", ";", "String", "strOn", "=", "\"ON\"", ";", "switch", "(", "m_JoinType", ")", "{", "case", "DBConstants", ".", "LEFT_INNER", ":", "if", "(", "properties", ".", "get", "(", "\"INNER_JOIN\"", ")", "!=", "null", ")", "strString", "+=", "'", "'", "+", "(", "String", ")", "properties", ".", "get", "(", "\"INNER_JOIN\"", ")", "+", "'", "'", ";", "else", "strString", "+=", "'", "'", "+", "\"INNER_JOIN \"", ";", "if", "(", "properties", ".", "get", "(", "\"INNER_JOIN_ON\"", ")", "!=", "null", ")", "strOn", "=", "(", "String", ")", "properties", ".", "get", "(", "\"INNER_JOIN_ON\"", ")", ";", "break", ";", "case", "DBConstants", ".", "LEFT_OUTER", ":", "strString", "+=", "\" LEFT JOIN \"", ";", "break", ";", "}", "strString", "+=", "this", ".", "getRightRecord", "(", ")", ".", "getTableNames", "(", "bAddQuotes", ")", ";", "strString", "+=", "'", "'", "+", "strOn", "+", "'", "'", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<", "m_rgiFldLeft", ".", "length", ";", "i", "++", ")", "{", "if", "(", "this", ".", "getLeftField", "(", "i", ")", "==", "null", ")", "break", ";", "if", "(", "i", ">", "1", ")", "strString", "+=", "\" AND \"", ";", "strString", "+=", "this", ".", "getLeftFieldNameOrValue", "(", "i", ",", "bAddQuotes", ",", "true", ")", ";", "// Include file name", "strString", "+=", "\" = \"", ";", "strString", "+=", "this", ".", "getRightField", "(", "i", ")", ".", "getFieldName", "(", "bAddQuotes", ",", "true", ")", ";", "// Include file name", "}", "return", "strString", ";", "}" ]
Get the SQL table names for this link. @param bAddQuotes Add quotes to fields with spaces? @param properties The database properties. @return The SQL table string.
[ "Get", "the", "SQL", "table", "names", "for", "this", "link", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/TableLink.java#L205-L237
153,345
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/db/TableLink.java
TableLink.moveDataRight
public void moveDataRight() { for (int i = 1; i < m_rgiFldLeft.length; i++) { if (this.getRightField(i) == null) break; if (this.getLeftField(i) == null) this.getRightField(i).setString(this.getLeftFieldNameOrValue(i, true, true), DBConstants.DONT_DISPLAY, DBConstants.SCREEN_MOVE); else this.getRightField(i).moveFieldToThis(this.getLeftField(i), DBConstants.DONT_DISPLAY, DBConstants.SCREEN_MOVE); } }
java
public void moveDataRight() { for (int i = 1; i < m_rgiFldLeft.length; i++) { if (this.getRightField(i) == null) break; if (this.getLeftField(i) == null) this.getRightField(i).setString(this.getLeftFieldNameOrValue(i, true, true), DBConstants.DONT_DISPLAY, DBConstants.SCREEN_MOVE); else this.getRightField(i).moveFieldToThis(this.getLeftField(i), DBConstants.DONT_DISPLAY, DBConstants.SCREEN_MOVE); } }
[ "public", "void", "moveDataRight", "(", ")", "{", "for", "(", "int", "i", "=", "1", ";", "i", "<", "m_rgiFldLeft", ".", "length", ";", "i", "++", ")", "{", "if", "(", "this", ".", "getRightField", "(", "i", ")", "==", "null", ")", "break", ";", "if", "(", "this", ".", "getLeftField", "(", "i", ")", "==", "null", ")", "this", ".", "getRightField", "(", "i", ")", ".", "setString", "(", "this", ".", "getLeftFieldNameOrValue", "(", "i", ",", "true", ",", "true", ")", ",", "DBConstants", ".", "DONT_DISPLAY", ",", "DBConstants", ".", "SCREEN_MOVE", ")", ";", "else", "this", ".", "getRightField", "(", "i", ")", ".", "moveFieldToThis", "(", "this", ".", "getLeftField", "(", "i", ")", ",", "DBConstants", ".", "DONT_DISPLAY", ",", "DBConstants", ".", "SCREEN_MOVE", ")", ";", "}", "}" ]
Fill the right fields with the values from the left fields.
[ "Fill", "the", "right", "fields", "with", "the", "values", "from", "the", "left", "fields", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/TableLink.java#L241-L252
153,346
jbundle/jbundle
thin/base/db/misc/src/main/java/org/jbundle/thin/base/db/client/RemoteFieldTable.java
RemoteFieldTable.open
public void open() throws DBException { m_objLastModBookmark = null; try { // FROM is automatic, since the remote BaseRecord is exactly the same as this one // ORDER BY String strKeyArea = this.getRecord().getKeyName(); // ASC / DESCending KeyAreaInfo keyArea = this.getRecord().getKeyArea(-1); boolean bKeyOrder = Constants.ASCENDING; if (keyArea != null) bKeyOrder = keyArea.getKeyOrder(); // Open mode int iOpenMode = this.getRecord().getOpenMode(); // SELECT (fields to select - all) String strFields = null; // WHERE aaa >= Object objInitialKey = null; // WHERE aaa <= Object objEndKey = null; // WHERE XYZ byte[] byFilter = null; m_tableRemote.open(strKeyArea, iOpenMode, bKeyOrder, strFields, objInitialKey, objEndKey, byFilter); m_iCurrentRecord = -1; m_iRecordsAccessed = 0; super.open(); } catch (RemoteException ex) { throw new DBException(ex.getMessage()); } }
java
public void open() throws DBException { m_objLastModBookmark = null; try { // FROM is automatic, since the remote BaseRecord is exactly the same as this one // ORDER BY String strKeyArea = this.getRecord().getKeyName(); // ASC / DESCending KeyAreaInfo keyArea = this.getRecord().getKeyArea(-1); boolean bKeyOrder = Constants.ASCENDING; if (keyArea != null) bKeyOrder = keyArea.getKeyOrder(); // Open mode int iOpenMode = this.getRecord().getOpenMode(); // SELECT (fields to select - all) String strFields = null; // WHERE aaa >= Object objInitialKey = null; // WHERE aaa <= Object objEndKey = null; // WHERE XYZ byte[] byFilter = null; m_tableRemote.open(strKeyArea, iOpenMode, bKeyOrder, strFields, objInitialKey, objEndKey, byFilter); m_iCurrentRecord = -1; m_iRecordsAccessed = 0; super.open(); } catch (RemoteException ex) { throw new DBException(ex.getMessage()); } }
[ "public", "void", "open", "(", ")", "throws", "DBException", "{", "m_objLastModBookmark", "=", "null", ";", "try", "{", "// FROM is automatic, since the remote BaseRecord is exactly the same as this one", "// ORDER BY", "String", "strKeyArea", "=", "this", ".", "getRecord", "(", ")", ".", "getKeyName", "(", ")", ";", "// ASC / DESCending", "KeyAreaInfo", "keyArea", "=", "this", ".", "getRecord", "(", ")", ".", "getKeyArea", "(", "-", "1", ")", ";", "boolean", "bKeyOrder", "=", "Constants", ".", "ASCENDING", ";", "if", "(", "keyArea", "!=", "null", ")", "bKeyOrder", "=", "keyArea", ".", "getKeyOrder", "(", ")", ";", "// Open mode", "int", "iOpenMode", "=", "this", ".", "getRecord", "(", ")", ".", "getOpenMode", "(", ")", ";", "// SELECT (fields to select - all)", "String", "strFields", "=", "null", ";", "// WHERE aaa >=", "Object", "objInitialKey", "=", "null", ";", "// WHERE aaa <=", "Object", "objEndKey", "=", "null", ";", "// WHERE XYZ", "byte", "[", "]", "byFilter", "=", "null", ";", "m_tableRemote", ".", "open", "(", "strKeyArea", ",", "iOpenMode", ",", "bKeyOrder", ",", "strFields", ",", "objInitialKey", ",", "objEndKey", ",", "byFilter", ")", ";", "m_iCurrentRecord", "=", "-", "1", ";", "m_iRecordsAccessed", "=", "0", ";", "super", ".", "open", "(", ")", ";", "}", "catch", "(", "RemoteException", "ex", ")", "{", "throw", "new", "DBException", "(", "ex", ".", "getMessage", "(", ")", ")", ";", "}", "}" ]
Reset the current position and open the file.
[ "Reset", "the", "current", "position", "and", "open", "the", "file", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/misc/src/main/java/org/jbundle/thin/base/db/client/RemoteFieldTable.java#L99-L129
153,347
jbundle/jbundle
thin/base/db/misc/src/main/java/org/jbundle/thin/base/db/client/RemoteFieldTable.java
RemoteFieldTable.hasPrevious
public boolean hasPrevious() throws DBException { if (m_iCurrentRecord >= m_iRecordsAccessed) return true; Object record = this.previous(); if (record == null) return false; else { m_iRecordsAccessed--; // Offically this record has not been accessed return true; } }
java
public boolean hasPrevious() throws DBException { if (m_iCurrentRecord >= m_iRecordsAccessed) return true; Object record = this.previous(); if (record == null) return false; else { m_iRecordsAccessed--; // Offically this record has not been accessed return true; } }
[ "public", "boolean", "hasPrevious", "(", ")", "throws", "DBException", "{", "if", "(", "m_iCurrentRecord", ">=", "m_iRecordsAccessed", ")", "return", "true", ";", "Object", "record", "=", "this", ".", "previous", "(", ")", ";", "if", "(", "record", "==", "null", ")", "return", "false", ";", "else", "{", "m_iRecordsAccessed", "--", ";", "// Offically this record has not been accessed", "return", "true", ";", "}", "}" ]
Does this list have a previous record?
[ "Does", "this", "list", "have", "a", "previous", "record?" ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/misc/src/main/java/org/jbundle/thin/base/db/client/RemoteFieldTable.java#L257-L269
153,348
jbundle/jbundle
thin/base/db/misc/src/main/java/org/jbundle/thin/base/db/client/RemoteFieldTable.java
RemoteFieldTable.doGet
public Object doGet(int iRowIndex) throws DBException { try { m_objLastModBookmark = null; return m_tableRemote.get(iRowIndex, 1); } catch (RemoteException ex) { ex.printStackTrace(); throw new DBException(ex.getMessage()); } }
java
public Object doGet(int iRowIndex) throws DBException { try { m_objLastModBookmark = null; return m_tableRemote.get(iRowIndex, 1); } catch (RemoteException ex) { ex.printStackTrace(); throw new DBException(ex.getMessage()); } }
[ "public", "Object", "doGet", "(", "int", "iRowIndex", ")", "throws", "DBException", "{", "try", "{", "m_objLastModBookmark", "=", "null", ";", "return", "m_tableRemote", ".", "get", "(", "iRowIndex", ",", "1", ")", ";", "}", "catch", "(", "RemoteException", "ex", ")", "{", "ex", ".", "printStackTrace", "(", ")", ";", "throw", "new", "DBException", "(", "ex", ".", "getMessage", "(", ")", ")", ";", "}", "}" ]
Returns an attribute value for the cell at columnIndex and rowIndex.
[ "Returns", "an", "attribute", "value", "for", "the", "cell", "at", "columnIndex", "and", "rowIndex", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/misc/src/main/java/org/jbundle/thin/base/db/client/RemoteFieldTable.java#L320-L329
153,349
jbundle/jbundle
thin/base/db/misc/src/main/java/org/jbundle/thin/base/db/client/RemoteFieldTable.java
RemoteFieldTable.setRemoteTable
public void setRemoteTable(RemoteTable tableRemote, Object syncObject) { if (syncObject != null) tableRemote = new SyncRemoteTable(tableRemote, syncObject); // Synchronize all calls m_tableRemote = tableRemote; m_syncObject = syncObject; }
java
public void setRemoteTable(RemoteTable tableRemote, Object syncObject) { if (syncObject != null) tableRemote = new SyncRemoteTable(tableRemote, syncObject); // Synchronize all calls m_tableRemote = tableRemote; m_syncObject = syncObject; }
[ "public", "void", "setRemoteTable", "(", "RemoteTable", "tableRemote", ",", "Object", "syncObject", ")", "{", "if", "(", "syncObject", "!=", "null", ")", "tableRemote", "=", "new", "SyncRemoteTable", "(", "tableRemote", ",", "syncObject", ")", ";", "// Synchronize all calls", "m_tableRemote", "=", "tableRemote", ";", "m_syncObject", "=", "syncObject", ";", "}" ]
Set the remote table reference.
[ "Set", "the", "remote", "table", "reference", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/misc/src/main/java/org/jbundle/thin/base/db/client/RemoteFieldTable.java#L356-L362
153,350
jbundle/jbundle
thin/base/db/base/src/main/java/org/jbundle/thin/base/db/FieldList.java
FieldList.getRemoteClassName
public String getRemoteClassName() { String strClassName = this.getClass().getName().toString(); int iThinPos = strClassName.indexOf(Constants.THIN_SUBPACKAGE); return strClassName.substring(0, iThinPos) + strClassName.substring(iThinPos + Constants.THIN_SUBPACKAGE.length()); }
java
public String getRemoteClassName() { String strClassName = this.getClass().getName().toString(); int iThinPos = strClassName.indexOf(Constants.THIN_SUBPACKAGE); return strClassName.substring(0, iThinPos) + strClassName.substring(iThinPos + Constants.THIN_SUBPACKAGE.length()); }
[ "public", "String", "getRemoteClassName", "(", ")", "{", "String", "strClassName", "=", "this", ".", "getClass", "(", ")", ".", "getName", "(", ")", ".", "toString", "(", ")", ";", "int", "iThinPos", "=", "strClassName", ".", "indexOf", "(", "Constants", ".", "THIN_SUBPACKAGE", ")", ";", "return", "strClassName", ".", "substring", "(", "0", ",", "iThinPos", ")", "+", "strClassName", ".", "substring", "(", "iThinPos", "+", "Constants", ".", "THIN_SUBPACKAGE", ".", "length", "(", ")", ")", ";", "}" ]
Get the remote class name. Just remove thin from this class name!. @return The full remote class name.
[ "Get", "the", "remote", "class", "name", ".", "Just", "remove", "thin", "from", "this", "class", "name!", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/base/src/main/java/org/jbundle/thin/base/db/FieldList.java#L212-L217
153,351
jbundle/jbundle
thin/base/db/base/src/main/java/org/jbundle/thin/base/db/FieldList.java
FieldList.setupKeys
public void setupKeys() { // Override this to set up the actual keys KeyAreaInfo keyArea = null; keyArea = new KeyAreaInfo(this, Constants.UNIQUE, ID_KEY); keyArea.addKeyField(ID, Constants.ASCENDING); }
java
public void setupKeys() { // Override this to set up the actual keys KeyAreaInfo keyArea = null; keyArea = new KeyAreaInfo(this, Constants.UNIQUE, ID_KEY); keyArea.addKeyField(ID, Constants.ASCENDING); }
[ "public", "void", "setupKeys", "(", ")", "{", "// Override this to set up the actual keys", "KeyAreaInfo", "keyArea", "=", "null", ";", "keyArea", "=", "new", "KeyAreaInfo", "(", "this", ",", "Constants", ".", "UNIQUE", ",", "ID_KEY", ")", ";", "keyArea", ".", "addKeyField", "(", "ID", ",", "Constants", ".", "ASCENDING", ")", ";", "}" ]
Set up all the key areas for this record. Override this to add the key areas.
[ "Set", "up", "all", "the", "key", "areas", "for", "this", "record", ".", "Override", "this", "to", "add", "the", "key", "areas", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/base/src/main/java/org/jbundle/thin/base/db/FieldList.java#L267-L272
153,352
jbundle/jbundle
thin/base/db/base/src/main/java/org/jbundle/thin/base/db/FieldList.java
FieldList.addPropertyChangeListener
public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener listener) { if (propertyChange == null) propertyChange = new java.beans.PropertyChangeSupport(this); propertyChange.addPropertyChangeListener(listener); }
java
public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener listener) { if (propertyChange == null) propertyChange = new java.beans.PropertyChangeSupport(this); propertyChange.addPropertyChangeListener(listener); }
[ "public", "synchronized", "void", "addPropertyChangeListener", "(", "java", ".", "beans", ".", "PropertyChangeListener", "listener", ")", "{", "if", "(", "propertyChange", "==", "null", ")", "propertyChange", "=", "new", "java", ".", "beans", ".", "PropertyChangeSupport", "(", "this", ")", ";", "propertyChange", ".", "addPropertyChangeListener", "(", "listener", ")", ";", "}" ]
The addPropertyChangeListener method was generated to support the propertyChange field. @param listener The propery change listener to add to my listeners.
[ "The", "addPropertyChangeListener", "method", "was", "generated", "to", "support", "the", "propertyChange", "field", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/base/src/main/java/org/jbundle/thin/base/db/FieldList.java#L393-L398
153,353
jbundle/jbundle
thin/base/db/base/src/main/java/org/jbundle/thin/base/db/FieldList.java
FieldList.removePropertyChangeListener
public synchronized void removePropertyChangeListener(java.beans.PropertyChangeListener listener) { if (propertyChange != null) propertyChange.removePropertyChangeListener(listener); }
java
public synchronized void removePropertyChangeListener(java.beans.PropertyChangeListener listener) { if (propertyChange != null) propertyChange.removePropertyChangeListener(listener); }
[ "public", "synchronized", "void", "removePropertyChangeListener", "(", "java", ".", "beans", ".", "PropertyChangeListener", "listener", ")", "{", "if", "(", "propertyChange", "!=", "null", ")", "propertyChange", ".", "removePropertyChangeListener", "(", "listener", ")", ";", "}" ]
The removePropertyChangeListener method was generated to support the propertyChange field. @param listener The propery change listener to remove from my listeners.
[ "The", "removePropertyChangeListener", "method", "was", "generated", "to", "support", "the", "propertyChange", "field", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/base/src/main/java/org/jbundle/thin/base/db/FieldList.java#L414-L418
153,354
jbundle/jbundle
thin/base/db/base/src/main/java/org/jbundle/thin/base/db/FieldList.java
FieldList.getString
public String getString(String strResource) { String strResult = null; if (m_menuResourceBundle == null) { m_menuResourceBundle = new ResourceBundle[10]; Class<?> classResource = this.getClass(); Locale locale = Locale.getDefault(); for (int i = 0; i < 10; i++) { m_menuResourceBundle[i] = null; if (classResource != null) { // First time only m_menuResourceBundle[i] = this.getRecordResource(classResource, locale); classResource = classResource.getSuperclass(); if (classResource != null) if ((classResource.getName().equals(Constants.ROOT_PACKAGE + "base.db.Record")) || (classResource.getName().equals(FieldList.class.getName()))) classResource = null; // Stop at record class } } } for (int i = 0; i < 10; i++) { if (m_menuResourceBundle[i] != null) { strResult = null; try { strResult = m_menuResourceBundle[i].getString(strResource); } catch (MissingResourceException ex) { strResult = null; } if ((strResult != null) && (strResult.length() > 0)) return strResult; // Found, return value } } return strResource; // Not found, return original key. }
java
public String getString(String strResource) { String strResult = null; if (m_menuResourceBundle == null) { m_menuResourceBundle = new ResourceBundle[10]; Class<?> classResource = this.getClass(); Locale locale = Locale.getDefault(); for (int i = 0; i < 10; i++) { m_menuResourceBundle[i] = null; if (classResource != null) { // First time only m_menuResourceBundle[i] = this.getRecordResource(classResource, locale); classResource = classResource.getSuperclass(); if (classResource != null) if ((classResource.getName().equals(Constants.ROOT_PACKAGE + "base.db.Record")) || (classResource.getName().equals(FieldList.class.getName()))) classResource = null; // Stop at record class } } } for (int i = 0; i < 10; i++) { if (m_menuResourceBundle[i] != null) { strResult = null; try { strResult = m_menuResourceBundle[i].getString(strResource); } catch (MissingResourceException ex) { strResult = null; } if ((strResult != null) && (strResult.length() > 0)) return strResult; // Found, return value } } return strResource; // Not found, return original key. }
[ "public", "String", "getString", "(", "String", "strResource", ")", "{", "String", "strResult", "=", "null", ";", "if", "(", "m_menuResourceBundle", "==", "null", ")", "{", "m_menuResourceBundle", "=", "new", "ResourceBundle", "[", "10", "]", ";", "Class", "<", "?", ">", "classResource", "=", "this", ".", "getClass", "(", ")", ";", "Locale", "locale", "=", "Locale", ".", "getDefault", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "10", ";", "i", "++", ")", "{", "m_menuResourceBundle", "[", "i", "]", "=", "null", ";", "if", "(", "classResource", "!=", "null", ")", "{", "// First time only", "m_menuResourceBundle", "[", "i", "]", "=", "this", ".", "getRecordResource", "(", "classResource", ",", "locale", ")", ";", "classResource", "=", "classResource", ".", "getSuperclass", "(", ")", ";", "if", "(", "classResource", "!=", "null", ")", "if", "(", "(", "classResource", ".", "getName", "(", ")", ".", "equals", "(", "Constants", ".", "ROOT_PACKAGE", "+", "\"base.db.Record\"", ")", ")", "||", "(", "classResource", ".", "getName", "(", ")", ".", "equals", "(", "FieldList", ".", "class", ".", "getName", "(", ")", ")", ")", ")", "classResource", "=", "null", ";", "// Stop at record class", "}", "}", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "10", ";", "i", "++", ")", "{", "if", "(", "m_menuResourceBundle", "[", "i", "]", "!=", "null", ")", "{", "strResult", "=", "null", ";", "try", "{", "strResult", "=", "m_menuResourceBundle", "[", "i", "]", ".", "getString", "(", "strResource", ")", ";", "}", "catch", "(", "MissingResourceException", "ex", ")", "{", "strResult", "=", "null", ";", "}", "if", "(", "(", "strResult", "!=", "null", ")", "&&", "(", "strResult", ".", "length", "(", ")", ">", "0", ")", ")", "return", "strResult", ";", "// Found, return value", "}", "}", "return", "strResource", ";", "// Not found, return original key.", "}" ]
Get the string that matches this key. This method traverses the class hierarchy for a matching string that matches this key value. If the resource bundle hasn't been read yet, reads the bundle from the .res package. @param strResource The key. @return The value (returns the key if no value is found).
[ "Get", "the", "string", "that", "matches", "this", "key", ".", "This", "method", "traverses", "the", "class", "hierarchy", "for", "a", "matching", "string", "that", "matches", "this", "key", "value", ".", "If", "the", "resource", "bundle", "hasn", "t", "been", "read", "yet", "reads", "the", "bundle", "from", "the", ".", "res", "package", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/base/src/main/java/org/jbundle/thin/base/db/FieldList.java#L501-L539
153,355
jbundle/jbundle
thin/base/db/base/src/main/java/org/jbundle/thin/base/db/FieldList.java
FieldList.getRecordResource
public ResourceBundle getRecordResource(Class<?> classResource, Locale locale) { ClassLoader classLoader = this.getClass().getClassLoader(); ResourceBundle resourceBundle = null; String typicalResourceClassName = null; try { typicalResourceClassName = Util.convertClassName(classResource.getName(), Constants.RES_SUBPACKAGE, 2) + "Resources"; resourceBundle = ClassServiceUtility.getClassService().getResourceBundle(typicalResourceClassName, locale, null, classLoader); } catch (MissingResourceException ex) { resourceBundle = null; } int i = -1; while (resourceBundle == null) { String resourceClassName = Util.convertClassName(classResource.getName(), Constants.RES_SUBPACKAGE, i); if (resourceClassName == null) return null; if (resourceClassName.equals(typicalResourceClassName)) return null; // Looked through them all resourceClassName = resourceClassName + "Resources"; try { resourceBundle = ClassServiceUtility.getClassService().getResourceBundle(resourceClassName, locale, null, classLoader); } catch (MissingResourceException ex) { resourceBundle = null; } i--; } return resourceBundle; }
java
public ResourceBundle getRecordResource(Class<?> classResource, Locale locale) { ClassLoader classLoader = this.getClass().getClassLoader(); ResourceBundle resourceBundle = null; String typicalResourceClassName = null; try { typicalResourceClassName = Util.convertClassName(classResource.getName(), Constants.RES_SUBPACKAGE, 2) + "Resources"; resourceBundle = ClassServiceUtility.getClassService().getResourceBundle(typicalResourceClassName, locale, null, classLoader); } catch (MissingResourceException ex) { resourceBundle = null; } int i = -1; while (resourceBundle == null) { String resourceClassName = Util.convertClassName(classResource.getName(), Constants.RES_SUBPACKAGE, i); if (resourceClassName == null) return null; if (resourceClassName.equals(typicalResourceClassName)) return null; // Looked through them all resourceClassName = resourceClassName + "Resources"; try { resourceBundle = ClassServiceUtility.getClassService().getResourceBundle(resourceClassName, locale, null, classLoader); } catch (MissingResourceException ex) { resourceBundle = null; } i--; } return resourceBundle; }
[ "public", "ResourceBundle", "getRecordResource", "(", "Class", "<", "?", ">", "classResource", ",", "Locale", "locale", ")", "{", "ClassLoader", "classLoader", "=", "this", ".", "getClass", "(", ")", ".", "getClassLoader", "(", ")", ";", "ResourceBundle", "resourceBundle", "=", "null", ";", "String", "typicalResourceClassName", "=", "null", ";", "try", "{", "typicalResourceClassName", "=", "Util", ".", "convertClassName", "(", "classResource", ".", "getName", "(", ")", ",", "Constants", ".", "RES_SUBPACKAGE", ",", "2", ")", "+", "\"Resources\"", ";", "resourceBundle", "=", "ClassServiceUtility", ".", "getClassService", "(", ")", ".", "getResourceBundle", "(", "typicalResourceClassName", ",", "locale", ",", "null", ",", "classLoader", ")", ";", "}", "catch", "(", "MissingResourceException", "ex", ")", "{", "resourceBundle", "=", "null", ";", "}", "int", "i", "=", "-", "1", ";", "while", "(", "resourceBundle", "==", "null", ")", "{", "String", "resourceClassName", "=", "Util", ".", "convertClassName", "(", "classResource", ".", "getName", "(", ")", ",", "Constants", ".", "RES_SUBPACKAGE", ",", "i", ")", ";", "if", "(", "resourceClassName", "==", "null", ")", "return", "null", ";", "if", "(", "resourceClassName", ".", "equals", "(", "typicalResourceClassName", ")", ")", "return", "null", ";", "// Looked through them all", "resourceClassName", "=", "resourceClassName", "+", "\"Resources\"", ";", "try", "{", "resourceBundle", "=", "ClassServiceUtility", ".", "getClassService", "(", ")", ".", "getResourceBundle", "(", "resourceClassName", ",", "locale", ",", "null", ",", "classLoader", ")", ";", "}", "catch", "(", "MissingResourceException", "ex", ")", "{", "resourceBundle", "=", "null", ";", "}", "i", "--", ";", "}", "return", "resourceBundle", ";", "}" ]
Get the record resource bundle. @param classResource @param locale @return
[ "Get", "the", "record", "resource", "bundle", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/base/src/main/java/org/jbundle/thin/base/db/FieldList.java#L546-L574
153,356
carewebframework/carewebframework-vista
org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/RPCParameter.java
RPCParameter.hasData
public HasData hasData() { boolean scalar = values.containsKey(""); boolean vector = scalar ? getCount() > 1 : getCount() > 0; return scalar && vector ? HasData.BOTH : scalar ? HasData.SCALAR : vector ? HasData.VECTOR : HasData.NONE; }
java
public HasData hasData() { boolean scalar = values.containsKey(""); boolean vector = scalar ? getCount() > 1 : getCount() > 0; return scalar && vector ? HasData.BOTH : scalar ? HasData.SCALAR : vector ? HasData.VECTOR : HasData.NONE; }
[ "public", "HasData", "hasData", "(", ")", "{", "boolean", "scalar", "=", "values", ".", "containsKey", "(", "\"\"", ")", ";", "boolean", "vector", "=", "scalar", "?", "getCount", "(", ")", ">", "1", ":", "getCount", "(", ")", ">", "0", ";", "return", "scalar", "&&", "vector", "?", "HasData", ".", "BOTH", ":", "scalar", "?", "HasData", ".", "SCALAR", ":", "vector", "?", "HasData", ".", "VECTOR", ":", "HasData", ".", "NONE", ";", "}" ]
Returns the type of data contained in the parameter. @return Type of data.
[ "Returns", "the", "type", "of", "data", "contained", "in", "the", "parameter", "." ]
883b2cbe395d9e8a21cd19db820f0876bda6b1c6
https://github.com/carewebframework/carewebframework-vista/blob/883b2cbe395d9e8a21cd19db820f0876bda6b1c6/org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/RPCParameter.java#L80-L84
153,357
carewebframework/carewebframework-vista
org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/RPCParameter.java
RPCParameter.get
public Object get(String subscript) { if (!values.containsKey(subscript)) { throw new RuntimeException("Subscript not found"); } return values.get(subscript); }
java
public Object get(String subscript) { if (!values.containsKey(subscript)) { throw new RuntimeException("Subscript not found"); } return values.get(subscript); }
[ "public", "Object", "get", "(", "String", "subscript", ")", "{", "if", "(", "!", "values", ".", "containsKey", "(", "subscript", ")", ")", "{", "throw", "new", "RuntimeException", "(", "\"Subscript not found\"", ")", ";", "}", "return", "values", ".", "get", "(", "subscript", ")", ";", "}" ]
Returns the subscripted vector value. A runtime exception is thrown if no vector value exists at the specified subscript. @param subscript The subscript specifier. @return The vector value.
[ "Returns", "the", "subscripted", "vector", "value", ".", "A", "runtime", "exception", "is", "thrown", "if", "no", "vector", "value", "exists", "at", "the", "specified", "subscript", "." ]
883b2cbe395d9e8a21cd19db820f0876bda6b1c6
https://github.com/carewebframework/carewebframework-vista/blob/883b2cbe395d9e8a21cd19db820f0876bda6b1c6/org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/RPCParameter.java#L102-L108
153,358
carewebframework/carewebframework-vista
org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/RPCParameter.java
RPCParameter.assign
public void assign(Iterable<?> source) { clear(); int i = 0; for (Object value : source) { values.put(Integer.toString(++i), value); } }
java
public void assign(Iterable<?> source) { clear(); int i = 0; for (Object value : source) { values.put(Integer.toString(++i), value); } }
[ "public", "void", "assign", "(", "Iterable", "<", "?", ">", "source", ")", "{", "clear", "(", ")", ";", "int", "i", "=", "0", ";", "for", "(", "Object", "value", ":", "source", ")", "{", "values", ".", "put", "(", "Integer", ".", "toString", "(", "++", "i", ")", ",", "value", ")", ";", "}", "}" ]
Copies source values as integer-indexed vector values. @param source Source values.
[ "Copies", "source", "values", "as", "integer", "-", "indexed", "vector", "values", "." ]
883b2cbe395d9e8a21cd19db820f0876bda6b1c6
https://github.com/carewebframework/carewebframework-vista/blob/883b2cbe395d9e8a21cd19db820f0876bda6b1c6/org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/RPCParameter.java#L125-L132
153,359
carewebframework/carewebframework-vista
org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/RPCParameter.java
RPCParameter.assignArray
public void assignArray(Object source) { int len = Array.getLength(source); List<Object> list = new ArrayList<Object>(len); for (int i = 0; i < len; i++) { list.add(Array.get(source, i)); } assign(list); }
java
public void assignArray(Object source) { int len = Array.getLength(source); List<Object> list = new ArrayList<Object>(len); for (int i = 0; i < len; i++) { list.add(Array.get(source, i)); } assign(list); }
[ "public", "void", "assignArray", "(", "Object", "source", ")", "{", "int", "len", "=", "Array", ".", "getLength", "(", "source", ")", ";", "List", "<", "Object", ">", "list", "=", "new", "ArrayList", "<", "Object", ">", "(", "len", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "len", ";", "i", "++", ")", "{", "list", ".", "add", "(", "Array", ".", "get", "(", "source", ",", "i", ")", ")", ";", "}", "assign", "(", "list", ")", ";", "}" ]
Copies source values from an input array as integer-indexed vector values. @param source Source values.
[ "Copies", "source", "values", "from", "an", "input", "array", "as", "integer", "-", "indexed", "vector", "values", "." ]
883b2cbe395d9e8a21cd19db820f0876bda6b1c6
https://github.com/carewebframework/carewebframework-vista/blob/883b2cbe395d9e8a21cd19db820f0876bda6b1c6/org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/RPCParameter.java#L139-L148
153,360
carewebframework/carewebframework-vista
org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/RPCParameter.java
RPCParameter.put
public void put(Object[] subscript, Object value) { put(BrokerUtil.buildSubscript(subscript), value); }
java
public void put(Object[] subscript, Object value) { put(BrokerUtil.buildSubscript(subscript), value); }
[ "public", "void", "put", "(", "Object", "[", "]", "subscript", ",", "Object", "value", ")", "{", "put", "(", "BrokerUtil", ".", "buildSubscript", "(", "subscript", ")", ",", "value", ")", ";", "}" ]
Adds a vector value at the specified subscript. @param subscript Array of subscript values. @param value Value.
[ "Adds", "a", "vector", "value", "at", "the", "specified", "subscript", "." ]
883b2cbe395d9e8a21cd19db820f0876bda6b1c6
https://github.com/carewebframework/carewebframework-vista/blob/883b2cbe395d9e8a21cd19db820f0876bda6b1c6/org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/RPCParameter.java#L186-L188
153,361
jbundle/jbundle
thin/base/screen/screen/src/main/java/org/jbundle/thin/base/message/event/FieldListMessageHandler.java
FieldListMessageHandler.handleMessage
public int handleMessage(BaseMessage message) { try { int iMessageType = Integer.parseInt((String)message.get(MessageConstants.MESSAGE_TYPE_PARAM)); if ((iMessageType == Constants.AFTER_UPDATE_TYPE) || (iMessageType == Constants.CACHE_UPDATE_TYPE)) { // Record updated - be very careful, you are running in an independent thread. SwingUtilities.invokeLater(new UpdateScreenRecord(iMessageType)); } } catch (NumberFormatException ex) { // Ignore } return super.handleMessage(message); }
java
public int handleMessage(BaseMessage message) { try { int iMessageType = Integer.parseInt((String)message.get(MessageConstants.MESSAGE_TYPE_PARAM)); if ((iMessageType == Constants.AFTER_UPDATE_TYPE) || (iMessageType == Constants.CACHE_UPDATE_TYPE)) { // Record updated - be very careful, you are running in an independent thread. SwingUtilities.invokeLater(new UpdateScreenRecord(iMessageType)); } } catch (NumberFormatException ex) { // Ignore } return super.handleMessage(message); }
[ "public", "int", "handleMessage", "(", "BaseMessage", "message", ")", "{", "try", "{", "int", "iMessageType", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "message", ".", "get", "(", "MessageConstants", ".", "MESSAGE_TYPE_PARAM", ")", ")", ";", "if", "(", "(", "iMessageType", "==", "Constants", ".", "AFTER_UPDATE_TYPE", ")", "||", "(", "iMessageType", "==", "Constants", ".", "CACHE_UPDATE_TYPE", ")", ")", "{", "// Record updated - be very careful, you are running in an independent thread.", "SwingUtilities", ".", "invokeLater", "(", "new", "UpdateScreenRecord", "(", "iMessageType", ")", ")", ";", "}", "}", "catch", "(", "NumberFormatException", "ex", ")", "{", "// Ignore", "}", "return", "super", ".", "handleMessage", "(", "message", ")", ";", "}" ]
Handle this message. Basically, if I get a message that the current record changed, I re-read the record. @param The message to handle. @return An error code.
[ "Handle", "this", "message", ".", "Basically", "if", "I", "get", "a", "message", "that", "the", "current", "record", "changed", "I", "re", "-", "read", "the", "record", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/screen/src/main/java/org/jbundle/thin/base/message/event/FieldListMessageHandler.java#L84-L97
153,362
pressgang-ccms/PressGangCCMSBuilder
src/main/java/org/jboss/pressgang/ccms/contentspec/builder/structures/BuildDatabase.java
BuildDatabase.add
public void add(final ITopicNode specTopic, final String key) { if (specTopic == null) return; final Integer topicId = specTopic.getDBId(); if (!topics.containsKey(topicId)) { topics.put(topicId, new LinkedList<ITopicNode>()); } // Make sure the key exists if (!topicsKeys.containsKey(key)) { topicsKeys.put(key, new LinkedList<ITopicNode>()); } topics.get(topicId).add(specTopic); topicsKeys.get(key).add(specTopic); }
java
public void add(final ITopicNode specTopic, final String key) { if (specTopic == null) return; final Integer topicId = specTopic.getDBId(); if (!topics.containsKey(topicId)) { topics.put(topicId, new LinkedList<ITopicNode>()); } // Make sure the key exists if (!topicsKeys.containsKey(key)) { topicsKeys.put(key, new LinkedList<ITopicNode>()); } topics.get(topicId).add(specTopic); topicsKeys.get(key).add(specTopic); }
[ "public", "void", "add", "(", "final", "ITopicNode", "specTopic", ",", "final", "String", "key", ")", "{", "if", "(", "specTopic", "==", "null", ")", "return", ";", "final", "Integer", "topicId", "=", "specTopic", ".", "getDBId", "(", ")", ";", "if", "(", "!", "topics", ".", "containsKey", "(", "topicId", ")", ")", "{", "topics", ".", "put", "(", "topicId", ",", "new", "LinkedList", "<", "ITopicNode", ">", "(", ")", ")", ";", "}", "// Make sure the key exists", "if", "(", "!", "topicsKeys", ".", "containsKey", "(", "key", ")", ")", "{", "topicsKeys", ".", "put", "(", "key", ",", "new", "LinkedList", "<", "ITopicNode", ">", "(", ")", ")", ";", "}", "topics", ".", "get", "(", "topicId", ")", ".", "add", "(", "specTopic", ")", ";", "topicsKeys", ".", "get", "(", "key", ")", ".", "add", "(", "specTopic", ")", ";", "}" ]
Add a SpecTopic to the database. @param specTopic The SpecTopic object to be added. @param key A key that represents the Topic mapped to the SpecTopic
[ "Add", "a", "SpecTopic", "to", "the", "database", "." ]
5436d36ba1b3c5baa246b270e5fc350e6778bce8
https://github.com/pressgang-ccms/PressGangCCMSBuilder/blob/5436d36ba1b3c5baa246b270e5fc350e6778bce8/src/main/java/org/jboss/pressgang/ccms/contentspec/builder/structures/BuildDatabase.java#L50-L65
153,363
pressgang-ccms/PressGangCCMSBuilder
src/main/java/org/jboss/pressgang/ccms/contentspec/builder/structures/BuildDatabase.java
BuildDatabase.setDatabaseDuplicateIds
public void setDatabaseDuplicateIds() { // Set the spec topic duplicate ids based on topic title for (final Entry<Integer, List<ITopicNode>> topicTitleEntry : topics.entrySet()) { final List<ITopicNode> topics = topicTitleEntry.getValue(); if (topics.size() > 1) { for (int i = 1; i < topics.size(); i++) { topics.get(i).setDuplicateId(Integer.toString(i)); } } } }
java
public void setDatabaseDuplicateIds() { // Set the spec topic duplicate ids based on topic title for (final Entry<Integer, List<ITopicNode>> topicTitleEntry : topics.entrySet()) { final List<ITopicNode> topics = topicTitleEntry.getValue(); if (topics.size() > 1) { for (int i = 1; i < topics.size(); i++) { topics.get(i).setDuplicateId(Integer.toString(i)); } } } }
[ "public", "void", "setDatabaseDuplicateIds", "(", ")", "{", "// Set the spec topic duplicate ids based on topic title", "for", "(", "final", "Entry", "<", "Integer", ",", "List", "<", "ITopicNode", ">", ">", "topicTitleEntry", ":", "topics", ".", "entrySet", "(", ")", ")", "{", "final", "List", "<", "ITopicNode", ">", "topics", "=", "topicTitleEntry", ".", "getValue", "(", ")", ";", "if", "(", "topics", ".", "size", "(", ")", ">", "1", ")", "{", "for", "(", "int", "i", "=", "1", ";", "i", "<", "topics", ".", "size", "(", ")", ";", "i", "++", ")", "{", "topics", ".", "get", "(", "i", ")", ".", "setDuplicateId", "(", "Integer", ".", "toString", "(", "i", ")", ")", ";", "}", "}", "}", "}" ]
Sets the Duplicate IDs for all the SpecTopics in the Database.
[ "Sets", "the", "Duplicate", "IDs", "for", "all", "the", "SpecTopics", "in", "the", "Database", "." ]
5436d36ba1b3c5baa246b270e5fc350e6778bce8
https://github.com/pressgang-ccms/PressGangCCMSBuilder/blob/5436d36ba1b3c5baa246b270e5fc350e6778bce8/src/main/java/org/jboss/pressgang/ccms/contentspec/builder/structures/BuildDatabase.java#L81-L91
153,364
pressgang-ccms/PressGangCCMSBuilder
src/main/java/org/jboss/pressgang/ccms/contentspec/builder/structures/BuildDatabase.java
BuildDatabase.isUniqueSpecTopic
public boolean isUniqueSpecTopic(final SpecTopic topic) { return topics.containsKey(topic.getDBId()) ? topics.get(topic.getDBId()).size() == 1 : false; }
java
public boolean isUniqueSpecTopic(final SpecTopic topic) { return topics.containsKey(topic.getDBId()) ? topics.get(topic.getDBId()).size() == 1 : false; }
[ "public", "boolean", "isUniqueSpecTopic", "(", "final", "SpecTopic", "topic", ")", "{", "return", "topics", ".", "containsKey", "(", "topic", ".", "getDBId", "(", ")", ")", "?", "topics", ".", "get", "(", "topic", ".", "getDBId", "(", ")", ")", ".", "size", "(", ")", "==", "1", ":", "false", ";", "}" ]
Checks if a topic is unique in the database. @param topic The Topic to be checked to see if it's unique. @return True if the topic exists in the database and it is unique, otherwise false.
[ "Checks", "if", "a", "topic", "is", "unique", "in", "the", "database", "." ]
5436d36ba1b3c5baa246b270e5fc350e6778bce8
https://github.com/pressgang-ccms/PressGangCCMSBuilder/blob/5436d36ba1b3c5baa246b270e5fc350e6778bce8/src/main/java/org/jboss/pressgang/ccms/contentspec/builder/structures/BuildDatabase.java#L108-L110
153,365
pressgang-ccms/PressGangCCMSBuilder
src/main/java/org/jboss/pressgang/ccms/contentspec/builder/structures/BuildDatabase.java
BuildDatabase.getAllSpecTopics
public List<SpecTopic> getAllSpecTopics() { final ArrayList<SpecTopic> specTopics = new ArrayList<SpecTopic>(); for (final Entry<Integer, List<ITopicNode>> topicEntry : topics.entrySet()) { for (final ITopicNode topic : topicEntry.getValue()) { if (topic instanceof SpecTopic) { specTopics.add((SpecTopic) topic); } } } return specTopics; }
java
public List<SpecTopic> getAllSpecTopics() { final ArrayList<SpecTopic> specTopics = new ArrayList<SpecTopic>(); for (final Entry<Integer, List<ITopicNode>> topicEntry : topics.entrySet()) { for (final ITopicNode topic : topicEntry.getValue()) { if (topic instanceof SpecTopic) { specTopics.add((SpecTopic) topic); } } } return specTopics; }
[ "public", "List", "<", "SpecTopic", ">", "getAllSpecTopics", "(", ")", "{", "final", "ArrayList", "<", "SpecTopic", ">", "specTopics", "=", "new", "ArrayList", "<", "SpecTopic", ">", "(", ")", ";", "for", "(", "final", "Entry", "<", "Integer", ",", "List", "<", "ITopicNode", ">", ">", "topicEntry", ":", "topics", ".", "entrySet", "(", ")", ")", "{", "for", "(", "final", "ITopicNode", "topic", ":", "topicEntry", ".", "getValue", "(", ")", ")", "{", "if", "(", "topic", "instanceof", "SpecTopic", ")", "{", "specTopics", ".", "add", "(", "(", "SpecTopic", ")", "topic", ")", ";", "}", "}", "}", "return", "specTopics", ";", "}" ]
Get a List of all the SpecTopics in the Database. @return A list of SpecTopic objects.
[ "Get", "a", "List", "of", "all", "the", "SpecTopics", "in", "the", "Database", "." ]
5436d36ba1b3c5baa246b270e5fc350e6778bce8
https://github.com/pressgang-ccms/PressGangCCMSBuilder/blob/5436d36ba1b3c5baa246b270e5fc350e6778bce8/src/main/java/org/jboss/pressgang/ccms/contentspec/builder/structures/BuildDatabase.java#L145-L156
153,366
pressgang-ccms/PressGangCCMSBuilder
src/main/java/org/jboss/pressgang/ccms/contentspec/builder/structures/BuildDatabase.java
BuildDatabase.getAllTopicNodes
public List<ITopicNode> getAllTopicNodes() { final ArrayList<ITopicNode> topicNodes = new ArrayList<ITopicNode>(); for (final Entry<Integer, List<ITopicNode>> topicEntry : topics.entrySet()) { topicNodes.addAll(topicEntry.getValue()); } return topicNodes; }
java
public List<ITopicNode> getAllTopicNodes() { final ArrayList<ITopicNode> topicNodes = new ArrayList<ITopicNode>(); for (final Entry<Integer, List<ITopicNode>> topicEntry : topics.entrySet()) { topicNodes.addAll(topicEntry.getValue()); } return topicNodes; }
[ "public", "List", "<", "ITopicNode", ">", "getAllTopicNodes", "(", ")", "{", "final", "ArrayList", "<", "ITopicNode", ">", "topicNodes", "=", "new", "ArrayList", "<", "ITopicNode", ">", "(", ")", ";", "for", "(", "final", "Entry", "<", "Integer", ",", "List", "<", "ITopicNode", ">", ">", "topicEntry", ":", "topics", ".", "entrySet", "(", ")", ")", "{", "topicNodes", ".", "addAll", "(", "topicEntry", ".", "getValue", "(", ")", ")", ";", "}", "return", "topicNodes", ";", "}" ]
Get a List of all the Topic nodes in the Database. @return A list of ITopicNode objects.
[ "Get", "a", "List", "of", "all", "the", "Topic", "nodes", "in", "the", "Database", "." ]
5436d36ba1b3c5baa246b270e5fc350e6778bce8
https://github.com/pressgang-ccms/PressGangCCMSBuilder/blob/5436d36ba1b3c5baa246b270e5fc350e6778bce8/src/main/java/org/jboss/pressgang/ccms/contentspec/builder/structures/BuildDatabase.java#L163-L170
153,367
pressgang-ccms/PressGangCCMSBuilder
src/main/java/org/jboss/pressgang/ccms/contentspec/builder/structures/BuildDatabase.java
BuildDatabase.getAllSpecNodes
public List<SpecNode> getAllSpecNodes() { final ArrayList<SpecNode> retValue = new ArrayList<SpecNode>(); // Add all the levels retValue.addAll(levels); // Add all the topics for (final Entry<Integer, List<ITopicNode>> topicEntry : topics.entrySet()) { for (final ITopicNode topic : topicEntry.getValue()) { if (topic instanceof SpecNode) { retValue.add((SpecNode) topic); } } } return retValue; }
java
public List<SpecNode> getAllSpecNodes() { final ArrayList<SpecNode> retValue = new ArrayList<SpecNode>(); // Add all the levels retValue.addAll(levels); // Add all the topics for (final Entry<Integer, List<ITopicNode>> topicEntry : topics.entrySet()) { for (final ITopicNode topic : topicEntry.getValue()) { if (topic instanceof SpecNode) { retValue.add((SpecNode) topic); } } } return retValue; }
[ "public", "List", "<", "SpecNode", ">", "getAllSpecNodes", "(", ")", "{", "final", "ArrayList", "<", "SpecNode", ">", "retValue", "=", "new", "ArrayList", "<", "SpecNode", ">", "(", ")", ";", "// Add all the levels", "retValue", ".", "addAll", "(", "levels", ")", ";", "// Add all the topics", "for", "(", "final", "Entry", "<", "Integer", ",", "List", "<", "ITopicNode", ">", ">", "topicEntry", ":", "topics", ".", "entrySet", "(", ")", ")", "{", "for", "(", "final", "ITopicNode", "topic", ":", "topicEntry", ".", "getValue", "(", ")", ")", "{", "if", "(", "topic", "instanceof", "SpecNode", ")", "{", "retValue", ".", "add", "(", "(", "SpecNode", ")", "topic", ")", ";", "}", "}", "}", "return", "retValue", ";", "}" ]
Get a List of all the SpecNodes in the Database. @return A list of Level objects.
[ "Get", "a", "List", "of", "all", "the", "SpecNodes", "in", "the", "Database", "." ]
5436d36ba1b3c5baa246b270e5fc350e6778bce8
https://github.com/pressgang-ccms/PressGangCCMSBuilder/blob/5436d36ba1b3c5baa246b270e5fc350e6778bce8/src/main/java/org/jboss/pressgang/ccms/contentspec/builder/structures/BuildDatabase.java#L186-L202
153,368
pressgang-ccms/PressGangCCMSBuilder
src/main/java/org/jboss/pressgang/ccms/contentspec/builder/structures/BuildDatabase.java
BuildDatabase.getIdAttributes
public Set<String> getIdAttributes(final BuildData buildData) { final Set<String> ids = new HashSet<String>(); // Add all the level id attributes for (final Level level : levels) { ids.add(level.getUniqueLinkId(buildData.isUseFixedUrls())); } // Add all the topic id attributes for (final Entry<Integer, List<ITopicNode>> topicEntry : topics.entrySet()) { final List<ITopicNode> topics = topicEntry.getValue(); for (final ITopicNode topic : topics) { if (topic instanceof SpecTopic) { final SpecTopic specTopic = (SpecTopic) topic; ids.add(specTopic.getUniqueLinkId(buildData.isUseFixedUrls())); } } } return ids; }
java
public Set<String> getIdAttributes(final BuildData buildData) { final Set<String> ids = new HashSet<String>(); // Add all the level id attributes for (final Level level : levels) { ids.add(level.getUniqueLinkId(buildData.isUseFixedUrls())); } // Add all the topic id attributes for (final Entry<Integer, List<ITopicNode>> topicEntry : topics.entrySet()) { final List<ITopicNode> topics = topicEntry.getValue(); for (final ITopicNode topic : topics) { if (topic instanceof SpecTopic) { final SpecTopic specTopic = (SpecTopic) topic; ids.add(specTopic.getUniqueLinkId(buildData.isUseFixedUrls())); } } } return ids; }
[ "public", "Set", "<", "String", ">", "getIdAttributes", "(", "final", "BuildData", "buildData", ")", "{", "final", "Set", "<", "String", ">", "ids", "=", "new", "HashSet", "<", "String", ">", "(", ")", ";", "// Add all the level id attributes", "for", "(", "final", "Level", "level", ":", "levels", ")", "{", "ids", ".", "add", "(", "level", ".", "getUniqueLinkId", "(", "buildData", ".", "isUseFixedUrls", "(", ")", ")", ")", ";", "}", "// Add all the topic id attributes", "for", "(", "final", "Entry", "<", "Integer", ",", "List", "<", "ITopicNode", ">", ">", "topicEntry", ":", "topics", ".", "entrySet", "(", ")", ")", "{", "final", "List", "<", "ITopicNode", ">", "topics", "=", "topicEntry", ".", "getValue", "(", ")", ";", "for", "(", "final", "ITopicNode", "topic", ":", "topics", ")", "{", "if", "(", "topic", "instanceof", "SpecTopic", ")", "{", "final", "SpecTopic", "specTopic", "=", "(", "SpecTopic", ")", "topic", ";", "ids", ".", "add", "(", "specTopic", ".", "getUniqueLinkId", "(", "buildData", ".", "isUseFixedUrls", "(", ")", ")", ")", ";", "}", "}", "}", "return", "ids", ";", "}" ]
Get a list of all the ID Attributes of all the topics and levels held in the database. @param buildData @return A List of IDs that exist for levels and topics in the database.
[ "Get", "a", "list", "of", "all", "the", "ID", "Attributes", "of", "all", "the", "topics", "and", "levels", "held", "in", "the", "database", "." ]
5436d36ba1b3c5baa246b270e5fc350e6778bce8
https://github.com/pressgang-ccms/PressGangCCMSBuilder/blob/5436d36ba1b3c5baa246b270e5fc350e6778bce8/src/main/java/org/jboss/pressgang/ccms/contentspec/builder/structures/BuildDatabase.java#L210-L230
153,369
pressgang-ccms/PressGangCCMSBuilder
src/main/java/org/jboss/pressgang/ccms/contentspec/builder/structures/BuildDatabase.java
BuildDatabase.getAllTopics
@SuppressWarnings("unchecked") public <T extends BaseTopicWrapper<T>> List<T> getAllTopics(boolean ignoreRevisions) { final List<T> topics = new ArrayList<T>(); for (final Entry<Integer, List<ITopicNode>> entry : this.topics.entrySet()) { final Integer topicId = entry.getKey(); if (!this.topics.get(topicId).isEmpty()) { if (ignoreRevisions) { topics.add((T) entry.getValue().get(0).getTopic()); } else { final List<T> specTopicTopics = getUniqueTopicsFromSpecTopics(entry.getValue()); topics.addAll(specTopicTopics); } } } return topics; }
java
@SuppressWarnings("unchecked") public <T extends BaseTopicWrapper<T>> List<T> getAllTopics(boolean ignoreRevisions) { final List<T> topics = new ArrayList<T>(); for (final Entry<Integer, List<ITopicNode>> entry : this.topics.entrySet()) { final Integer topicId = entry.getKey(); if (!this.topics.get(topicId).isEmpty()) { if (ignoreRevisions) { topics.add((T) entry.getValue().get(0).getTopic()); } else { final List<T> specTopicTopics = getUniqueTopicsFromSpecTopics(entry.getValue()); topics.addAll(specTopicTopics); } } } return topics; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "T", "extends", "BaseTopicWrapper", "<", "T", ">", ">", "List", "<", "T", ">", "getAllTopics", "(", "boolean", "ignoreRevisions", ")", "{", "final", "List", "<", "T", ">", "topics", "=", "new", "ArrayList", "<", "T", ">", "(", ")", ";", "for", "(", "final", "Entry", "<", "Integer", ",", "List", "<", "ITopicNode", ">", ">", "entry", ":", "this", ".", "topics", ".", "entrySet", "(", ")", ")", "{", "final", "Integer", "topicId", "=", "entry", ".", "getKey", "(", ")", ";", "if", "(", "!", "this", ".", "topics", ".", "get", "(", "topicId", ")", ".", "isEmpty", "(", ")", ")", "{", "if", "(", "ignoreRevisions", ")", "{", "topics", ".", "add", "(", "(", "T", ")", "entry", ".", "getValue", "(", ")", ".", "get", "(", "0", ")", ".", "getTopic", "(", ")", ")", ";", "}", "else", "{", "final", "List", "<", "T", ">", "specTopicTopics", "=", "getUniqueTopicsFromSpecTopics", "(", "entry", ".", "getValue", "(", ")", ")", ";", "topics", ".", "addAll", "(", "specTopicTopics", ")", ";", "}", "}", "}", "return", "topics", ";", "}" ]
Get all of the Topics that exist in the database. You can either choose to ignore revisions, meaning two topics with the same ID but different revisions are classed as the same topic. Or choose to take note of revisions, meaning if two topics have different revisions but the same ID, they are still classed as different topics. @param ignoreRevisions If revisions should be ignored when generating the list of topics. @return A List of all the Topics that exist in the database.
[ "Get", "all", "of", "the", "Topics", "that", "exist", "in", "the", "database", ".", "You", "can", "either", "choose", "to", "ignore", "revisions", "meaning", "two", "topics", "with", "the", "same", "ID", "but", "different", "revisions", "are", "classed", "as", "the", "same", "topic", ".", "Or", "choose", "to", "take", "note", "of", "revisions", "meaning", "if", "two", "topics", "have", "different", "revisions", "but", "the", "same", "ID", "they", "are", "still", "classed", "as", "different", "topics", "." ]
5436d36ba1b3c5baa246b270e5fc350e6778bce8
https://github.com/pressgang-ccms/PressGangCCMSBuilder/blob/5436d36ba1b3c5baa246b270e5fc350e6778bce8/src/main/java/org/jboss/pressgang/ccms/contentspec/builder/structures/BuildDatabase.java#L249-L264
153,370
pressgang-ccms/PressGangCCMSBuilder
src/main/java/org/jboss/pressgang/ccms/contentspec/builder/structures/BuildDatabase.java
BuildDatabase.getUniqueTopicsFromSpecTopics
@SuppressWarnings("unchecked") protected <T extends BaseTopicWrapper<T>> List<T> getUniqueTopicsFromSpecTopics(final List<ITopicNode> topics) { // Find all the unique topics first final Map<Integer, T> revisionToTopic = new HashMap<Integer, T>(); for (final ITopicNode specTopic : topics) { final T topic = (T) specTopic.getTopic(); // Find the Topic Revision final Integer topicRevision = topic.getTopicRevision(); if (!revisionToTopic.containsKey(topicRevision)) { revisionToTopic.put(topicRevision, topic); } } // Convert the revision to topic mapping to just a list of topics final List<T> retValue = new ArrayList<T>(); for (final Entry<Integer, T> entry : revisionToTopic.entrySet()) { retValue.add(entry.getValue()); } return retValue; }
java
@SuppressWarnings("unchecked") protected <T extends BaseTopicWrapper<T>> List<T> getUniqueTopicsFromSpecTopics(final List<ITopicNode> topics) { // Find all the unique topics first final Map<Integer, T> revisionToTopic = new HashMap<Integer, T>(); for (final ITopicNode specTopic : topics) { final T topic = (T) specTopic.getTopic(); // Find the Topic Revision final Integer topicRevision = topic.getTopicRevision(); if (!revisionToTopic.containsKey(topicRevision)) { revisionToTopic.put(topicRevision, topic); } } // Convert the revision to topic mapping to just a list of topics final List<T> retValue = new ArrayList<T>(); for (final Entry<Integer, T> entry : revisionToTopic.entrySet()) { retValue.add(entry.getValue()); } return retValue; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "protected", "<", "T", "extends", "BaseTopicWrapper", "<", "T", ">", ">", "List", "<", "T", ">", "getUniqueTopicsFromSpecTopics", "(", "final", "List", "<", "ITopicNode", ">", "topics", ")", "{", "// Find all the unique topics first", "final", "Map", "<", "Integer", ",", "T", ">", "revisionToTopic", "=", "new", "HashMap", "<", "Integer", ",", "T", ">", "(", ")", ";", "for", "(", "final", "ITopicNode", "specTopic", ":", "topics", ")", "{", "final", "T", "topic", "=", "(", "T", ")", "specTopic", ".", "getTopic", "(", ")", ";", "// Find the Topic Revision", "final", "Integer", "topicRevision", "=", "topic", ".", "getTopicRevision", "(", ")", ";", "if", "(", "!", "revisionToTopic", ".", "containsKey", "(", "topicRevision", ")", ")", "{", "revisionToTopic", ".", "put", "(", "topicRevision", ",", "topic", ")", ";", "}", "}", "// Convert the revision to topic mapping to just a list of topics", "final", "List", "<", "T", ">", "retValue", "=", "new", "ArrayList", "<", "T", ">", "(", ")", ";", "for", "(", "final", "Entry", "<", "Integer", ",", "T", ">", "entry", ":", "revisionToTopic", ".", "entrySet", "(", ")", ")", "{", "retValue", ".", "add", "(", "entry", ".", "getValue", "(", ")", ")", ";", "}", "return", "retValue", ";", "}" ]
Get a list of Unique Topics from a list of SpecTopics. @param topics The list of SpecTopic object to get the topics from. @return A Unique list of Topics.
[ "Get", "a", "list", "of", "Unique", "Topics", "from", "a", "list", "of", "SpecTopics", "." ]
5436d36ba1b3c5baa246b270e5fc350e6778bce8
https://github.com/pressgang-ccms/PressGangCCMSBuilder/blob/5436d36ba1b3c5baa246b270e5fc350e6778bce8/src/main/java/org/jboss/pressgang/ccms/contentspec/builder/structures/BuildDatabase.java#L272-L294
153,371
drewwills/cernunnos
cernunnos-core/src/main/java/org/danann/cernunnos/AbstractContainerTask.java
AbstractContainerTask.loadSubtasks
@SuppressWarnings("unchecked") protected List<Task> loadSubtasks(EntityConfig config, Reagent subtasksPhrase, boolean warnIfMissing) { final List<Task> subtasks = new LinkedList<Task>(); final List<Element> taskElements = (List<Element>) config.getValue(subtasksPhrase); final Grammar grammar = config.getGrammar(); for (final Element taskElement : taskElements) { final Task task = grammar.newTask(taskElement, this); subtasks.add(task); } // There's likely an error in the Cernunnos XML // if we don't have any subtasks, issue a warning... if (warnIfMissing && subtasks.size() == 0 && log.isWarnEnabled()) { log.warn("POSSIBLE PROGRAMMING ERROR: Class '" + getClass().getName() + "' has an empty collection of " + subtasksPhrase.getName() + "\n\t\tSource: " + config.getSource() + "\n\t\tEntity Name: " + config.getEntryName()); } return subtasks; }
java
@SuppressWarnings("unchecked") protected List<Task> loadSubtasks(EntityConfig config, Reagent subtasksPhrase, boolean warnIfMissing) { final List<Task> subtasks = new LinkedList<Task>(); final List<Element> taskElements = (List<Element>) config.getValue(subtasksPhrase); final Grammar grammar = config.getGrammar(); for (final Element taskElement : taskElements) { final Task task = grammar.newTask(taskElement, this); subtasks.add(task); } // There's likely an error in the Cernunnos XML // if we don't have any subtasks, issue a warning... if (warnIfMissing && subtasks.size() == 0 && log.isWarnEnabled()) { log.warn("POSSIBLE PROGRAMMING ERROR: Class '" + getClass().getName() + "' has an empty collection of " + subtasksPhrase.getName() + "\n\t\tSource: " + config.getSource() + "\n\t\tEntity Name: " + config.getEntryName()); } return subtasks; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "protected", "List", "<", "Task", ">", "loadSubtasks", "(", "EntityConfig", "config", ",", "Reagent", "subtasksPhrase", ",", "boolean", "warnIfMissing", ")", "{", "final", "List", "<", "Task", ">", "subtasks", "=", "new", "LinkedList", "<", "Task", ">", "(", ")", ";", "final", "List", "<", "Element", ">", "taskElements", "=", "(", "List", "<", "Element", ">", ")", "config", ".", "getValue", "(", "subtasksPhrase", ")", ";", "final", "Grammar", "grammar", "=", "config", ".", "getGrammar", "(", ")", ";", "for", "(", "final", "Element", "taskElement", ":", "taskElements", ")", "{", "final", "Task", "task", "=", "grammar", ".", "newTask", "(", "taskElement", ",", "this", ")", ";", "subtasks", ".", "add", "(", "task", ")", ";", "}", "// There's likely an error in the Cernunnos XML ", "// if we don't have any subtasks, issue a warning...", "if", "(", "warnIfMissing", "&&", "subtasks", ".", "size", "(", ")", "==", "0", "&&", "log", ".", "isWarnEnabled", "(", ")", ")", "{", "log", ".", "warn", "(", "\"POSSIBLE PROGRAMMING ERROR: Class '\"", "+", "getClass", "(", ")", ".", "getName", "(", ")", "+", "\"' has an empty collection of \"", "+", "subtasksPhrase", ".", "getName", "(", ")", "+", "\"\\n\\t\\tSource: \"", "+", "config", ".", "getSource", "(", ")", "+", "\"\\n\\t\\tEntity Name: \"", "+", "config", ".", "getEntryName", "(", ")", ")", ";", "}", "return", "subtasks", ";", "}" ]
Abstracts the loading of subtasks for a Reagent into a single menthod @param warnIfMissing If true a WARN level log message will be issued if no tasks are loaded for the Reagent
[ "Abstracts", "the", "loading", "of", "subtasks", "for", "a", "Reagent", "into", "a", "single", "menthod" ]
dc6848e0253775e22b6c869fd06506d4ddb6d728
https://github.com/drewwills/cernunnos/blob/dc6848e0253775e22b6c869fd06506d4ddb6d728/cernunnos-core/src/main/java/org/danann/cernunnos/AbstractContainerTask.java#L87-L109
153,372
drewwills/cernunnos
cernunnos-core/src/main/java/org/danann/cernunnos/AbstractContainerTask.java
AbstractContainerTask.performSubtasks
protected void performSubtasks(TaskRequest req, TaskResponse res, List<Task> tasks) { // Assertions... if (req == null) { String msg = "Argument 'req' cannot be null."; throw new IllegalArgumentException(msg); } if (res == null) { String msg = "Argument 'res' cannot be null."; throw new IllegalArgumentException(msg); } if (tasks == null) { String msg = "Child tasks have not been initialized. Subclasses " + "of AbstractContainerTask must call super.init() " + "within their own init() method."; throw new IllegalStateException(msg); } // Invoke each of our children... for (Task k : tasks) { k.perform(req, res); } }
java
protected void performSubtasks(TaskRequest req, TaskResponse res, List<Task> tasks) { // Assertions... if (req == null) { String msg = "Argument 'req' cannot be null."; throw new IllegalArgumentException(msg); } if (res == null) { String msg = "Argument 'res' cannot be null."; throw new IllegalArgumentException(msg); } if (tasks == null) { String msg = "Child tasks have not been initialized. Subclasses " + "of AbstractContainerTask must call super.init() " + "within their own init() method."; throw new IllegalStateException(msg); } // Invoke each of our children... for (Task k : tasks) { k.perform(req, res); } }
[ "protected", "void", "performSubtasks", "(", "TaskRequest", "req", ",", "TaskResponse", "res", ",", "List", "<", "Task", ">", "tasks", ")", "{", "// Assertions...", "if", "(", "req", "==", "null", ")", "{", "String", "msg", "=", "\"Argument 'req' cannot be null.\"", ";", "throw", "new", "IllegalArgumentException", "(", "msg", ")", ";", "}", "if", "(", "res", "==", "null", ")", "{", "String", "msg", "=", "\"Argument 'res' cannot be null.\"", ";", "throw", "new", "IllegalArgumentException", "(", "msg", ")", ";", "}", "if", "(", "tasks", "==", "null", ")", "{", "String", "msg", "=", "\"Child tasks have not been initialized. Subclasses \"", "+", "\"of AbstractContainerTask must call super.init() \"", "+", "\"within their own init() method.\"", ";", "throw", "new", "IllegalStateException", "(", "msg", ")", ";", "}", "// Invoke each of our children...", "for", "(", "Task", "k", ":", "tasks", ")", "{", "k", ".", "perform", "(", "req", ",", "res", ")", ";", "}", "}" ]
Executes a List of Tasks as children of this Task
[ "Executes", "a", "List", "of", "Tasks", "as", "children", "of", "this", "Task" ]
dc6848e0253775e22b6c869fd06506d4ddb6d728
https://github.com/drewwills/cernunnos/blob/dc6848e0253775e22b6c869fd06506d4ddb6d728/cernunnos-core/src/main/java/org/danann/cernunnos/AbstractContainerTask.java#L129-L150
153,373
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/field/BaseField.java
BaseField.free
public void free() { m_DBObject = null; while (m_listener != null) { this.removeListener(m_listener, true); // free all the behaviors } if (m_vScreenField != null) { // Remove all the screen fields while (!m_vScreenField.isEmpty()) { ScreenComponent sField = this.getComponent(0); sField.free(); // Delete this screen field (will free this link). } m_vScreenField.removeAllElements(); m_vScreenField = null; } super.free(); }
java
public void free() { m_DBObject = null; while (m_listener != null) { this.removeListener(m_listener, true); // free all the behaviors } if (m_vScreenField != null) { // Remove all the screen fields while (!m_vScreenField.isEmpty()) { ScreenComponent sField = this.getComponent(0); sField.free(); // Delete this screen field (will free this link). } m_vScreenField.removeAllElements(); m_vScreenField = null; } super.free(); }
[ "public", "void", "free", "(", ")", "{", "m_DBObject", "=", "null", ";", "while", "(", "m_listener", "!=", "null", ")", "{", "this", ".", "removeListener", "(", "m_listener", ",", "true", ")", ";", "// free all the behaviors", "}", "if", "(", "m_vScreenField", "!=", "null", ")", "{", "// Remove all the screen fields", "while", "(", "!", "m_vScreenField", ".", "isEmpty", "(", ")", ")", "{", "ScreenComponent", "sField", "=", "this", ".", "getComponent", "(", "0", ")", ";", "sField", ".", "free", "(", ")", ";", "// Delete this screen field (will free this link).", "}", "m_vScreenField", ".", "removeAllElements", "(", ")", ";", "m_vScreenField", "=", "null", ";", "}", "super", ".", "free", "(", ")", ";", "}" ]
Free this field.
[ "Free", "this", "field", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/BaseField.java#L142-L160
153,374
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/field/BaseField.java
BaseField.cloneField
public static BaseField cloneField(BaseField fieldToClone) throws CloneNotSupportedException { BaseField field = null; String strClassName = fieldToClone.getClass().getName(); field = (BaseField)ClassServiceUtility.getClassService().makeObjectFromClassName(strClassName); if (field != null) { field.init(null, fieldToClone.getFieldName(), fieldToClone.getMaxLength(), fieldToClone.getFieldDesc(), fieldToClone.getDefault()); field.setRecord(fieldToClone.getRecord()); // Set table without adding to table field list } return field; }
java
public static BaseField cloneField(BaseField fieldToClone) throws CloneNotSupportedException { BaseField field = null; String strClassName = fieldToClone.getClass().getName(); field = (BaseField)ClassServiceUtility.getClassService().makeObjectFromClassName(strClassName); if (field != null) { field.init(null, fieldToClone.getFieldName(), fieldToClone.getMaxLength(), fieldToClone.getFieldDesc(), fieldToClone.getDefault()); field.setRecord(fieldToClone.getRecord()); // Set table without adding to table field list } return field; }
[ "public", "static", "BaseField", "cloneField", "(", "BaseField", "fieldToClone", ")", "throws", "CloneNotSupportedException", "{", "BaseField", "field", "=", "null", ";", "String", "strClassName", "=", "fieldToClone", ".", "getClass", "(", ")", ".", "getName", "(", ")", ";", "field", "=", "(", "BaseField", ")", "ClassServiceUtility", ".", "getClassService", "(", ")", ".", "makeObjectFromClassName", "(", "strClassName", ")", ";", "if", "(", "field", "!=", "null", ")", "{", "field", ".", "init", "(", "null", ",", "fieldToClone", ".", "getFieldName", "(", ")", ",", "fieldToClone", ".", "getMaxLength", "(", ")", ",", "fieldToClone", ".", "getFieldDesc", "(", ")", ",", "fieldToClone", ".", "getDefault", "(", ")", ")", ";", "field", ".", "setRecord", "(", "fieldToClone", ".", "getRecord", "(", ")", ")", ";", "// Set table without adding to table field list", "}", "return", "field", ";", "}" ]
Creates a new object of the exact same class as this field. The clone method will clone a field that can contain the same kind of data but may not be the exact same field class. @return a clone of this instance. @exception CloneNotSupportedException if the object's class does not support the <code>Cloneable</code> interface. @see java.lang.Cloneable
[ "Creates", "a", "new", "object", "of", "the", "exact", "same", "class", "as", "this", "field", ".", "The", "clone", "method", "will", "clone", "a", "field", "that", "can", "contain", "the", "same", "kind", "of", "data", "but", "may", "not", "be", "the", "exact", "same", "field", "class", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/BaseField.java#L240-L251
153,375
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/field/BaseField.java
BaseField.removeListener
public void removeListener(BaseListener listener, boolean bFreeListener) { if (m_listener != null) { if (m_listener == listener) { m_listener = (FieldListener)listener.getNextListener(); listener.unlink(bFreeListener); // remove theBehavior from the linked list } else m_listener.removeListener(listener, bFreeListener); } // Remember to free the listener after removing it! }
java
public void removeListener(BaseListener listener, boolean bFreeListener) { if (m_listener != null) { if (m_listener == listener) { m_listener = (FieldListener)listener.getNextListener(); listener.unlink(bFreeListener); // remove theBehavior from the linked list } else m_listener.removeListener(listener, bFreeListener); } // Remember to free the listener after removing it! }
[ "public", "void", "removeListener", "(", "BaseListener", "listener", ",", "boolean", "bFreeListener", ")", "{", "if", "(", "m_listener", "!=", "null", ")", "{", "if", "(", "m_listener", "==", "listener", ")", "{", "m_listener", "=", "(", "FieldListener", ")", "listener", ".", "getNextListener", "(", ")", ";", "listener", ".", "unlink", "(", "bFreeListener", ")", ";", "// remove theBehavior from the linked list", "}", "else", "m_listener", ".", "removeListener", "(", "listener", ",", "bFreeListener", ")", ";", "}", "// Remember to free the listener after removing it!", "}" ]
Remove this listener from the chain. @param listener The listener to remove. @param bFreeListener If true, the listener is also freed.
[ "Remove", "this", "listener", "from", "the", "chain", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/BaseField.java#L293-L305
153,376
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/field/BaseField.java
BaseField.addQuotes
public static final String addQuotes(String szTableNames, char charStart, char charEnd) { String strFileName = szTableNames; if (charStart == -1) charStart = DBConstants.SQL_START_QUOTE; if (charEnd == -1) charEnd = DBConstants.SQL_END_QUOTE; for (int iIndex = 0; iIndex < strFileName.length(); iIndex++) { if ((strFileName.charAt(iIndex) == charStart) || (strFileName.charAt(iIndex) == charEnd)) { // If a quote is in this string, replace with a double-quote Fred's -> Fred''s strFileName = strFileName.substring(0, iIndex) + strFileName.substring(iIndex, iIndex + 1) + strFileName.substring(iIndex, iIndex + 1) + strFileName.substring(iIndex + 1, strFileName.length()); iIndex++; // Skip the second quote } } if ((charStart != ' ') && (charEnd != ' ')) strFileName = charStart + strFileName + charEnd; // Spaces in name, quotes required return strFileName; }
java
public static final String addQuotes(String szTableNames, char charStart, char charEnd) { String strFileName = szTableNames; if (charStart == -1) charStart = DBConstants.SQL_START_QUOTE; if (charEnd == -1) charEnd = DBConstants.SQL_END_QUOTE; for (int iIndex = 0; iIndex < strFileName.length(); iIndex++) { if ((strFileName.charAt(iIndex) == charStart) || (strFileName.charAt(iIndex) == charEnd)) { // If a quote is in this string, replace with a double-quote Fred's -> Fred''s strFileName = strFileName.substring(0, iIndex) + strFileName.substring(iIndex, iIndex + 1) + strFileName.substring(iIndex, iIndex + 1) + strFileName.substring(iIndex + 1, strFileName.length()); iIndex++; // Skip the second quote } } if ((charStart != ' ') && (charEnd != ' ')) strFileName = charStart + strFileName + charEnd; // Spaces in name, quotes required return strFileName; }
[ "public", "static", "final", "String", "addQuotes", "(", "String", "szTableNames", ",", "char", "charStart", ",", "char", "charEnd", ")", "{", "String", "strFileName", "=", "szTableNames", ";", "if", "(", "charStart", "==", "-", "1", ")", "charStart", "=", "DBConstants", ".", "SQL_START_QUOTE", ";", "if", "(", "charEnd", "==", "-", "1", ")", "charEnd", "=", "DBConstants", ".", "SQL_END_QUOTE", ";", "for", "(", "int", "iIndex", "=", "0", ";", "iIndex", "<", "strFileName", ".", "length", "(", ")", ";", "iIndex", "++", ")", "{", "if", "(", "(", "strFileName", ".", "charAt", "(", "iIndex", ")", "==", "charStart", ")", "||", "(", "strFileName", ".", "charAt", "(", "iIndex", ")", "==", "charEnd", ")", ")", "{", "// If a quote is in this string, replace with a double-quote Fred's -> Fred''s", "strFileName", "=", "strFileName", ".", "substring", "(", "0", ",", "iIndex", ")", "+", "strFileName", ".", "substring", "(", "iIndex", ",", "iIndex", "+", "1", ")", "+", "strFileName", ".", "substring", "(", "iIndex", ",", "iIndex", "+", "1", ")", "+", "strFileName", ".", "substring", "(", "iIndex", "+", "1", ",", "strFileName", ".", "length", "(", ")", ")", ";", "iIndex", "++", ";", "// Skip the second quote", "}", "}", "if", "(", "(", "charStart", "!=", "'", "'", ")", "&&", "(", "charEnd", "!=", "'", "'", ")", ")", "strFileName", "=", "charStart", "+", "strFileName", "+", "charEnd", ";", "// Spaces in name, quotes required", "return", "strFileName", ";", "}" ]
Add these quotes to this string. @param szTableNames The source string. @param charStart The starting quote. @param charEnd The ending quote. @return The new (quoted) string.
[ "Add", "these", "quotes", "to", "this", "string", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/BaseField.java#L330-L353
153,377
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/field/BaseField.java
BaseField.displayField
public void displayField() // init this field override for other value { if (m_vScreenField == null) return; for (Enumeration<Object> e = m_vScreenField.elements() ; e.hasMoreElements() ;) { ScreenComponent sField = (ScreenComponent)e.nextElement(); sField.fieldToControl(); // Display using the new value(s) } }
java
public void displayField() // init this field override for other value { if (m_vScreenField == null) return; for (Enumeration<Object> e = m_vScreenField.elements() ; e.hasMoreElements() ;) { ScreenComponent sField = (ScreenComponent)e.nextElement(); sField.fieldToControl(); // Display using the new value(s) } }
[ "public", "void", "displayField", "(", ")", "// init this field override for other value", "{", "if", "(", "m_vScreenField", "==", "null", ")", "return", ";", "for", "(", "Enumeration", "<", "Object", ">", "e", "=", "m_vScreenField", ".", "elements", "(", ")", ";", "e", ".", "hasMoreElements", "(", ")", ";", ")", "{", "ScreenComponent", "sField", "=", "(", "ScreenComponent", ")", "e", ".", "nextElement", "(", ")", ";", "sField", ".", "fieldToControl", "(", ")", ";", "// Display using the new value(s)", "}", "}" ]
Display this field using all this field's screen fields.
[ "Display", "this", "field", "using", "all", "this", "field", "s", "screen", "fields", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/BaseField.java#L423-L431
153,378
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/field/BaseField.java
BaseField.setEnableListeners
public void setEnableListeners(boolean[] rgbEnabled) { int iIndex = 0; FieldListener fieldBehavior = this.getListener(); while (fieldBehavior != null) { boolean bEnable = true; if ((rgbEnabled != null) && (iIndex < rgbEnabled.length)) bEnable = rgbEnabled[iIndex]; fieldBehavior.setEnabledListener(bEnable); fieldBehavior = (FieldListener)fieldBehavior.getNextListener(); iIndex++; } }
java
public void setEnableListeners(boolean[] rgbEnabled) { int iIndex = 0; FieldListener fieldBehavior = this.getListener(); while (fieldBehavior != null) { boolean bEnable = true; if ((rgbEnabled != null) && (iIndex < rgbEnabled.length)) bEnable = rgbEnabled[iIndex]; fieldBehavior.setEnabledListener(bEnable); fieldBehavior = (FieldListener)fieldBehavior.getNextListener(); iIndex++; } }
[ "public", "void", "setEnableListeners", "(", "boolean", "[", "]", "rgbEnabled", ")", "{", "int", "iIndex", "=", "0", ";", "FieldListener", "fieldBehavior", "=", "this", ".", "getListener", "(", ")", ";", "while", "(", "fieldBehavior", "!=", "null", ")", "{", "boolean", "bEnable", "=", "true", ";", "if", "(", "(", "rgbEnabled", "!=", "null", ")", "&&", "(", "iIndex", "<", "rgbEnabled", ".", "length", ")", ")", "bEnable", "=", "rgbEnabled", "[", "iIndex", "]", ";", "fieldBehavior", ".", "setEnabledListener", "(", "bEnable", ")", ";", "fieldBehavior", "=", "(", "FieldListener", ")", "fieldBehavior", ".", "getNextListener", "(", ")", ";", "iIndex", "++", ";", "}", "}" ]
Get the status of the the FieldChanged behaviors? @return The handle field change flag (if false field change handling is disabled).
[ "Get", "the", "status", "of", "the", "the", "FieldChanged", "behaviors?" ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/BaseField.java#L600-L614
153,379
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/field/BaseField.java
BaseField.getData
public Object getData() { Object objData = null; FieldListener nextListener = (FieldListener)this.getNextValidListener(DBConstants.SCREEN_MOVE); // Fix this if (nextListener != null) { boolean bOldState = nextListener.setEnabledListener(false); // Disable the listener to eliminate echos objData = nextListener.doGetData(); nextListener.setEnabledListener(bOldState); // Reenable } else objData = this.doGetData(); return objData; }
java
public Object getData() { Object objData = null; FieldListener nextListener = (FieldListener)this.getNextValidListener(DBConstants.SCREEN_MOVE); // Fix this if (nextListener != null) { boolean bOldState = nextListener.setEnabledListener(false); // Disable the listener to eliminate echos objData = nextListener.doGetData(); nextListener.setEnabledListener(bOldState); // Reenable } else objData = this.doGetData(); return objData; }
[ "public", "Object", "getData", "(", ")", "{", "Object", "objData", "=", "null", ";", "FieldListener", "nextListener", "=", "(", "FieldListener", ")", "this", ".", "getNextValidListener", "(", "DBConstants", ".", "SCREEN_MOVE", ")", ";", "// Fix this", "if", "(", "nextListener", "!=", "null", ")", "{", "boolean", "bOldState", "=", "nextListener", ".", "setEnabledListener", "(", "false", ")", ";", "// Disable the listener to eliminate echos", "objData", "=", "nextListener", ".", "doGetData", "(", ")", ";", "nextListener", ".", "setEnabledListener", "(", "bOldState", ")", ";", "// Reenable", "}", "else", "objData", "=", "this", ".", "doGetData", "(", ")", ";", "return", "objData", ";", "}" ]
Get the physical binary data from this field. Behaviors are often used to initiate a complicated action only when the system asks for this data. @return The raw data for this field.
[ "Get", "the", "physical", "binary", "data", "from", "this", "field", ".", "Behaviors", "are", "often", "used", "to", "initiate", "a", "complicated", "action", "only", "when", "the", "system", "asks", "for", "this", "data", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/BaseField.java#L620-L633
153,380
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/field/BaseField.java
BaseField.getFieldName
public String getFieldName(boolean bAddQuotes, boolean bIncludeFileName) { if (!bAddQuotes) if (!bIncludeFileName) return super.getFieldName(bAddQuotes, bIncludeFileName); // Return m_sFieldName String strFieldName = Constants.BLANK; if (bIncludeFileName) if (this.getRecord() != null) { strFieldName = this.getRecord().getTableNames(bAddQuotes); if (strFieldName.length() != 0) strFieldName += "."; } strFieldName += Record.formatTableNames(m_strFieldName, bAddQuotes); return strFieldName; }
java
public String getFieldName(boolean bAddQuotes, boolean bIncludeFileName) { if (!bAddQuotes) if (!bIncludeFileName) return super.getFieldName(bAddQuotes, bIncludeFileName); // Return m_sFieldName String strFieldName = Constants.BLANK; if (bIncludeFileName) if (this.getRecord() != null) { strFieldName = this.getRecord().getTableNames(bAddQuotes); if (strFieldName.length() != 0) strFieldName += "."; } strFieldName += Record.formatTableNames(m_strFieldName, bAddQuotes); return strFieldName; }
[ "public", "String", "getFieldName", "(", "boolean", "bAddQuotes", ",", "boolean", "bIncludeFileName", ")", "{", "if", "(", "!", "bAddQuotes", ")", "if", "(", "!", "bIncludeFileName", ")", "return", "super", ".", "getFieldName", "(", "bAddQuotes", ",", "bIncludeFileName", ")", ";", "// Return m_sFieldName", "String", "strFieldName", "=", "Constants", ".", "BLANK", ";", "if", "(", "bIncludeFileName", ")", "if", "(", "this", ".", "getRecord", "(", ")", "!=", "null", ")", "{", "strFieldName", "=", "this", ".", "getRecord", "(", ")", ".", "getTableNames", "(", "bAddQuotes", ")", ";", "if", "(", "strFieldName", ".", "length", "(", ")", "!=", "0", ")", "strFieldName", "+=", "\".\"", ";", "}", "strFieldName", "+=", "Record", ".", "formatTableNames", "(", "m_strFieldName", ",", "bAddQuotes", ")", ";", "return", "strFieldName", ";", "}" ]
Get this field's name. @param bAddQuotes Add quotes if this field contains a space. @param bIncludeFileName include the file name as file.field. @return The field name.
[ "Get", "this", "field", "s", "name", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/BaseField.java#L658-L672
153,381
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/field/BaseField.java
BaseField.isSameType
public boolean isSameType(FieldInfo field) { // Copy this data to a field //Change this to lock the objects down first! boolean bSameType = false; if (this.getClass().getName().equals(field.getClass().getName())) bSameType = true; else { Object data = this.getData(); Class<?> classData = this.getDataClass(); if (data != null) classData = data.getClass(); Object fieldData = field.getData(); Class<?> classField = field.getDataClass(); if (fieldData != null) classField = fieldData.getClass(); if (classData.equals(classField)) bSameType = true; } return bSameType; }
java
public boolean isSameType(FieldInfo field) { // Copy this data to a field //Change this to lock the objects down first! boolean bSameType = false; if (this.getClass().getName().equals(field.getClass().getName())) bSameType = true; else { Object data = this.getData(); Class<?> classData = this.getDataClass(); if (data != null) classData = data.getClass(); Object fieldData = field.getData(); Class<?> classField = field.getDataClass(); if (fieldData != null) classField = fieldData.getClass(); if (classData.equals(classField)) bSameType = true; } return bSameType; }
[ "public", "boolean", "isSameType", "(", "FieldInfo", "field", ")", "{", "// Copy this data to a field //Change this to lock the objects down first!", "boolean", "bSameType", "=", "false", ";", "if", "(", "this", ".", "getClass", "(", ")", ".", "getName", "(", ")", ".", "equals", "(", "field", ".", "getClass", "(", ")", ".", "getName", "(", ")", ")", ")", "bSameType", "=", "true", ";", "else", "{", "Object", "data", "=", "this", ".", "getData", "(", ")", ";", "Class", "<", "?", ">", "classData", "=", "this", ".", "getDataClass", "(", ")", ";", "if", "(", "data", "!=", "null", ")", "classData", "=", "data", ".", "getClass", "(", ")", ";", "Object", "fieldData", "=", "field", ".", "getData", "(", ")", ";", "Class", "<", "?", ">", "classField", "=", "field", ".", "getDataClass", "(", ")", ";", "if", "(", "fieldData", "!=", "null", ")", "classField", "=", "fieldData", ".", "getClass", "(", ")", ";", "if", "(", "classData", ".", "equals", "(", "classField", ")", ")", "bSameType", "=", "true", ";", "}", "return", "bSameType", ";", "}" ]
Are the data in these fields the same type? @param field The field to check. @return True if the raw data type is the same for both fields.
[ "Are", "the", "data", "in", "these", "fields", "the", "same", "type?" ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/BaseField.java#L938-L957
153,382
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/field/BaseField.java
BaseField.moveFieldToThis
public int moveFieldToThis(FieldInfo field, boolean bDisplayOption, int iMoveMode) { // Copy a field to this if (this.isSameType(field)) { // Same type, just move the info Object data = field.getData(); return this.setData(data, bDisplayOption, iMoveMode); } else { // Different type... convert to text first String tempString = field.getString(); return this.setString(tempString, bDisplayOption, iMoveMode); } }
java
public int moveFieldToThis(FieldInfo field, boolean bDisplayOption, int iMoveMode) { // Copy a field to this if (this.isSameType(field)) { // Same type, just move the info Object data = field.getData(); return this.setData(data, bDisplayOption, iMoveMode); } else { // Different type... convert to text first String tempString = field.getString(); return this.setString(tempString, bDisplayOption, iMoveMode); } }
[ "public", "int", "moveFieldToThis", "(", "FieldInfo", "field", ",", "boolean", "bDisplayOption", ",", "int", "iMoveMode", ")", "{", "// Copy a field to this", "if", "(", "this", ".", "isSameType", "(", "field", ")", ")", "{", "// Same type, just move the info", "Object", "data", "=", "field", ".", "getData", "(", ")", ";", "return", "this", ".", "setData", "(", "data", ",", "bDisplayOption", ",", "iMoveMode", ")", ";", "}", "else", "{", "// Different type... convert to text first", "String", "tempString", "=", "field", ".", "getString", "(", ")", ";", "return", "this", ".", "setString", "(", "tempString", ",", "bDisplayOption", ",", "iMoveMode", ")", ";", "}", "}" ]
Move data to this field from another field. If the data types are the same data is moved, otherwise a string conversion is done. @param field The source field. @param bDisplayOption If true, display changes. @param iMoveMode The move mode. @return The error code (or NORMAL_RETURN).
[ "Move", "data", "to", "this", "field", "from", "another", "field", ".", "If", "the", "data", "types", "are", "the", "same", "data", "is", "moved", "otherwise", "a", "string", "conversion", "is", "done", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/BaseField.java#L1008-L1020
153,383
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/field/BaseField.java
BaseField.setSFieldToProperty
public int setSFieldToProperty() { int iErrorCode = DBConstants.NORMAL_RETURN; m_bJustChanged = false; for (int iComponent = 0; ; iComponent++) { ScreenComponent sField = this.getComponent(iComponent); if (sField == null) break; iErrorCode = sField.setSFieldToProperty(null, DBConstants.DISPLAY, DBConstants.READ_MOVE); } if (iErrorCode == DBConstants.NORMAL_RETURN) if (!this.isJustModified()) if (this.getComponent(0) != null) { ScreenComponent sField = this.getComponent(0); ComponentParent parentScreen = sField.getParentScreen(); String strParam = this.getFieldName(false, true); String strParamValue = parentScreen.getProperty(strParam); if (strParamValue != null) this.setString(strParamValue, DBConstants.DISPLAY, DBConstants.READ_MOVE); } return iErrorCode; }
java
public int setSFieldToProperty() { int iErrorCode = DBConstants.NORMAL_RETURN; m_bJustChanged = false; for (int iComponent = 0; ; iComponent++) { ScreenComponent sField = this.getComponent(iComponent); if (sField == null) break; iErrorCode = sField.setSFieldToProperty(null, DBConstants.DISPLAY, DBConstants.READ_MOVE); } if (iErrorCode == DBConstants.NORMAL_RETURN) if (!this.isJustModified()) if (this.getComponent(0) != null) { ScreenComponent sField = this.getComponent(0); ComponentParent parentScreen = sField.getParentScreen(); String strParam = this.getFieldName(false, true); String strParamValue = parentScreen.getProperty(strParam); if (strParamValue != null) this.setString(strParamValue, DBConstants.DISPLAY, DBConstants.READ_MOVE); } return iErrorCode; }
[ "public", "int", "setSFieldToProperty", "(", ")", "{", "int", "iErrorCode", "=", "DBConstants", ".", "NORMAL_RETURN", ";", "m_bJustChanged", "=", "false", ";", "for", "(", "int", "iComponent", "=", "0", ";", ";", "iComponent", "++", ")", "{", "ScreenComponent", "sField", "=", "this", ".", "getComponent", "(", "iComponent", ")", ";", "if", "(", "sField", "==", "null", ")", "break", ";", "iErrorCode", "=", "sField", ".", "setSFieldToProperty", "(", "null", ",", "DBConstants", ".", "DISPLAY", ",", "DBConstants", ".", "READ_MOVE", ")", ";", "}", "if", "(", "iErrorCode", "==", "DBConstants", ".", "NORMAL_RETURN", ")", "if", "(", "!", "this", ".", "isJustModified", "(", ")", ")", "if", "(", "this", ".", "getComponent", "(", "0", ")", "!=", "null", ")", "{", "ScreenComponent", "sField", "=", "this", ".", "getComponent", "(", "0", ")", ";", "ComponentParent", "parentScreen", "=", "sField", ".", "getParentScreen", "(", ")", ";", "String", "strParam", "=", "this", ".", "getFieldName", "(", "false", ",", "true", ")", ";", "String", "strParamValue", "=", "parentScreen", ".", "getProperty", "(", "strParam", ")", ";", "if", "(", "strParamValue", "!=", "null", ")", "this", ".", "setString", "(", "strParamValue", ",", "DBConstants", ".", "DISPLAY", ",", "DBConstants", ".", "READ_MOVE", ")", ";", "}", "return", "iErrorCode", ";", "}" ]
This is a utility method to simplify setting a single field to the field's property. @return The error code on set.
[ "This", "is", "a", "utility", "method", "to", "simplify", "setting", "a", "single", "field", "to", "the", "field", "s", "property", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/BaseField.java#L1073-L1096
153,384
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/field/BaseField.java
BaseField.createScreenComponent
public static ScreenComponent createScreenComponent(String componentType, ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Map<String,Object> properties) { String screenFieldClass = null; if (!componentType.contains(".")) screenFieldClass = ScreenModel.BASE_PACKAGE + componentType; else if (componentType.startsWith(".")) screenFieldClass = DBConstants.ROOT_PACKAGE + componentType.substring(1); else screenFieldClass = componentType; ScreenComponent screenField = (ScreenComponent)ClassServiceUtility.getClassService().makeObjectFromClassName(screenFieldClass); if (screenField == null) { Utility.getLogger().warning("Screen component not found " + componentType); screenField = (ScreenComponent)ClassServiceUtility.getClassService().makeObjectFromClassName(ScreenModel.BASE_PACKAGE + ScreenModel.EDIT_TEXT); } screenField.init(itsLocation, targetScreen, converter, iDisplayFieldDesc, properties); return screenField; }
java
public static ScreenComponent createScreenComponent(String componentType, ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Map<String,Object> properties) { String screenFieldClass = null; if (!componentType.contains(".")) screenFieldClass = ScreenModel.BASE_PACKAGE + componentType; else if (componentType.startsWith(".")) screenFieldClass = DBConstants.ROOT_PACKAGE + componentType.substring(1); else screenFieldClass = componentType; ScreenComponent screenField = (ScreenComponent)ClassServiceUtility.getClassService().makeObjectFromClassName(screenFieldClass); if (screenField == null) { Utility.getLogger().warning("Screen component not found " + componentType); screenField = (ScreenComponent)ClassServiceUtility.getClassService().makeObjectFromClassName(ScreenModel.BASE_PACKAGE + ScreenModel.EDIT_TEXT); } screenField.init(itsLocation, targetScreen, converter, iDisplayFieldDesc, properties); return screenField; }
[ "public", "static", "ScreenComponent", "createScreenComponent", "(", "String", "componentType", ",", "ScreenLoc", "itsLocation", ",", "ComponentParent", "targetScreen", ",", "Convert", "converter", ",", "int", "iDisplayFieldDesc", ",", "Map", "<", "String", ",", "Object", ">", "properties", ")", "{", "String", "screenFieldClass", "=", "null", ";", "if", "(", "!", "componentType", ".", "contains", "(", "\".\"", ")", ")", "screenFieldClass", "=", "ScreenModel", ".", "BASE_PACKAGE", "+", "componentType", ";", "else", "if", "(", "componentType", ".", "startsWith", "(", "\".\"", ")", ")", "screenFieldClass", "=", "DBConstants", ".", "ROOT_PACKAGE", "+", "componentType", ".", "substring", "(", "1", ")", ";", "else", "screenFieldClass", "=", "componentType", ";", "ScreenComponent", "screenField", "=", "(", "ScreenComponent", ")", "ClassServiceUtility", ".", "getClassService", "(", ")", ".", "makeObjectFromClassName", "(", "screenFieldClass", ")", ";", "if", "(", "screenField", "==", "null", ")", "{", "Utility", ".", "getLogger", "(", ")", ".", "warning", "(", "\"Screen component not found \"", "+", "componentType", ")", ";", "screenField", "=", "(", "ScreenComponent", ")", "ClassServiceUtility", ".", "getClassService", "(", ")", ".", "makeObjectFromClassName", "(", "ScreenModel", ".", "BASE_PACKAGE", "+", "ScreenModel", ".", "EDIT_TEXT", ")", ";", "}", "screenField", ".", "init", "(", "itsLocation", ",", "targetScreen", ",", "converter", ",", "iDisplayFieldDesc", ",", "properties", ")", ";", "return", "screenField", ";", "}" ]
Create a screen component of this type. @param componentType @param itsLocation @param targetScreen @param convert @param iDisplayFieldDesc @param properties @return
[ "Create", "a", "screen", "component", "of", "this", "type", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/BaseField.java#L1412-L1429
153,385
jbundle/jbundle
thin/base/screen/cal/other/src/main/java/org/jbundle/thin/base/screen/cal/opt/DateChangeTask.java
DateChangeTask.setStartDate
public void setStartDate(Date dateStart) { try { // NOTE: I ignore dateStart and use the date as it appears on the screen dateStart = m_productItem.getStartDate(); // Date as it appears on the screen Date timeNew = m_productItem.setRemoteStartDate(dateStart); if (!timeNew.equals(dateStart)) { Date timeEnd = m_productItem.getRemoteEndDate(); // ((TourLineItem)lineItem).getEndDate(); String strDescription = m_productItem.getRemoteDescription(); // lineItem.getItem().getDescription(); String[] rgstrMeals = m_productItem.getMealCache(timeNew, timeEnd); m_productItem.setCacheData(timeNew, timeEnd, strDescription, rgstrMeals); // Usually, you would have to update the data, but removing the icon in the next step will do this. } } catch (Exception ex) { ex.printStackTrace(); } try { Thread.sleep(2000); // Sleep for 2 seconds } catch (InterruptedException e) { } m_productItem.setStatus(m_productItem.getStatus() & ~(1 << 1)); }
java
public void setStartDate(Date dateStart) { try { // NOTE: I ignore dateStart and use the date as it appears on the screen dateStart = m_productItem.getStartDate(); // Date as it appears on the screen Date timeNew = m_productItem.setRemoteStartDate(dateStart); if (!timeNew.equals(dateStart)) { Date timeEnd = m_productItem.getRemoteEndDate(); // ((TourLineItem)lineItem).getEndDate(); String strDescription = m_productItem.getRemoteDescription(); // lineItem.getItem().getDescription(); String[] rgstrMeals = m_productItem.getMealCache(timeNew, timeEnd); m_productItem.setCacheData(timeNew, timeEnd, strDescription, rgstrMeals); // Usually, you would have to update the data, but removing the icon in the next step will do this. } } catch (Exception ex) { ex.printStackTrace(); } try { Thread.sleep(2000); // Sleep for 2 seconds } catch (InterruptedException e) { } m_productItem.setStatus(m_productItem.getStatus() & ~(1 << 1)); }
[ "public", "void", "setStartDate", "(", "Date", "dateStart", ")", "{", "try", "{", "// NOTE: I ignore dateStart and use the date as it appears on the screen", "dateStart", "=", "m_productItem", ".", "getStartDate", "(", ")", ";", "// Date as it appears on the screen", "Date", "timeNew", "=", "m_productItem", ".", "setRemoteStartDate", "(", "dateStart", ")", ";", "if", "(", "!", "timeNew", ".", "equals", "(", "dateStart", ")", ")", "{", "Date", "timeEnd", "=", "m_productItem", ".", "getRemoteEndDate", "(", ")", ";", "// ((TourLineItem)lineItem).getEndDate();", "String", "strDescription", "=", "m_productItem", ".", "getRemoteDescription", "(", ")", ";", "// lineItem.getItem().getDescription();", "String", "[", "]", "rgstrMeals", "=", "m_productItem", ".", "getMealCache", "(", "timeNew", ",", "timeEnd", ")", ";", "m_productItem", ".", "setCacheData", "(", "timeNew", ",", "timeEnd", ",", "strDescription", ",", "rgstrMeals", ")", ";", "// Usually, you would have to update the data, but removing the icon in the next step will do this.", "}", "}", "catch", "(", "Exception", "ex", ")", "{", "ex", ".", "printStackTrace", "(", ")", ";", "}", "try", "{", "Thread", ".", "sleep", "(", "2000", ")", ";", "// Sleep for 2 seconds", "}", "catch", "(", "InterruptedException", "e", ")", "{", "}", "m_productItem", ".", "setStatus", "(", "m_productItem", ".", "getStatus", "(", ")", "&", "~", "(", "1", "<<", "1", ")", ")", ";", "}" ]
Set the new start date for the remote item.
[ "Set", "the", "new", "start", "date", "for", "the", "remote", "item", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/cal/other/src/main/java/org/jbundle/thin/base/screen/cal/opt/DateChangeTask.java#L56-L79
153,386
jbundle/jbundle
thin/base/screen/cal/other/src/main/java/org/jbundle/thin/base/screen/cal/opt/DateChangeTask.java
DateChangeTask.setEndDate
public void setEndDate(Date dateEnd) { try { dateEnd = m_productItem.getEndDate(); // Date as it appears on the screen Date timeNew = m_productItem.setRemoteEndDate(dateEnd); if (!timeNew.equals(dateEnd)) { Date dateStart = m_productItem.getStartDate(); String[] rgstrMeals = m_productItem.getMealCache(dateStart, dateEnd); m_productItem.setCacheData(null, timeNew, null, rgstrMeals); // Usually, you would have to update the data, but removing the icon in the next step will do this. } } catch (Exception ex) { ex.printStackTrace(); } try { Thread.sleep(2000); // Sleep for 2 seconds } catch (InterruptedException e) { } m_productItem.setStatus(m_productItem.getStatus() & ~(1 << 1)); }
java
public void setEndDate(Date dateEnd) { try { dateEnd = m_productItem.getEndDate(); // Date as it appears on the screen Date timeNew = m_productItem.setRemoteEndDate(dateEnd); if (!timeNew.equals(dateEnd)) { Date dateStart = m_productItem.getStartDate(); String[] rgstrMeals = m_productItem.getMealCache(dateStart, dateEnd); m_productItem.setCacheData(null, timeNew, null, rgstrMeals); // Usually, you would have to update the data, but removing the icon in the next step will do this. } } catch (Exception ex) { ex.printStackTrace(); } try { Thread.sleep(2000); // Sleep for 2 seconds } catch (InterruptedException e) { } m_productItem.setStatus(m_productItem.getStatus() & ~(1 << 1)); }
[ "public", "void", "setEndDate", "(", "Date", "dateEnd", ")", "{", "try", "{", "dateEnd", "=", "m_productItem", ".", "getEndDate", "(", ")", ";", "// Date as it appears on the screen", "Date", "timeNew", "=", "m_productItem", ".", "setRemoteEndDate", "(", "dateEnd", ")", ";", "if", "(", "!", "timeNew", ".", "equals", "(", "dateEnd", ")", ")", "{", "Date", "dateStart", "=", "m_productItem", ".", "getStartDate", "(", ")", ";", "String", "[", "]", "rgstrMeals", "=", "m_productItem", ".", "getMealCache", "(", "dateStart", ",", "dateEnd", ")", ";", "m_productItem", ".", "setCacheData", "(", "null", ",", "timeNew", ",", "null", ",", "rgstrMeals", ")", ";", "// Usually, you would have to update the data, but removing the icon in the next step will do this.", "}", "}", "catch", "(", "Exception", "ex", ")", "{", "ex", ".", "printStackTrace", "(", ")", ";", "}", "try", "{", "Thread", ".", "sleep", "(", "2000", ")", ";", "// Sleep for 2 seconds", "}", "catch", "(", "InterruptedException", "e", ")", "{", "}", "m_productItem", ".", "setStatus", "(", "m_productItem", ".", "getStatus", "(", ")", "&", "~", "(", "1", "<<", "1", ")", ")", ";", "}" ]
Set the new end date for the remote item.
[ "Set", "the", "new", "end", "date", "for", "the", "remote", "item", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/cal/other/src/main/java/org/jbundle/thin/base/screen/cal/opt/DateChangeTask.java#L83-L104
153,387
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/db/shared/SharedFileHandler.java
SharedFileHandler.doNewRecord
public void doNewRecord(boolean bDisplayOption) { super.doNewRecord(bDisplayOption); BaseField fldTarget = null; if (typeFieldName != null) fldTarget = this.getOwner().getField(typeFieldName); else fldTarget = this.getOwner().getField(m_iTypeField); boolean[] rgbEnabled = fldTarget.setEnableListeners(false); InitOnceFieldHandler listener = (InitOnceFieldHandler)fldTarget.getListener(InitOnceFieldHandler.class.getName()); if (listener != null) listener.setFirstTime(true); // Special case - you shouldn't have put this listener here, but since you did... fldTarget.setValue(m_iTargetValue, DBConstants.DISPLAY, DBConstants.INIT_MOVE); fldTarget.setModified(false); fldTarget.setEnableListeners(rgbEnabled); }
java
public void doNewRecord(boolean bDisplayOption) { super.doNewRecord(bDisplayOption); BaseField fldTarget = null; if (typeFieldName != null) fldTarget = this.getOwner().getField(typeFieldName); else fldTarget = this.getOwner().getField(m_iTypeField); boolean[] rgbEnabled = fldTarget.setEnableListeners(false); InitOnceFieldHandler listener = (InitOnceFieldHandler)fldTarget.getListener(InitOnceFieldHandler.class.getName()); if (listener != null) listener.setFirstTime(true); // Special case - you shouldn't have put this listener here, but since you did... fldTarget.setValue(m_iTargetValue, DBConstants.DISPLAY, DBConstants.INIT_MOVE); fldTarget.setModified(false); fldTarget.setEnableListeners(rgbEnabled); }
[ "public", "void", "doNewRecord", "(", "boolean", "bDisplayOption", ")", "{", "super", ".", "doNewRecord", "(", "bDisplayOption", ")", ";", "BaseField", "fldTarget", "=", "null", ";", "if", "(", "typeFieldName", "!=", "null", ")", "fldTarget", "=", "this", ".", "getOwner", "(", ")", ".", "getField", "(", "typeFieldName", ")", ";", "else", "fldTarget", "=", "this", ".", "getOwner", "(", ")", ".", "getField", "(", "m_iTypeField", ")", ";", "boolean", "[", "]", "rgbEnabled", "=", "fldTarget", ".", "setEnableListeners", "(", "false", ")", ";", "InitOnceFieldHandler", "listener", "=", "(", "InitOnceFieldHandler", ")", "fldTarget", ".", "getListener", "(", "InitOnceFieldHandler", ".", "class", ".", "getName", "(", ")", ")", ";", "if", "(", "listener", "!=", "null", ")", "listener", ".", "setFirstTime", "(", "true", ")", ";", "// Special case - you shouldn't have put this listener here, but since you did...", "fldTarget", ".", "setValue", "(", "m_iTargetValue", ",", "DBConstants", ".", "DISPLAY", ",", "DBConstants", ".", "INIT_MOVE", ")", ";", "fldTarget", ".", "setModified", "(", "false", ")", ";", "fldTarget", ".", "setEnableListeners", "(", "rgbEnabled", ")", ";", "}" ]
DoNewRecord Method.
[ "DoNewRecord", "Method", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/shared/SharedFileHandler.java#L78-L93
153,388
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/db/shared/SharedFileHandler.java
SharedFileHandler.doRemoteCriteria
public boolean doRemoteCriteria(StringBuffer strbFilter, boolean bIncludeFileName, Vector<BaseField> vParamList) { BaseField fldTarget = null; if (typeFieldName != null) fldTarget = this.getOwner().getField(typeFieldName); else fldTarget = this.getOwner().getField(m_iTypeField); String strToCompare = Integer.toString(m_iTargetValue); boolean bDontSkip = this.fieldCompare(fldTarget, strToCompare, DBConstants.EQUALS, strbFilter, bIncludeFileName, vParamList); if (strbFilter != null) bDontSkip = true; // Don't need to compare, if I'm creating a filter to pass to SQL if (bDontSkip) return super.doRemoteCriteria(strbFilter, bIncludeFileName, vParamList); // Dont skip this record else return false; // Skip this one }
java
public boolean doRemoteCriteria(StringBuffer strbFilter, boolean bIncludeFileName, Vector<BaseField> vParamList) { BaseField fldTarget = null; if (typeFieldName != null) fldTarget = this.getOwner().getField(typeFieldName); else fldTarget = this.getOwner().getField(m_iTypeField); String strToCompare = Integer.toString(m_iTargetValue); boolean bDontSkip = this.fieldCompare(fldTarget, strToCompare, DBConstants.EQUALS, strbFilter, bIncludeFileName, vParamList); if (strbFilter != null) bDontSkip = true; // Don't need to compare, if I'm creating a filter to pass to SQL if (bDontSkip) return super.doRemoteCriteria(strbFilter, bIncludeFileName, vParamList); // Dont skip this record else return false; // Skip this one }
[ "public", "boolean", "doRemoteCriteria", "(", "StringBuffer", "strbFilter", ",", "boolean", "bIncludeFileName", ",", "Vector", "<", "BaseField", ">", "vParamList", ")", "{", "BaseField", "fldTarget", "=", "null", ";", "if", "(", "typeFieldName", "!=", "null", ")", "fldTarget", "=", "this", ".", "getOwner", "(", ")", ".", "getField", "(", "typeFieldName", ")", ";", "else", "fldTarget", "=", "this", ".", "getOwner", "(", ")", ".", "getField", "(", "m_iTypeField", ")", ";", "String", "strToCompare", "=", "Integer", ".", "toString", "(", "m_iTargetValue", ")", ";", "boolean", "bDontSkip", "=", "this", ".", "fieldCompare", "(", "fldTarget", ",", "strToCompare", ",", "DBConstants", ".", "EQUALS", ",", "strbFilter", ",", "bIncludeFileName", ",", "vParamList", ")", ";", "if", "(", "strbFilter", "!=", "null", ")", "bDontSkip", "=", "true", ";", "// Don't need to compare, if I'm creating a filter to pass to SQL ", "if", "(", "bDontSkip", ")", "return", "super", ".", "doRemoteCriteria", "(", "strbFilter", ",", "bIncludeFileName", ",", "vParamList", ")", ";", "// Dont skip this record", "else", "return", "false", ";", "// Skip this one", "}" ]
Add the criteria to the SQL string.
[ "Add", "the", "criteria", "to", "the", "SQL", "string", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/shared/SharedFileHandler.java#L104-L119
153,389
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/db/shared/SharedFileHandler.java
SharedFileHandler.initRemoteStub
public void initRemoteStub(ObjectOutputStream daOut) { try { daOut.writeInt(m_iTypeField); daOut.writeUTF(typeFieldName); daOut.writeInt(m_iTargetValue); } catch (IOException ex) { ex.printStackTrace(); } }
java
public void initRemoteStub(ObjectOutputStream daOut) { try { daOut.writeInt(m_iTypeField); daOut.writeUTF(typeFieldName); daOut.writeInt(m_iTargetValue); } catch (IOException ex) { ex.printStackTrace(); } }
[ "public", "void", "initRemoteStub", "(", "ObjectOutputStream", "daOut", ")", "{", "try", "{", "daOut", ".", "writeInt", "(", "m_iTypeField", ")", ";", "daOut", ".", "writeUTF", "(", "typeFieldName", ")", ";", "daOut", ".", "writeInt", "(", "m_iTargetValue", ")", ";", "}", "catch", "(", "IOException", "ex", ")", "{", "ex", ".", "printStackTrace", "(", ")", ";", "}", "}" ]
InitRemoteStub Method.
[ "InitRemoteStub", "Method", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/shared/SharedFileHandler.java#L123-L132
153,390
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/db/shared/SharedFileHandler.java
SharedFileHandler.initRemoteSkel
public void initRemoteSkel(ObjectInputStream daIn) { try { int iTypeField = daIn.readInt(); String typeFieldName = daIn.readUTF(); int iTargetValue = daIn.readInt(); this.init(iTypeField, typeFieldName, iTargetValue); } catch (IOException ex) { ex.printStackTrace(); } }
java
public void initRemoteSkel(ObjectInputStream daIn) { try { int iTypeField = daIn.readInt(); String typeFieldName = daIn.readUTF(); int iTargetValue = daIn.readInt(); this.init(iTypeField, typeFieldName, iTargetValue); } catch (IOException ex) { ex.printStackTrace(); } }
[ "public", "void", "initRemoteSkel", "(", "ObjectInputStream", "daIn", ")", "{", "try", "{", "int", "iTypeField", "=", "daIn", ".", "readInt", "(", ")", ";", "String", "typeFieldName", "=", "daIn", ".", "readUTF", "(", ")", ";", "int", "iTargetValue", "=", "daIn", ".", "readInt", "(", ")", ";", "this", ".", "init", "(", "iTypeField", ",", "typeFieldName", ",", "iTargetValue", ")", ";", "}", "catch", "(", "IOException", "ex", ")", "{", "ex", ".", "printStackTrace", "(", ")", ";", "}", "}" ]
InitRemoteSkel Method.
[ "InitRemoteSkel", "Method", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/shared/SharedFileHandler.java#L136-L147
153,391
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/message/process/TrxMessageListener.java
TrxMessageListener.handleMessage
public int handleMessage(BaseMessage message) { String strClassName = this.getMessageProcessorClassName(message); if ((strClassName == null) || (strClassName.length() == 0)) return this.handleOtherMessage(message); message.consume(); // I'll be handling this one. String strParams = Utility.addURLParam(null, DBParams.PROCESS, strClassName); App application = m_application; if (message.getProcessedByClientSession() instanceof RemoteTask) if (message.getProcessedByClientSession() instanceof Task) // Always application = ((Task)message.getProcessedByClientSession()).getApplication(); // If I have the task session, run this task under the same app MessageProcessRunnerTask task = new MessageProcessRunnerTask(application, strParams, null); task.setMessage(message); m_application.getTaskScheduler().addTask(task); return DBConstants.NORMAL_RETURN; // No need to call super. }
java
public int handleMessage(BaseMessage message) { String strClassName = this.getMessageProcessorClassName(message); if ((strClassName == null) || (strClassName.length() == 0)) return this.handleOtherMessage(message); message.consume(); // I'll be handling this one. String strParams = Utility.addURLParam(null, DBParams.PROCESS, strClassName); App application = m_application; if (message.getProcessedByClientSession() instanceof RemoteTask) if (message.getProcessedByClientSession() instanceof Task) // Always application = ((Task)message.getProcessedByClientSession()).getApplication(); // If I have the task session, run this task under the same app MessageProcessRunnerTask task = new MessageProcessRunnerTask(application, strParams, null); task.setMessage(message); m_application.getTaskScheduler().addTask(task); return DBConstants.NORMAL_RETURN; // No need to call super. }
[ "public", "int", "handleMessage", "(", "BaseMessage", "message", ")", "{", "String", "strClassName", "=", "this", ".", "getMessageProcessorClassName", "(", "message", ")", ";", "if", "(", "(", "strClassName", "==", "null", ")", "||", "(", "strClassName", ".", "length", "(", ")", "==", "0", ")", ")", "return", "this", ".", "handleOtherMessage", "(", "message", ")", ";", "message", ".", "consume", "(", ")", ";", "// I'll be handling this one.", "String", "strParams", "=", "Utility", ".", "addURLParam", "(", "null", ",", "DBParams", ".", "PROCESS", ",", "strClassName", ")", ";", "App", "application", "=", "m_application", ";", "if", "(", "message", ".", "getProcessedByClientSession", "(", ")", "instanceof", "RemoteTask", ")", "if", "(", "message", ".", "getProcessedByClientSession", "(", ")", "instanceof", "Task", ")", "// Always", "application", "=", "(", "(", "Task", ")", "message", ".", "getProcessedByClientSession", "(", ")", ")", ".", "getApplication", "(", ")", ";", "// If I have the task session, run this task under the same app", "MessageProcessRunnerTask", "task", "=", "new", "MessageProcessRunnerTask", "(", "application", ",", "strParams", ",", "null", ")", ";", "task", ".", "setMessage", "(", "message", ")", ";", "m_application", ".", "getTaskScheduler", "(", ")", ".", "addTask", "(", "task", ")", ";", "return", "DBConstants", ".", "NORMAL_RETURN", ";", "// No need to call super.", "}" ]
Handle this message. Get the name of this process and run it.
[ "Handle", "this", "message", ".", "Get", "the", "name", "of", "this", "process", "and", "run", "it", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/message/process/TrxMessageListener.java#L97-L112
153,392
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/message/process/TrxMessageListener.java
TrxMessageListener.getMessageProcessorClassName
public String getMessageProcessorClassName(BaseMessage message) { String strClass = (String)message.getMessageHeader().get(DBParams.PROCESS); if ((strClass == null) || (strClass.length() == 0)) { String strMessageCode = (String)message.getMessageHeader().get(BaseMessageHeader.MESSAGE_CODE); if ((strMessageCode == null) || (strMessageCode.length() == 0)) strMessageCode = (String)message.get(BaseMessageHeader.MESSAGE_CODE); if (strMessageCode != null) if (strMessageCode.length() > 0) if (message instanceof BaseMessage) { MessageProcessInfoModel recMessageProcessInfo = (MessageProcessInfoModel)Record.makeRecordFromClassName(MessageProcessInfoModel.THICK_CLASS, (RecordOwner)m_application.getSystemRecordOwner()); // todo(don) Not the most efficent sharing! Note: Remember the import recMessageProcessInfo.setupMessageHeaderFromCode((BaseMessage)message, strMessageCode, null); recMessageProcessInfo.free(); strClass = (String)message.getMessageHeader().get(DBParams.PROCESS); } } String strPackage = (String)message.getMessageHeader().get(BaseMessageHeader.BASE_PACKAGE); if (strPackage != null) if (strPackage.length() > 0) if (strPackage.charAt(strPackage.length() - 1) != '.') strPackage = strPackage + '.'; if ((strClass == null) || (strClass.length() == 0)) strClass = m_strProcessClassName; if (strClass != null) if (strClass.length() > 0) { if (strClass.indexOf('.') == -1) if (strPackage != null) strClass = strPackage + strClass; if (strClass.charAt(0) == '.') strClass = DBConstants.ROOT_PACKAGE + strClass.substring(1); } return strClass; }
java
public String getMessageProcessorClassName(BaseMessage message) { String strClass = (String)message.getMessageHeader().get(DBParams.PROCESS); if ((strClass == null) || (strClass.length() == 0)) { String strMessageCode = (String)message.getMessageHeader().get(BaseMessageHeader.MESSAGE_CODE); if ((strMessageCode == null) || (strMessageCode.length() == 0)) strMessageCode = (String)message.get(BaseMessageHeader.MESSAGE_CODE); if (strMessageCode != null) if (strMessageCode.length() > 0) if (message instanceof BaseMessage) { MessageProcessInfoModel recMessageProcessInfo = (MessageProcessInfoModel)Record.makeRecordFromClassName(MessageProcessInfoModel.THICK_CLASS, (RecordOwner)m_application.getSystemRecordOwner()); // todo(don) Not the most efficent sharing! Note: Remember the import recMessageProcessInfo.setupMessageHeaderFromCode((BaseMessage)message, strMessageCode, null); recMessageProcessInfo.free(); strClass = (String)message.getMessageHeader().get(DBParams.PROCESS); } } String strPackage = (String)message.getMessageHeader().get(BaseMessageHeader.BASE_PACKAGE); if (strPackage != null) if (strPackage.length() > 0) if (strPackage.charAt(strPackage.length() - 1) != '.') strPackage = strPackage + '.'; if ((strClass == null) || (strClass.length() == 0)) strClass = m_strProcessClassName; if (strClass != null) if (strClass.length() > 0) { if (strClass.indexOf('.') == -1) if (strPackage != null) strClass = strPackage + strClass; if (strClass.charAt(0) == '.') strClass = DBConstants.ROOT_PACKAGE + strClass.substring(1); } return strClass; }
[ "public", "String", "getMessageProcessorClassName", "(", "BaseMessage", "message", ")", "{", "String", "strClass", "=", "(", "String", ")", "message", ".", "getMessageHeader", "(", ")", ".", "get", "(", "DBParams", ".", "PROCESS", ")", ";", "if", "(", "(", "strClass", "==", "null", ")", "||", "(", "strClass", ".", "length", "(", ")", "==", "0", ")", ")", "{", "String", "strMessageCode", "=", "(", "String", ")", "message", ".", "getMessageHeader", "(", ")", ".", "get", "(", "BaseMessageHeader", ".", "MESSAGE_CODE", ")", ";", "if", "(", "(", "strMessageCode", "==", "null", ")", "||", "(", "strMessageCode", ".", "length", "(", ")", "==", "0", ")", ")", "strMessageCode", "=", "(", "String", ")", "message", ".", "get", "(", "BaseMessageHeader", ".", "MESSAGE_CODE", ")", ";", "if", "(", "strMessageCode", "!=", "null", ")", "if", "(", "strMessageCode", ".", "length", "(", ")", ">", "0", ")", "if", "(", "message", "instanceof", "BaseMessage", ")", "{", "MessageProcessInfoModel", "recMessageProcessInfo", "=", "(", "MessageProcessInfoModel", ")", "Record", ".", "makeRecordFromClassName", "(", "MessageProcessInfoModel", ".", "THICK_CLASS", ",", "(", "RecordOwner", ")", "m_application", ".", "getSystemRecordOwner", "(", ")", ")", ";", "// todo(don) Not the most efficent sharing! Note: Remember the import", "recMessageProcessInfo", ".", "setupMessageHeaderFromCode", "(", "(", "BaseMessage", ")", "message", ",", "strMessageCode", ",", "null", ")", ";", "recMessageProcessInfo", ".", "free", "(", ")", ";", "strClass", "=", "(", "String", ")", "message", ".", "getMessageHeader", "(", ")", ".", "get", "(", "DBParams", ".", "PROCESS", ")", ";", "}", "}", "String", "strPackage", "=", "(", "String", ")", "message", ".", "getMessageHeader", "(", ")", ".", "get", "(", "BaseMessageHeader", ".", "BASE_PACKAGE", ")", ";", "if", "(", "strPackage", "!=", "null", ")", "if", "(", "strPackage", ".", "length", "(", ")", ">", "0", ")", "if", "(", "strPackage", ".", "charAt", "(", "strPackage", ".", "length", "(", ")", "-", "1", ")", "!=", "'", "'", ")", "strPackage", "=", "strPackage", "+", "'", "'", ";", "if", "(", "(", "strClass", "==", "null", ")", "||", "(", "strClass", ".", "length", "(", ")", "==", "0", ")", ")", "strClass", "=", "m_strProcessClassName", ";", "if", "(", "strClass", "!=", "null", ")", "if", "(", "strClass", ".", "length", "(", ")", ">", "0", ")", "{", "if", "(", "strClass", ".", "indexOf", "(", "'", "'", ")", "==", "-", "1", ")", "if", "(", "strPackage", "!=", "null", ")", "strClass", "=", "strPackage", "+", "strClass", ";", "if", "(", "strClass", ".", "charAt", "(", "0", ")", "==", "'", "'", ")", "strClass", "=", "DBConstants", ".", "ROOT_PACKAGE", "+", "strClass", ".", "substring", "(", "1", ")", ";", "}", "return", "strClass", ";", "}" ]
Get the message processor class name. @return The message processor task name.
[ "Get", "the", "message", "processor", "class", "name", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/message/process/TrxMessageListener.java#L117-L154
153,393
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/db/filter/DependentFileFilter.java
DependentFileFilter.setOwner
public void setOwner(ListenerOwner owner) { super.setOwner(owner); if (owner == null) return; if (m_fldThisFile == null) if (thisFileFieldName != null) m_fldThisFile = this.getOwner().getField(thisFileFieldName); if (m_fldThisFile2 == null) if (thisFileFieldName2 != null) m_fldThisFile2 = this.getOwner().getField(thisFileFieldName2); if (m_fldThisFile3 == null) if (thisFileFieldName3 != null) m_fldThisFile3 = this.getOwner().getField(thisFileFieldName3); //? if (m_fldThisFile != null) //? m_fldThisFile.saveEnableListeners(false); // Don't let behaviors mess with my values. //? if (m_fldThisFile2 != null) //? m_fldThisFile2.saveEnableListeners(false); // Note: This is because of a conflict with. //? if (m_fldThisFile3 != null) //? m_fldThisFile3.saveEnableListeners(false); // InitOnceFieldHandler, the value is only set once. //x this.setMainKey(true, null); // Initialize the keys }
java
public void setOwner(ListenerOwner owner) { super.setOwner(owner); if (owner == null) return; if (m_fldThisFile == null) if (thisFileFieldName != null) m_fldThisFile = this.getOwner().getField(thisFileFieldName); if (m_fldThisFile2 == null) if (thisFileFieldName2 != null) m_fldThisFile2 = this.getOwner().getField(thisFileFieldName2); if (m_fldThisFile3 == null) if (thisFileFieldName3 != null) m_fldThisFile3 = this.getOwner().getField(thisFileFieldName3); //? if (m_fldThisFile != null) //? m_fldThisFile.saveEnableListeners(false); // Don't let behaviors mess with my values. //? if (m_fldThisFile2 != null) //? m_fldThisFile2.saveEnableListeners(false); // Note: This is because of a conflict with. //? if (m_fldThisFile3 != null) //? m_fldThisFile3.saveEnableListeners(false); // InitOnceFieldHandler, the value is only set once. //x this.setMainKey(true, null); // Initialize the keys }
[ "public", "void", "setOwner", "(", "ListenerOwner", "owner", ")", "{", "super", ".", "setOwner", "(", "owner", ")", ";", "if", "(", "owner", "==", "null", ")", "return", ";", "if", "(", "m_fldThisFile", "==", "null", ")", "if", "(", "thisFileFieldName", "!=", "null", ")", "m_fldThisFile", "=", "this", ".", "getOwner", "(", ")", ".", "getField", "(", "thisFileFieldName", ")", ";", "if", "(", "m_fldThisFile2", "==", "null", ")", "if", "(", "thisFileFieldName2", "!=", "null", ")", "m_fldThisFile2", "=", "this", ".", "getOwner", "(", ")", ".", "getField", "(", "thisFileFieldName2", ")", ";", "if", "(", "m_fldThisFile3", "==", "null", ")", "if", "(", "thisFileFieldName3", "!=", "null", ")", "m_fldThisFile3", "=", "this", ".", "getOwner", "(", ")", ".", "getField", "(", "thisFileFieldName3", ")", ";", "//? if (m_fldThisFile != null)", "//? m_fldThisFile.saveEnableListeners(false); // Don't let behaviors mess with my values.", "//? if (m_fldThisFile2 != null)", "//? m_fldThisFile2.saveEnableListeners(false); // Note: This is because of a conflict with.", "//? if (m_fldThisFile3 != null)", "//? m_fldThisFile3.saveEnableListeners(false); // InitOnceFieldHandler, the value is only set once.", "//x this.setMainKey(true, null); // Initialize the keys", "}" ]
Set the record that owns this listener. This method looks up up all the fields in the record. @param owner My owner.
[ "Set", "the", "record", "that", "owns", "this", "listener", ".", "This", "method", "looks", "up", "up", "all", "the", "fields", "in", "the", "record", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/filter/DependentFileFilter.java#L85-L106
153,394
lunisolar/magma
magma-basics-assert/src/main/java/eu/lunisolar/magma/basics/asserts/Evaluation.java
Evaluation.toEqualTo
public CTX toEqualTo(R equalsTo) { to(rs -> rs.isEqualTo(equalsTo)); return context.self(); }
java
public CTX toEqualTo(R equalsTo) { to(rs -> rs.isEqualTo(equalsTo)); return context.self(); }
[ "public", "CTX", "toEqualTo", "(", "R", "equalsTo", ")", "{", "to", "(", "rs", "->", "rs", ".", "isEqualTo", "(", "equalsTo", ")", ")", ";", "return", "context", ".", "self", "(", ")", ";", "}" ]
Convenient method to just check equality
[ "Convenient", "method", "to", "just", "check", "equality" ]
83809c6d1a33d913aec6c49920251e4f0be8b213
https://github.com/lunisolar/magma/blob/83809c6d1a33d913aec6c49920251e4f0be8b213/magma-basics-assert/src/main/java/eu/lunisolar/magma/basics/asserts/Evaluation.java#L58-L61
153,395
tvesalainen/hoski-lib
src/main/java/fi/hoski/datastore/repository/Event.java
Event.getEventType
public static EventType getEventType(Key key) { Key ek = findAncestor(Repository.EVENTTYPE, key); return EventType.values()[(int)ek.getId()-1]; }
java
public static EventType getEventType(Key key) { Key ek = findAncestor(Repository.EVENTTYPE, key); return EventType.values()[(int)ek.getId()-1]; }
[ "public", "static", "EventType", "getEventType", "(", "Key", "key", ")", "{", "Key", "ek", "=", "findAncestor", "(", "Repository", ".", "EVENTTYPE", ",", "key", ")", ";", "return", "EventType", ".", "values", "(", ")", "[", "(", "int", ")", "ek", ".", "getId", "(", ")", "-", "1", "]", ";", "}" ]
Returns current EventType from EventType, Event or Reservation keys @param key @return
[ "Returns", "current", "EventType", "from", "EventType", "Event", "or", "Reservation", "keys" ]
9b5bab44113e0adb74bf1ee436013e8a7c608d00
https://github.com/tvesalainen/hoski-lib/blob/9b5bab44113e0adb74bf1ee436013e8a7c608d00/src/main/java/fi/hoski/datastore/repository/Event.java#L129-L133
153,396
tvesalainen/hoski-lib
src/main/java/fi/hoski/datastore/repository/Event.java
Event.getEventDate
public static Date getEventDate(Key key) { Key ek = findAncestor(Repository.EVENT, key); return new Date(ek.getId()); }
java
public static Date getEventDate(Key key) { Key ek = findAncestor(Repository.EVENT, key); return new Date(ek.getId()); }
[ "public", "static", "Date", "getEventDate", "(", "Key", "key", ")", "{", "Key", "ek", "=", "findAncestor", "(", "Repository", ".", "EVENT", ",", "key", ")", ";", "return", "new", "Date", "(", "ek", ".", "getId", "(", ")", ")", ";", "}" ]
Returns current Event Date from Event or Reservation keys @param key @return
[ "Returns", "current", "Event", "Date", "from", "Event", "or", "Reservation", "keys" ]
9b5bab44113e0adb74bf1ee436013e8a7c608d00
https://github.com/tvesalainen/hoski-lib/blob/9b5bab44113e0adb74bf1ee436013e8a7c608d00/src/main/java/fi/hoski/datastore/repository/Event.java#L139-L143
153,397
elbkind/osgi
reporting/api/src/main/java/eu/elbkind/osgi/reporting/api/ReportFormatter.java
ReportFormatter.format
public void format(PrintStream out, String[] headers, String[]... rows) { int[] columnWidth = computeEachColumnWidth(this.defaultColumnWidth, headers, rows); printRow(out, columnWidth, headers); printTableSeperatir(out, headers, columnWidth); for (String[] row : rows) { printRow(out, columnWidth, row); } }
java
public void format(PrintStream out, String[] headers, String[]... rows) { int[] columnWidth = computeEachColumnWidth(this.defaultColumnWidth, headers, rows); printRow(out, columnWidth, headers); printTableSeperatir(out, headers, columnWidth); for (String[] row : rows) { printRow(out, columnWidth, row); } }
[ "public", "void", "format", "(", "PrintStream", "out", ",", "String", "[", "]", "headers", ",", "String", "[", "]", "...", "rows", ")", "{", "int", "[", "]", "columnWidth", "=", "computeEachColumnWidth", "(", "this", ".", "defaultColumnWidth", ",", "headers", ",", "rows", ")", ";", "printRow", "(", "out", ",", "columnWidth", ",", "headers", ")", ";", "printTableSeperatir", "(", "out", ",", "headers", ",", "columnWidth", ")", ";", "for", "(", "String", "[", "]", "row", ":", "rows", ")", "{", "printRow", "(", "out", ",", "columnWidth", ",", "row", ")", ";", "}", "}" ]
Prints a table @param out PrintStream to write to, not null @param headers Array of not null values @param rows Array of not null values, row length must always be headers length
[ "Prints", "a", "table" ]
206fdcb4587556c289d3cee54ef36c7f1ed93920
https://github.com/elbkind/osgi/blob/206fdcb4587556c289d3cee54ef36c7f1ed93920/reporting/api/src/main/java/eu/elbkind/osgi/reporting/api/ReportFormatter.java#L52-L61
153,398
eostermueller/headlessInTraceClient
src/main/java/org/headlessintrace/client/connection/HostPort.java
HostPort.isIpv4
public static boolean isIpv4(String hostName) { int periodCount = 0; int numberCount = 0; int lowerCount = 0; int upperCount = 0; int otherCount = 0; for(int i = 0; i < hostName.length(); i++ ) { char myChar = hostName.charAt(i); if (myChar=='.') { periodCount++; } else if (myChar >= '0' && myChar <= '9') { numberCount++; } else if (myChar >= 'a' & myChar <= 'z') { lowerCount++; } else if (myChar >= 'A' & myChar <= 'Z') { upperCount++; } else { otherCount++; } } if (periodCount==3 && numberCount >= 4 && lowerCount==0 && upperCount==0 && otherCount==0) { return true; } else { return false; } }
java
public static boolean isIpv4(String hostName) { int periodCount = 0; int numberCount = 0; int lowerCount = 0; int upperCount = 0; int otherCount = 0; for(int i = 0; i < hostName.length(); i++ ) { char myChar = hostName.charAt(i); if (myChar=='.') { periodCount++; } else if (myChar >= '0' && myChar <= '9') { numberCount++; } else if (myChar >= 'a' & myChar <= 'z') { lowerCount++; } else if (myChar >= 'A' & myChar <= 'Z') { upperCount++; } else { otherCount++; } } if (periodCount==3 && numberCount >= 4 && lowerCount==0 && upperCount==0 && otherCount==0) { return true; } else { return false; } }
[ "public", "static", "boolean", "isIpv4", "(", "String", "hostName", ")", "{", "int", "periodCount", "=", "0", ";", "int", "numberCount", "=", "0", ";", "int", "lowerCount", "=", "0", ";", "int", "upperCount", "=", "0", ";", "int", "otherCount", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "hostName", ".", "length", "(", ")", ";", "i", "++", ")", "{", "char", "myChar", "=", "hostName", ".", "charAt", "(", "i", ")", ";", "if", "(", "myChar", "==", "'", "'", ")", "{", "periodCount", "++", ";", "}", "else", "if", "(", "myChar", ">=", "'", "'", "&&", "myChar", "<=", "'", "'", ")", "{", "numberCount", "++", ";", "}", "else", "if", "(", "myChar", ">=", "'", "'", "&", "myChar", "<=", "'", "'", ")", "{", "lowerCount", "++", ";", "}", "else", "if", "(", "myChar", ">=", "'", "'", "&", "myChar", "<=", "'", "'", ")", "{", "upperCount", "++", ";", "}", "else", "{", "otherCount", "++", ";", "}", "}", "if", "(", "periodCount", "==", "3", "&&", "numberCount", ">=", "4", "&&", "lowerCount", "==", "0", "&&", "upperCount", "==", "0", "&&", "otherCount", "==", "0", ")", "{", "return", "true", ";", "}", "else", "{", "return", "false", ";", "}", "}" ]
Return true of the string is an IP address instead of a hostname. No, this is not a perfect algorithm, but is is close enough. If no number @param hostName @return
[ "Return", "true", "of", "the", "string", "is", "an", "IP", "address", "instead", "of", "a", "hostname", ".", "No", "this", "is", "not", "a", "perfect", "algorithm", "but", "is", "is", "close", "enough", ".", "If", "no", "number" ]
50b1dccc5ff9e342c7c1d06b5a382e8c0afc7604
https://github.com/eostermueller/headlessInTraceClient/blob/50b1dccc5ff9e342c7c1d06b5a382e8c0afc7604/src/main/java/org/headlessintrace/client/connection/HostPort.java#L28-L55
153,399
jbundle/jbundle
thin/base/message/src/main/java/org/jbundle/thin/base/message/BaseMessageRecordDesc.java
BaseMessageRecordDesc.addMessageFieldDesc
public MessageFieldDesc addMessageFieldDesc(String strParam, Class<?> classRawObject, boolean bRequired, Object objRawDefault) { return new MessageFieldDesc(this, strParam, classRawObject, bRequired, objRawDefault); }
java
public MessageFieldDesc addMessageFieldDesc(String strParam, Class<?> classRawObject, boolean bRequired, Object objRawDefault) { return new MessageFieldDesc(this, strParam, classRawObject, bRequired, objRawDefault); }
[ "public", "MessageFieldDesc", "addMessageFieldDesc", "(", "String", "strParam", ",", "Class", "<", "?", ">", "classRawObject", ",", "boolean", "bRequired", ",", "Object", "objRawDefault", ")", "{", "return", "new", "MessageFieldDesc", "(", "this", ",", "strParam", ",", "classRawObject", ",", "bRequired", ",", "objRawDefault", ")", ";", "}" ]
Add the data description for this param.
[ "Add", "the", "data", "description", "for", "this", "param", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/message/src/main/java/org/jbundle/thin/base/message/BaseMessageRecordDesc.java#L107-L110