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 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
kejunxia/AndroidMvc | library/android-mvc/src/main/java/com/shipdream/lib/android/mvc/EventRegister.java | EventRegister.registerEventBuses | void registerEventBuses() {
if (!eventsRegistered) {
Mvc.graph().inject(this);
eventBusV.register(androidComponent);
eventsRegistered = true;
logger.trace("+Event2V bus registered for view - '{}'.",
androidComponent.getClass().getSimpleName());... | java | void registerEventBuses() {
if (!eventsRegistered) {
Mvc.graph().inject(this);
eventBusV.register(androidComponent);
eventsRegistered = true;
logger.trace("+Event2V bus registered for view - '{}'.",
androidComponent.getClass().getSimpleName());... | [
"void",
"registerEventBuses",
"(",
")",
"{",
"if",
"(",
"!",
"eventsRegistered",
")",
"{",
"Mvc",
".",
"graph",
"(",
")",
".",
"inject",
"(",
"this",
")",
";",
"eventBusV",
".",
"register",
"(",
"androidComponent",
")",
";",
"eventsRegistered",
"=",
"tru... | Register event bus for views. | [
"Register",
"event",
"bus",
"for",
"views",
"."
] | c7893f0a13119d64297b9eb2988f7323b7da5bbc | https://github.com/kejunxia/AndroidMvc/blob/c7893f0a13119d64297b9eb2988f7323b7da5bbc/library/android-mvc/src/main/java/com/shipdream/lib/android/mvc/EventRegister.java#L74-L85 | train |
kejunxia/AndroidMvc | library/android-mvc/src/main/java/com/shipdream/lib/android/mvc/EventRegister.java | EventRegister.unregisterEventBuses | void unregisterEventBuses() {
if (eventsRegistered) {
eventBusV.unregister(androidComponent);
eventsRegistered = false;
logger.trace("-Event2V bus unregistered for view - '{}' and its controllers.",
androidComponent.getClass().getSimpleName());
... | java | void unregisterEventBuses() {
if (eventsRegistered) {
eventBusV.unregister(androidComponent);
eventsRegistered = false;
logger.trace("-Event2V bus unregistered for view - '{}' and its controllers.",
androidComponent.getClass().getSimpleName());
... | [
"void",
"unregisterEventBuses",
"(",
")",
"{",
"if",
"(",
"eventsRegistered",
")",
"{",
"eventBusV",
".",
"unregister",
"(",
"androidComponent",
")",
";",
"eventsRegistered",
"=",
"false",
";",
"logger",
".",
"trace",
"(",
"\"-Event2V bus unregistered for view - '{}... | Unregister event bus for views. | [
"Unregister",
"event",
"bus",
"for",
"views",
"."
] | c7893f0a13119d64297b9eb2988f7323b7da5bbc | https://github.com/kejunxia/AndroidMvc/blob/c7893f0a13119d64297b9eb2988f7323b7da5bbc/library/android-mvc/src/main/java/com/shipdream/lib/android/mvc/EventRegister.java#L90-L101 | train |
kejunxia/AndroidMvc | library/poke/src/main/java/com/shipdream/lib/poke/Graph.java | Graph.inject | public void inject(Object target, Class<? extends Annotation> injectAnnotation)
throws ProvideException, ProviderMissingException, CircularDependenciesException {
if (monitors != null) {
int size = monitors.size();
for (int i = 0; i < size; i++) {
monitors.get... | java | public void inject(Object target, Class<? extends Annotation> injectAnnotation)
throws ProvideException, ProviderMissingException, CircularDependenciesException {
if (monitors != null) {
int size = monitors.size();
for (int i = 0; i < size; i++) {
monitors.get... | [
"public",
"void",
"inject",
"(",
"Object",
"target",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"injectAnnotation",
")",
"throws",
"ProvideException",
",",
"ProviderMissingException",
",",
"CircularDependenciesException",
"{",
"if",
"(",
"monitors",
"!=",... | Inject all fields annotated by the given injectAnnotation
@param target Whose fields will be injected
@param injectAnnotation Annotated which a field will be recognize
@throws ProvideException | [
"Inject",
"all",
"fields",
"annotated",
"by",
"the",
"given",
"injectAnnotation"
] | c7893f0a13119d64297b9eb2988f7323b7da5bbc | https://github.com/kejunxia/AndroidMvc/blob/c7893f0a13119d64297b9eb2988f7323b7da5bbc/library/poke/src/main/java/com/shipdream/lib/poke/Graph.java#L202-L214 | train |
kejunxia/AndroidMvc | library/poke/src/main/java/com/shipdream/lib/poke/Graph.java | Graph.recordVisitField | private void recordVisitField(Object object, Field objectField, Field field) {
Map<String, Set<String>> bag = visitedFields.get(object);
if (bag == null) {
bag = new HashMap<>();
visitedFields.put(object, bag);
}
Set<String> fields = bag.get(objectField);
... | java | private void recordVisitField(Object object, Field objectField, Field field) {
Map<String, Set<String>> bag = visitedFields.get(object);
if (bag == null) {
bag = new HashMap<>();
visitedFields.put(object, bag);
}
Set<String> fields = bag.get(objectField);
... | [
"private",
"void",
"recordVisitField",
"(",
"Object",
"object",
",",
"Field",
"objectField",
",",
"Field",
"field",
")",
"{",
"Map",
"<",
"String",
",",
"Set",
"<",
"String",
">",
">",
"bag",
"=",
"visitedFields",
".",
"get",
"(",
"object",
")",
";",
"... | Records the field of a target object is visited
@param object The field holder
@param objectField The field which holds the object in its parent
@param field The field of the holder | [
"Records",
"the",
"field",
"of",
"a",
"target",
"object",
"is",
"visited"
] | c7893f0a13119d64297b9eb2988f7323b7da5bbc | https://github.com/kejunxia/AndroidMvc/blob/c7893f0a13119d64297b9eb2988f7323b7da5bbc/library/poke/src/main/java/com/shipdream/lib/poke/Graph.java#L534-L549 | train |
kejunxia/AndroidMvc | library/poke/src/main/java/com/shipdream/lib/poke/Graph.java | Graph.isFieldVisited | private boolean isFieldVisited(Object object, Field objectField, Field field) {
Map<String, Set<String>> bag = visitedFields.get(object);
if (bag == null) {
return false;
}
String objectFiledKey = objectField == null ? "" : objectField.toGenericString();
Set<String> ... | java | private boolean isFieldVisited(Object object, Field objectField, Field field) {
Map<String, Set<String>> bag = visitedFields.get(object);
if (bag == null) {
return false;
}
String objectFiledKey = objectField == null ? "" : objectField.toGenericString();
Set<String> ... | [
"private",
"boolean",
"isFieldVisited",
"(",
"Object",
"object",
",",
"Field",
"objectField",
",",
"Field",
"field",
")",
"{",
"Map",
"<",
"String",
",",
"Set",
"<",
"String",
">",
">",
"bag",
"=",
"visitedFields",
".",
"get",
"(",
"object",
")",
";",
... | Indicates whether the field of a target object is visited
@param object The field holder
@param objectField The field which holds the object in its parent
@param field The field of the holder | [
"Indicates",
"whether",
"the",
"field",
"of",
"a",
"target",
"object",
"is",
"visited"
] | c7893f0a13119d64297b9eb2988f7323b7da5bbc | https://github.com/kejunxia/AndroidMvc/blob/c7893f0a13119d64297b9eb2988f7323b7da5bbc/library/poke/src/main/java/com/shipdream/lib/poke/Graph.java#L558-L567 | train |
kejunxia/AndroidMvc | library/poke/src/main/java/com/shipdream/lib/poke/Graph.java | Graph.throwCircularDependenciesException | private void throwCircularDependenciesException()
throws CircularDependenciesException {
String msg = "Circular dependencies found. Check the circular graph below:\n";
boolean firstNode = true;
String tab = " ";
for (String visit : visitedInjectNodes) {
if (!firs... | java | private void throwCircularDependenciesException()
throws CircularDependenciesException {
String msg = "Circular dependencies found. Check the circular graph below:\n";
boolean firstNode = true;
String tab = " ";
for (String visit : visitedInjectNodes) {
if (!firs... | [
"private",
"void",
"throwCircularDependenciesException",
"(",
")",
"throws",
"CircularDependenciesException",
"{",
"String",
"msg",
"=",
"\"Circular dependencies found. Check the circular graph below:\\n\"",
";",
"boolean",
"firstNode",
"=",
"true",
";",
"String",
"tab",
"=",... | Print readable circular graph
@throws CircularDependenciesException | [
"Print",
"readable",
"circular",
"graph"
] | c7893f0a13119d64297b9eb2988f7323b7da5bbc | https://github.com/kejunxia/AndroidMvc/blob/c7893f0a13119d64297b9eb2988f7323b7da5bbc/library/poke/src/main/java/com/shipdream/lib/poke/Graph.java#L590-L605 | train |
kejunxia/AndroidMvc | extension/service-mediastore/src/main/java/com/shipdream/lib/android/mvc/service/internal/MediaStoreServiceImpl.java | MediaStoreServiceImpl.extractImagesFromCursor | protected List<ImageDTO> extractImagesFromCursor(Cursor cursor, int offset, int limit) {
List<ImageDTO> images = new ArrayList<>();
int count = 0;
int begin = offset > 0 ? offset : 0;
if (cursor.moveToPosition(begin)) {
do {
ImageDTO image = extractOneImageFro... | java | protected List<ImageDTO> extractImagesFromCursor(Cursor cursor, int offset, int limit) {
List<ImageDTO> images = new ArrayList<>();
int count = 0;
int begin = offset > 0 ? offset : 0;
if (cursor.moveToPosition(begin)) {
do {
ImageDTO image = extractOneImageFro... | [
"protected",
"List",
"<",
"ImageDTO",
">",
"extractImagesFromCursor",
"(",
"Cursor",
"cursor",
",",
"int",
"offset",
",",
"int",
"limit",
")",
"{",
"List",
"<",
"ImageDTO",
">",
"images",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"int",
"count",
"=",... | Extract a list of imageDTO from current cursor with the given offset and limit.
@param cursor
@param offset
@param limit
@return | [
"Extract",
"a",
"list",
"of",
"imageDTO",
"from",
"current",
"cursor",
"with",
"the",
"given",
"offset",
"and",
"limit",
"."
] | c7893f0a13119d64297b9eb2988f7323b7da5bbc | https://github.com/kejunxia/AndroidMvc/blob/c7893f0a13119d64297b9eb2988f7323b7da5bbc/extension/service-mediastore/src/main/java/com/shipdream/lib/android/mvc/service/internal/MediaStoreServiceImpl.java#L284-L301 | train |
kejunxia/AndroidMvc | extension/service-mediastore/src/main/java/com/shipdream/lib/android/mvc/service/internal/MediaStoreServiceImpl.java | MediaStoreServiceImpl.extractVideosFromCursor | protected List<VideoDTO> extractVideosFromCursor(Cursor cursor, int offset, int limit) {
List<VideoDTO> videos = new ArrayList<>();
int count = 0;
int begin = offset > 0 ? offset : 0;
if (cursor.moveToPosition(begin)) {
do {
VideoDTO video = extractOneVideoFro... | java | protected List<VideoDTO> extractVideosFromCursor(Cursor cursor, int offset, int limit) {
List<VideoDTO> videos = new ArrayList<>();
int count = 0;
int begin = offset > 0 ? offset : 0;
if (cursor.moveToPosition(begin)) {
do {
VideoDTO video = extractOneVideoFro... | [
"protected",
"List",
"<",
"VideoDTO",
">",
"extractVideosFromCursor",
"(",
"Cursor",
"cursor",
",",
"int",
"offset",
",",
"int",
"limit",
")",
"{",
"List",
"<",
"VideoDTO",
">",
"videos",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"int",
"count",
"=",... | Extract a list of videoDTO from current cursor with the given offset and limit.
@param cursor
@param offset
@param limit
@return | [
"Extract",
"a",
"list",
"of",
"videoDTO",
"from",
"current",
"cursor",
"with",
"the",
"given",
"offset",
"and",
"limit",
"."
] | c7893f0a13119d64297b9eb2988f7323b7da5bbc | https://github.com/kejunxia/AndroidMvc/blob/c7893f0a13119d64297b9eb2988f7323b7da5bbc/extension/service-mediastore/src/main/java/com/shipdream/lib/android/mvc/service/internal/MediaStoreServiceImpl.java#L526-L543 | train |
kejunxia/AndroidMvc | library/poke/src/main/java/com/shipdream/lib/poke/util/ReflectUtils.java | ReflectUtils.setField | public static void setField(Object obj, Field field, Object value) {
boolean accessible = field.isAccessible();
//hack accessibility
if (!accessible) {
field.setAccessible(true);
}
try {
field.set(obj, value);
} catch (IllegalAccessException e) {
... | java | public static void setField(Object obj, Field field, Object value) {
boolean accessible = field.isAccessible();
//hack accessibility
if (!accessible) {
field.setAccessible(true);
}
try {
field.set(obj, value);
} catch (IllegalAccessException e) {
... | [
"public",
"static",
"void",
"setField",
"(",
"Object",
"obj",
",",
"Field",
"field",
",",
"Object",
"value",
")",
"{",
"boolean",
"accessible",
"=",
"field",
".",
"isAccessible",
"(",
")",
";",
"//hack accessibility",
"if",
"(",
"!",
"accessible",
")",
"{"... | Sets value to the field of the given object.
@param obj The object
@param field The field
@param value The value | [
"Sets",
"value",
"to",
"the",
"field",
"of",
"the",
"given",
"object",
"."
] | c7893f0a13119d64297b9eb2988f7323b7da5bbc | https://github.com/kejunxia/AndroidMvc/blob/c7893f0a13119d64297b9eb2988f7323b7da5bbc/library/poke/src/main/java/com/shipdream/lib/poke/util/ReflectUtils.java#L91-L105 | train |
kejunxia/AndroidMvc | library/poke/src/main/java/com/shipdream/lib/poke/util/ReflectUtils.java | ReflectUtils.getFieldValue | public static Object getFieldValue(Object obj, Field field) {
Object value = null;
boolean accessible = field.isAccessible();
//hack accessibility
if (!accessible) {
field.setAccessible(true);
}
try {
value = field.get(obj);
} catch (Illega... | java | public static Object getFieldValue(Object obj, Field field) {
Object value = null;
boolean accessible = field.isAccessible();
//hack accessibility
if (!accessible) {
field.setAccessible(true);
}
try {
value = field.get(obj);
} catch (Illega... | [
"public",
"static",
"Object",
"getFieldValue",
"(",
"Object",
"obj",
",",
"Field",
"field",
")",
"{",
"Object",
"value",
"=",
"null",
";",
"boolean",
"accessible",
"=",
"field",
".",
"isAccessible",
"(",
")",
";",
"//hack accessibility",
"if",
"(",
"!",
"a... | Gets value of the field of the given object.
@param obj The object
@param field The field | [
"Gets",
"value",
"of",
"the",
"field",
"of",
"the",
"given",
"object",
"."
] | c7893f0a13119d64297b9eb2988f7323b7da5bbc | https://github.com/kejunxia/AndroidMvc/blob/c7893f0a13119d64297b9eb2988f7323b7da5bbc/library/poke/src/main/java/com/shipdream/lib/poke/util/ReflectUtils.java#L112-L128 | train |
assertthat/selenium-shutterbug | src/main/java/com/assertthat/selenium_shutterbug/core/PageSnapshot.java | PageSnapshot.highlight | public PageSnapshot highlight(WebElement element) {
try {
highlight(element, Color.red, 3);
} catch (RasterFormatException rfe) {
throw new ElementOutsideViewportException(ELEMENT_OUT_OF_VIEWPORT_EX_MESSAGE, rfe);
}
return this;
} | java | public PageSnapshot highlight(WebElement element) {
try {
highlight(element, Color.red, 3);
} catch (RasterFormatException rfe) {
throw new ElementOutsideViewportException(ELEMENT_OUT_OF_VIEWPORT_EX_MESSAGE, rfe);
}
return this;
} | [
"public",
"PageSnapshot",
"highlight",
"(",
"WebElement",
"element",
")",
"{",
"try",
"{",
"highlight",
"(",
"element",
",",
"Color",
".",
"red",
",",
"3",
")",
";",
"}",
"catch",
"(",
"RasterFormatException",
"rfe",
")",
"{",
"throw",
"new",
"ElementOutsi... | Highlights WebElement within the page with Color.red
and line width 3.
@param element WebElement to be highlighted
@return instance of type PageSnapshot | [
"Highlights",
"WebElement",
"within",
"the",
"page",
"with",
"Color",
".",
"red",
"and",
"line",
"width",
"3",
"."
] | 770d9b92423200d262c9ab70e40405921d81e262 | https://github.com/assertthat/selenium-shutterbug/blob/770d9b92423200d262c9ab70e40405921d81e262/src/main/java/com/assertthat/selenium_shutterbug/core/PageSnapshot.java#L34-L41 | train |
assertthat/selenium-shutterbug | src/main/java/com/assertthat/selenium_shutterbug/core/PageSnapshot.java | PageSnapshot.highlight | public PageSnapshot highlight(WebElement element, Color color, int lineWidth) {
try {
image = ImageProcessor.highlight(image, new Coordinates(element, devicePixelRatio), color, lineWidth);
} catch (RasterFormatException rfe) {
throw new ElementOutsideViewportException(ELEMENT_OUT... | java | public PageSnapshot highlight(WebElement element, Color color, int lineWidth) {
try {
image = ImageProcessor.highlight(image, new Coordinates(element, devicePixelRatio), color, lineWidth);
} catch (RasterFormatException rfe) {
throw new ElementOutsideViewportException(ELEMENT_OUT... | [
"public",
"PageSnapshot",
"highlight",
"(",
"WebElement",
"element",
",",
"Color",
"color",
",",
"int",
"lineWidth",
")",
"{",
"try",
"{",
"image",
"=",
"ImageProcessor",
".",
"highlight",
"(",
"image",
",",
"new",
"Coordinates",
"(",
"element",
",",
"device... | Highlights WebElement within the page with provided color
and line width.
@param element WebElement to be highlighted
@param color color of the line
@param lineWidth width of the line
@return instance of type PageSnapshot | [
"Highlights",
"WebElement",
"within",
"the",
"page",
"with",
"provided",
"color",
"and",
"line",
"width",
"."
] | 770d9b92423200d262c9ab70e40405921d81e262 | https://github.com/assertthat/selenium-shutterbug/blob/770d9b92423200d262c9ab70e40405921d81e262/src/main/java/com/assertthat/selenium_shutterbug/core/PageSnapshot.java#L52-L59 | train |
assertthat/selenium-shutterbug | src/main/java/com/assertthat/selenium_shutterbug/core/PageSnapshot.java | PageSnapshot.blur | public PageSnapshot blur(WebElement element) {
try {
image = ImageProcessor.blurArea(image, new Coordinates(element, devicePixelRatio));
}catch(RasterFormatException rfe) {
throw new ElementOutsideViewportException(ELEMENT_OUT_OF_VIEWPORT_EX_MESSAGE, rfe);
}
retur... | java | public PageSnapshot blur(WebElement element) {
try {
image = ImageProcessor.blurArea(image, new Coordinates(element, devicePixelRatio));
}catch(RasterFormatException rfe) {
throw new ElementOutsideViewportException(ELEMENT_OUT_OF_VIEWPORT_EX_MESSAGE, rfe);
}
retur... | [
"public",
"PageSnapshot",
"blur",
"(",
"WebElement",
"element",
")",
"{",
"try",
"{",
"image",
"=",
"ImageProcessor",
".",
"blurArea",
"(",
"image",
",",
"new",
"Coordinates",
"(",
"element",
",",
"devicePixelRatio",
")",
")",
";",
"}",
"catch",
"(",
"Rast... | Blur provided element within the page only.
@param element WebElement to be blurred
@return instance of type PageSnapshot | [
"Blur",
"provided",
"element",
"within",
"the",
"page",
"only",
"."
] | 770d9b92423200d262c9ab70e40405921d81e262 | https://github.com/assertthat/selenium-shutterbug/blob/770d9b92423200d262c9ab70e40405921d81e262/src/main/java/com/assertthat/selenium_shutterbug/core/PageSnapshot.java#L119-L126 | train |
assertthat/selenium-shutterbug | src/main/java/com/assertthat/selenium_shutterbug/core/PageSnapshot.java | PageSnapshot.monochrome | public PageSnapshot monochrome(WebElement element) {
try {
image = ImageProcessor.monochromeArea(image, new Coordinates(element,devicePixelRatio));
} catch (RasterFormatException rfe) {
throw new ElementOutsideViewportException(ELEMENT_OUT_OF_VIEWPORT_EX_MESSAGE, rfe);
}
... | java | public PageSnapshot monochrome(WebElement element) {
try {
image = ImageProcessor.monochromeArea(image, new Coordinates(element,devicePixelRatio));
} catch (RasterFormatException rfe) {
throw new ElementOutsideViewportException(ELEMENT_OUT_OF_VIEWPORT_EX_MESSAGE, rfe);
}
... | [
"public",
"PageSnapshot",
"monochrome",
"(",
"WebElement",
"element",
")",
"{",
"try",
"{",
"image",
"=",
"ImageProcessor",
".",
"monochromeArea",
"(",
"image",
",",
"new",
"Coordinates",
"(",
"element",
",",
"devicePixelRatio",
")",
")",
";",
"}",
"catch",
... | Makes an element withing a page 'monochrome' - applies gray-and-white filter.
Original colors remain on the rest of the page.
@param element WebElement within the page to be made 'monochrome'
@return instance of type PageSnapshot | [
"Makes",
"an",
"element",
"withing",
"a",
"page",
"monochrome",
"-",
"applies",
"gray",
"-",
"and",
"-",
"white",
"filter",
".",
"Original",
"colors",
"remain",
"on",
"the",
"rest",
"of",
"the",
"page",
"."
] | 770d9b92423200d262c9ab70e40405921d81e262 | https://github.com/assertthat/selenium-shutterbug/blob/770d9b92423200d262c9ab70e40405921d81e262/src/main/java/com/assertthat/selenium_shutterbug/core/PageSnapshot.java#L135-L142 | train |
assertthat/selenium-shutterbug | src/main/java/com/assertthat/selenium_shutterbug/core/PageSnapshot.java | PageSnapshot.blurExcept | public PageSnapshot blurExcept(WebElement element) {
try{
image = ImageProcessor.blurExceptArea(image, new Coordinates(element,devicePixelRatio));
}catch(RasterFormatException rfe){
throw new ElementOutsideViewportException(ELEMENT_OUT_OF_VIEWPORT_EX_MESSAGE,rfe);
}
... | java | public PageSnapshot blurExcept(WebElement element) {
try{
image = ImageProcessor.blurExceptArea(image, new Coordinates(element,devicePixelRatio));
}catch(RasterFormatException rfe){
throw new ElementOutsideViewportException(ELEMENT_OUT_OF_VIEWPORT_EX_MESSAGE,rfe);
}
... | [
"public",
"PageSnapshot",
"blurExcept",
"(",
"WebElement",
"element",
")",
"{",
"try",
"{",
"image",
"=",
"ImageProcessor",
".",
"blurExceptArea",
"(",
"image",
",",
"new",
"Coordinates",
"(",
"element",
",",
"devicePixelRatio",
")",
")",
";",
"}",
"catch",
... | Blurs all the page except the element provided.
@param element WebElement to stay not blurred
@return instance of type PageSnapshot | [
"Blurs",
"all",
"the",
"page",
"except",
"the",
"element",
"provided",
"."
] | 770d9b92423200d262c9ab70e40405921d81e262 | https://github.com/assertthat/selenium-shutterbug/blob/770d9b92423200d262c9ab70e40405921d81e262/src/main/java/com/assertthat/selenium_shutterbug/core/PageSnapshot.java#L150-L157 | train |
assertthat/selenium-shutterbug | src/main/java/com/assertthat/selenium_shutterbug/core/PageSnapshot.java | PageSnapshot.cropAround | public PageSnapshot cropAround(WebElement element, int offsetX, int offsetY) {
try{
image = ImageProcessor.cropAround(image, new Coordinates(element,devicePixelRatio), offsetX, offsetY);
}catch(RasterFormatException rfe){
throw new ElementOutsideViewportException(ELEMENT_OUT_OF_V... | java | public PageSnapshot cropAround(WebElement element, int offsetX, int offsetY) {
try{
image = ImageProcessor.cropAround(image, new Coordinates(element,devicePixelRatio), offsetX, offsetY);
}catch(RasterFormatException rfe){
throw new ElementOutsideViewportException(ELEMENT_OUT_OF_V... | [
"public",
"PageSnapshot",
"cropAround",
"(",
"WebElement",
"element",
",",
"int",
"offsetX",
",",
"int",
"offsetY",
")",
"{",
"try",
"{",
"image",
"=",
"ImageProcessor",
".",
"cropAround",
"(",
"image",
",",
"new",
"Coordinates",
"(",
"element",
",",
"device... | Crop the image around specified element with offset.
@param element WebElement to crop around
@param offsetX offsetX around element in px
@param offsetY offsetY around element in px
@return instance of type PageSnapshot | [
"Crop",
"the",
"image",
"around",
"specified",
"element",
"with",
"offset",
"."
] | 770d9b92423200d262c9ab70e40405921d81e262 | https://github.com/assertthat/selenium-shutterbug/blob/770d9b92423200d262c9ab70e40405921d81e262/src/main/java/com/assertthat/selenium_shutterbug/core/PageSnapshot.java#L167-L174 | train |
assertthat/selenium-shutterbug | src/main/java/com/assertthat/selenium_shutterbug/utils/image/ImageProcessor.java | ImageProcessor.imagesAreEqualsWithDiff | public static boolean imagesAreEqualsWithDiff(BufferedImage image1, BufferedImage image2, String pathFileName, double deviation) {
BufferedImage output = new BufferedImage(image1.getWidth(), image1.getHeight(), BufferedImage.TYPE_INT_RGB);
int width1 = image1.getWidth(null);
int width2 = image2... | java | public static boolean imagesAreEqualsWithDiff(BufferedImage image1, BufferedImage image2, String pathFileName, double deviation) {
BufferedImage output = new BufferedImage(image1.getWidth(), image1.getHeight(), BufferedImage.TYPE_INT_RGB);
int width1 = image1.getWidth(null);
int width2 = image2... | [
"public",
"static",
"boolean",
"imagesAreEqualsWithDiff",
"(",
"BufferedImage",
"image1",
",",
"BufferedImage",
"image2",
",",
"String",
"pathFileName",
",",
"double",
"deviation",
")",
"{",
"BufferedImage",
"output",
"=",
"new",
"BufferedImage",
"(",
"image1",
".",... | Extends the functionality of imagesAreEqualsWithDiff, but creates a third BufferedImage and applies pixel manipulation to it.
@param image1 The first image to compare
@param image2 The second image to compare
@param pathFileName The output path filename for the third image, if null then is ignored
@param deviation The ... | [
"Extends",
"the",
"functionality",
"of",
"imagesAreEqualsWithDiff",
"but",
"creates",
"a",
"third",
"BufferedImage",
"and",
"applies",
"pixel",
"manipulation",
"to",
"it",
"."
] | 770d9b92423200d262c9ab70e40405921d81e262 | https://github.com/assertthat/selenium-shutterbug/blob/770d9b92423200d262c9ab70e40405921d81e262/src/main/java/com/assertthat/selenium_shutterbug/utils/image/ImageProcessor.java#L147-L191 | train |
heinrichreimer/material-drawer | library/src/main/java/com/heinrichreimersoftware/materialdrawer/structure/DrawerProfile.java | DrawerProfile.setAvatar | public DrawerProfile setAvatar(Context context, Bitmap avatar) {
mAvatar = new BitmapDrawable(context.getResources(), avatar);
notifyDataChanged();
return this;
} | java | public DrawerProfile setAvatar(Context context, Bitmap avatar) {
mAvatar = new BitmapDrawable(context.getResources(), avatar);
notifyDataChanged();
return this;
} | [
"public",
"DrawerProfile",
"setAvatar",
"(",
"Context",
"context",
",",
"Bitmap",
"avatar",
")",
"{",
"mAvatar",
"=",
"new",
"BitmapDrawable",
"(",
"context",
".",
"getResources",
"(",
")",
",",
"avatar",
")",
";",
"notifyDataChanged",
"(",
")",
";",
"return... | Sets an avatar image to the drawer profile
@param avatar Avatar image to set | [
"Sets",
"an",
"avatar",
"image",
"to",
"the",
"drawer",
"profile"
] | 7c2406812d73f710ef8bb73d4a0f4bbef3b275ce | https://github.com/heinrichreimer/material-drawer/blob/7c2406812d73f710ef8bb73d4a0f4bbef3b275ce/library/src/main/java/com/heinrichreimersoftware/materialdrawer/structure/DrawerProfile.java#L126-L130 | train |
heinrichreimer/material-drawer | library/src/main/java/com/heinrichreimersoftware/materialdrawer/structure/DrawerProfile.java | DrawerProfile.setRoundedAvatar | public DrawerProfile setRoundedAvatar(Context context, Bitmap image) {
return setAvatar(new RoundedAvatarDrawable(new BitmapDrawable(context.getResources(), image).getBitmap()));
} | java | public DrawerProfile setRoundedAvatar(Context context, Bitmap image) {
return setAvatar(new RoundedAvatarDrawable(new BitmapDrawable(context.getResources(), image).getBitmap()));
} | [
"public",
"DrawerProfile",
"setRoundedAvatar",
"(",
"Context",
"context",
",",
"Bitmap",
"image",
")",
"{",
"return",
"setAvatar",
"(",
"new",
"RoundedAvatarDrawable",
"(",
"new",
"BitmapDrawable",
"(",
"context",
".",
"getResources",
"(",
")",
",",
"image",
")"... | Sets a rounded avatar image to the drawer profile
@param image Avatar image to set | [
"Sets",
"a",
"rounded",
"avatar",
"image",
"to",
"the",
"drawer",
"profile"
] | 7c2406812d73f710ef8bb73d4a0f4bbef3b275ce | https://github.com/heinrichreimer/material-drawer/blob/7c2406812d73f710ef8bb73d4a0f4bbef3b275ce/library/src/main/java/com/heinrichreimersoftware/materialdrawer/structure/DrawerProfile.java#L146-L148 | train |
heinrichreimer/material-drawer | library/src/main/java/com/heinrichreimersoftware/materialdrawer/structure/DrawerProfile.java | DrawerProfile.setBackground | public DrawerProfile setBackground(Context context, Bitmap background) {
mBackground = new BitmapDrawable(context.getResources(), background);
notifyDataChanged();
return this;
} | java | public DrawerProfile setBackground(Context context, Bitmap background) {
mBackground = new BitmapDrawable(context.getResources(), background);
notifyDataChanged();
return this;
} | [
"public",
"DrawerProfile",
"setBackground",
"(",
"Context",
"context",
",",
"Bitmap",
"background",
")",
"{",
"mBackground",
"=",
"new",
"BitmapDrawable",
"(",
"context",
".",
"getResources",
"(",
")",
",",
"background",
")",
";",
"notifyDataChanged",
"(",
")",
... | Sets a background to the drawer profile
@param background Background to set | [
"Sets",
"a",
"background",
"to",
"the",
"drawer",
"profile"
] | 7c2406812d73f710ef8bb73d4a0f4bbef3b275ce | https://github.com/heinrichreimer/material-drawer/blob/7c2406812d73f710ef8bb73d4a0f4bbef3b275ce/library/src/main/java/com/heinrichreimersoftware/materialdrawer/structure/DrawerProfile.java#L194-L198 | train |
heinrichreimer/material-drawer | library/src/main/java/com/heinrichreimersoftware/materialdrawer/structure/DrawerItem.java | DrawerItem.setImageMode | public DrawerItem setImageMode(int imageMode) {
if (imageMode != ICON && imageMode != AVATAR && imageMode != SMALL_AVATAR) {
throw new IllegalArgumentException("Image mode must be either ICON or AVATAR.");
}
mImageMode = imageMode;
notifyDataChanged();
return this;
... | java | public DrawerItem setImageMode(int imageMode) {
if (imageMode != ICON && imageMode != AVATAR && imageMode != SMALL_AVATAR) {
throw new IllegalArgumentException("Image mode must be either ICON or AVATAR.");
}
mImageMode = imageMode;
notifyDataChanged();
return this;
... | [
"public",
"DrawerItem",
"setImageMode",
"(",
"int",
"imageMode",
")",
"{",
"if",
"(",
"imageMode",
"!=",
"ICON",
"&&",
"imageMode",
"!=",
"AVATAR",
"&&",
"imageMode",
"!=",
"SMALL_AVATAR",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Image mode ... | Sets an image mode to the drawer item
@param imageMode Image mode to set | [
"Sets",
"an",
"image",
"mode",
"to",
"the",
"drawer",
"item"
] | 7c2406812d73f710ef8bb73d4a0f4bbef3b275ce | https://github.com/heinrichreimer/material-drawer/blob/7c2406812d73f710ef8bb73d4a0f4bbef3b275ce/library/src/main/java/com/heinrichreimersoftware/materialdrawer/structure/DrawerItem.java#L279-L286 | train |
heinrichreimer/material-drawer | library/src/main/java/com/heinrichreimersoftware/materialdrawer/structure/DrawerItem.java | DrawerItem.setTextSecondary | public DrawerItem setTextSecondary(String textSecondary, int textMode) {
mTextSecondary = textSecondary;
setTextMode(textMode);
notifyDataChanged();
return this;
} | java | public DrawerItem setTextSecondary(String textSecondary, int textMode) {
mTextSecondary = textSecondary;
setTextMode(textMode);
notifyDataChanged();
return this;
} | [
"public",
"DrawerItem",
"setTextSecondary",
"(",
"String",
"textSecondary",
",",
"int",
"textMode",
")",
"{",
"mTextSecondary",
"=",
"textSecondary",
";",
"setTextMode",
"(",
"textMode",
")",
";",
"notifyDataChanged",
"(",
")",
";",
"return",
"this",
";",
"}"
] | Sets a secondary text with a given text mode to the drawer item
@param textSecondary Secondary text to set
@param textMode Text mode to set | [
"Sets",
"a",
"secondary",
"text",
"with",
"a",
"given",
"text",
"mode",
"to",
"the",
"drawer",
"item"
] | 7c2406812d73f710ef8bb73d4a0f4bbef3b275ce | https://github.com/heinrichreimer/material-drawer/blob/7c2406812d73f710ef8bb73d4a0f4bbef3b275ce/library/src/main/java/com/heinrichreimersoftware/materialdrawer/structure/DrawerItem.java#L363-L368 | train |
heinrichreimer/material-drawer | library/src/main/java/com/heinrichreimersoftware/materialdrawer/structure/DrawerItem.java | DrawerItem.setTextMode | public DrawerItem setTextMode(int textMode) {
if (textMode != SINGLE_LINE && textMode != TWO_LINE && textMode != THREE_LINE) {
throw new IllegalArgumentException("Image mode must be either SINGLE_LINE, TWO_LINE or THREE_LINE.");
}
mTextMode = textMode;
notifyDataChanged();
... | java | public DrawerItem setTextMode(int textMode) {
if (textMode != SINGLE_LINE && textMode != TWO_LINE && textMode != THREE_LINE) {
throw new IllegalArgumentException("Image mode must be either SINGLE_LINE, TWO_LINE or THREE_LINE.");
}
mTextMode = textMode;
notifyDataChanged();
... | [
"public",
"DrawerItem",
"setTextMode",
"(",
"int",
"textMode",
")",
"{",
"if",
"(",
"textMode",
"!=",
"SINGLE_LINE",
"&&",
"textMode",
"!=",
"TWO_LINE",
"&&",
"textMode",
"!=",
"THREE_LINE",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Image mod... | Sets a text mode to the drawer item
@param textMode Text mode to set | [
"Sets",
"a",
"text",
"mode",
"to",
"the",
"drawer",
"item"
] | 7c2406812d73f710ef8bb73d4a0f4bbef3b275ce | https://github.com/heinrichreimer/material-drawer/blob/7c2406812d73f710ef8bb73d4a0f4bbef3b275ce/library/src/main/java/com/heinrichreimersoftware/materialdrawer/structure/DrawerItem.java#L414-L421 | train |
heinrichreimer/material-drawer | library/src/main/java/com/heinrichreimersoftware/materialdrawer/DrawerView.java | DrawerView.addProfile | public DrawerView addProfile(DrawerProfile profile) {
if (profile.getId() <= 0) {
profile.setId(System.nanoTime() * 100 + Math.round(Math.random() * 100));
}
for (DrawerProfile oldProfile : mProfileAdapter.getItems()) {
if (oldProfile.getId() == profile.getId()) {
... | java | public DrawerView addProfile(DrawerProfile profile) {
if (profile.getId() <= 0) {
profile.setId(System.nanoTime() * 100 + Math.round(Math.random() * 100));
}
for (DrawerProfile oldProfile : mProfileAdapter.getItems()) {
if (oldProfile.getId() == profile.getId()) {
... | [
"public",
"DrawerView",
"addProfile",
"(",
"DrawerProfile",
"profile",
")",
"{",
"if",
"(",
"profile",
".",
"getId",
"(",
")",
"<=",
"0",
")",
"{",
"profile",
".",
"setId",
"(",
"System",
".",
"nanoTime",
"(",
")",
"*",
"100",
"+",
"Math",
".",
"roun... | Adds a profile to the drawer view
@param profile Profile to add | [
"Adds",
"a",
"profile",
"to",
"the",
"drawer",
"view"
] | 7c2406812d73f710ef8bb73d4a0f4bbef3b275ce | https://github.com/heinrichreimer/material-drawer/blob/7c2406812d73f710ef8bb73d4a0f4bbef3b275ce/library/src/main/java/com/heinrichreimersoftware/materialdrawer/DrawerView.java#L955-L972 | train |
heinrichreimer/material-drawer | library/src/main/java/com/heinrichreimersoftware/materialdrawer/DrawerView.java | DrawerView.findProfileById | public DrawerProfile findProfileById(long id) {
for (DrawerProfile profile : mProfileAdapter.getItems()) {
if (profile.getId() == id) {
return profile;
}
}
return null;
} | java | public DrawerProfile findProfileById(long id) {
for (DrawerProfile profile : mProfileAdapter.getItems()) {
if (profile.getId() == id) {
return profile;
}
}
return null;
} | [
"public",
"DrawerProfile",
"findProfileById",
"(",
"long",
"id",
")",
"{",
"for",
"(",
"DrawerProfile",
"profile",
":",
"mProfileAdapter",
".",
"getItems",
"(",
")",
")",
"{",
"if",
"(",
"profile",
".",
"getId",
"(",
")",
"==",
"id",
")",
"{",
"return",
... | Gets a profile from the drawer view
@param id The profile ID
@return Profile from the drawer view | [
"Gets",
"a",
"profile",
"from",
"the",
"drawer",
"view"
] | 7c2406812d73f710ef8bb73d4a0f4bbef3b275ce | https://github.com/heinrichreimer/material-drawer/blob/7c2406812d73f710ef8bb73d4a0f4bbef3b275ce/library/src/main/java/com/heinrichreimersoftware/materialdrawer/DrawerView.java#L989-L996 | train |
heinrichreimer/material-drawer | library/src/main/java/com/heinrichreimersoftware/materialdrawer/DrawerView.java | DrawerView.clearProfiles | public DrawerView clearProfiles() {
for (DrawerProfile profile : mProfileAdapter.getItems()) {
profile.detach();
}
mProfileAdapter.clear();
updateProfile();
return this;
} | java | public DrawerView clearProfiles() {
for (DrawerProfile profile : mProfileAdapter.getItems()) {
profile.detach();
}
mProfileAdapter.clear();
updateProfile();
return this;
} | [
"public",
"DrawerView",
"clearProfiles",
"(",
")",
"{",
"for",
"(",
"DrawerProfile",
"profile",
":",
"mProfileAdapter",
".",
"getItems",
"(",
")",
")",
"{",
"profile",
".",
"detach",
"(",
")",
";",
"}",
"mProfileAdapter",
".",
"clear",
"(",
")",
";",
"up... | Removes all profiles from the drawer view | [
"Removes",
"all",
"profiles",
"from",
"the",
"drawer",
"view"
] | 7c2406812d73f710ef8bb73d4a0f4bbef3b275ce | https://github.com/heinrichreimer/material-drawer/blob/7c2406812d73f710ef8bb73d4a0f4bbef3b275ce/library/src/main/java/com/heinrichreimersoftware/materialdrawer/DrawerView.java#L1072-L1079 | train |
heinrichreimer/material-drawer | library/src/main/java/com/heinrichreimersoftware/materialdrawer/DrawerView.java | DrawerView.addItems | public DrawerView addItems(List<DrawerItem> items) {
mAdapter.setNotifyOnChange(false);
for (DrawerItem item : items) {
if (item.getId() <= 0) {
item.setId(System.nanoTime() * 100 + Math.round(Math.random() * 100));
}
for (DrawerItem oldItem : mAdapter... | java | public DrawerView addItems(List<DrawerItem> items) {
mAdapter.setNotifyOnChange(false);
for (DrawerItem item : items) {
if (item.getId() <= 0) {
item.setId(System.nanoTime() * 100 + Math.round(Math.random() * 100));
}
for (DrawerItem oldItem : mAdapter... | [
"public",
"DrawerView",
"addItems",
"(",
"List",
"<",
"DrawerItem",
">",
"items",
")",
"{",
"mAdapter",
".",
"setNotifyOnChange",
"(",
"false",
")",
";",
"for",
"(",
"DrawerItem",
"item",
":",
"items",
")",
"{",
"if",
"(",
"item",
".",
"getId",
"(",
")... | Adds items to the drawer view
@param items Items to add | [
"Adds",
"items",
"to",
"the",
"drawer",
"view"
] | 7c2406812d73f710ef8bb73d4a0f4bbef3b275ce | https://github.com/heinrichreimer/material-drawer/blob/7c2406812d73f710ef8bb73d4a0f4bbef3b275ce/library/src/main/java/com/heinrichreimersoftware/materialdrawer/DrawerView.java#L1159-L1179 | train |
heinrichreimer/material-drawer | library/src/main/java/com/heinrichreimersoftware/materialdrawer/DrawerView.java | DrawerView.addItem | public DrawerView addItem(DrawerItem item) {
if (item.getId() <= 0) {
item.setId(System.nanoTime() * 100 + Math.round(Math.random() * 100));
}
for (DrawerItem oldItem : mAdapter.getItems()) {
if (oldItem.getId() == item.getId()) {
mAdapter.remove(oldItem);... | java | public DrawerView addItem(DrawerItem item) {
if (item.getId() <= 0) {
item.setId(System.nanoTime() * 100 + Math.round(Math.random() * 100));
}
for (DrawerItem oldItem : mAdapter.getItems()) {
if (oldItem.getId() == item.getId()) {
mAdapter.remove(oldItem);... | [
"public",
"DrawerView",
"addItem",
"(",
"DrawerItem",
"item",
")",
"{",
"if",
"(",
"item",
".",
"getId",
"(",
")",
"<=",
"0",
")",
"{",
"item",
".",
"setId",
"(",
"System",
".",
"nanoTime",
"(",
")",
"*",
"100",
"+",
"Math",
".",
"round",
"(",
"M... | Adds an item to the drawer view
@param item Item to add | [
"Adds",
"an",
"item",
"to",
"the",
"drawer",
"view"
] | 7c2406812d73f710ef8bb73d4a0f4bbef3b275ce | https://github.com/heinrichreimer/material-drawer/blob/7c2406812d73f710ef8bb73d4a0f4bbef3b275ce/library/src/main/java/com/heinrichreimersoftware/materialdrawer/DrawerView.java#L1213-L1228 | train |
heinrichreimer/material-drawer | library/src/main/java/com/heinrichreimersoftware/materialdrawer/DrawerView.java | DrawerView.findItemById | public DrawerItem findItemById(long id) {
for (DrawerItem item : mAdapter.getItems()) {
if (item.getId() == id) {
return item;
}
}
return null;
} | java | public DrawerItem findItemById(long id) {
for (DrawerItem item : mAdapter.getItems()) {
if (item.getId() == id) {
return item;
}
}
return null;
} | [
"public",
"DrawerItem",
"findItemById",
"(",
"long",
"id",
")",
"{",
"for",
"(",
"DrawerItem",
"item",
":",
"mAdapter",
".",
"getItems",
"(",
")",
")",
"{",
"if",
"(",
"item",
".",
"getId",
"(",
")",
"==",
"id",
")",
"{",
"return",
"item",
";",
"}"... | Gets an item from the drawer view
@param id The item ID
@return Item from the drawer view | [
"Gets",
"an",
"item",
"from",
"the",
"drawer",
"view"
] | 7c2406812d73f710ef8bb73d4a0f4bbef3b275ce | https://github.com/heinrichreimer/material-drawer/blob/7c2406812d73f710ef8bb73d4a0f4bbef3b275ce/library/src/main/java/com/heinrichreimersoftware/materialdrawer/DrawerView.java#L1263-L1270 | train |
heinrichreimer/material-drawer | library/src/main/java/com/heinrichreimersoftware/materialdrawer/DrawerView.java | DrawerView.selectItemById | public DrawerView selectItemById(long id) {
mAdapterFixed.clearSelection();
int count = mAdapter.getCount();
for (int i = 0; i < count; i++) {
if (mAdapter.getItem(i).getId() == id) {
mAdapter.select(i);
return this;
}
}
re... | java | public DrawerView selectItemById(long id) {
mAdapterFixed.clearSelection();
int count = mAdapter.getCount();
for (int i = 0; i < count; i++) {
if (mAdapter.getItem(i).getId() == id) {
mAdapter.select(i);
return this;
}
}
re... | [
"public",
"DrawerView",
"selectItemById",
"(",
"long",
"id",
")",
"{",
"mAdapterFixed",
".",
"clearSelection",
"(",
")",
";",
"int",
"count",
"=",
"mAdapter",
".",
"getCount",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"count",
"... | Selects an item from the drawer view
@param id The item ID | [
"Selects",
"an",
"item",
"from",
"the",
"drawer",
"view"
] | 7c2406812d73f710ef8bb73d4a0f4bbef3b275ce | https://github.com/heinrichreimer/material-drawer/blob/7c2406812d73f710ef8bb73d4a0f4bbef3b275ce/library/src/main/java/com/heinrichreimersoftware/materialdrawer/DrawerView.java#L1297-L1308 | train |
heinrichreimer/material-drawer | library/src/main/java/com/heinrichreimersoftware/materialdrawer/DrawerView.java | DrawerView.clearItems | public DrawerView clearItems() {
for (DrawerItem item : mAdapter.getItems()) {
item.detach();
}
mAdapter.clear();
updateList();
return this;
} | java | public DrawerView clearItems() {
for (DrawerItem item : mAdapter.getItems()) {
item.detach();
}
mAdapter.clear();
updateList();
return this;
} | [
"public",
"DrawerView",
"clearItems",
"(",
")",
"{",
"for",
"(",
"DrawerItem",
"item",
":",
"mAdapter",
".",
"getItems",
"(",
")",
")",
"{",
"item",
".",
"detach",
"(",
")",
";",
"}",
"mAdapter",
".",
"clear",
"(",
")",
";",
"updateList",
"(",
")",
... | Removes all items from the drawer view | [
"Removes",
"all",
"items",
"from",
"the",
"drawer",
"view"
] | 7c2406812d73f710ef8bb73d4a0f4bbef3b275ce | https://github.com/heinrichreimer/material-drawer/blob/7c2406812d73f710ef8bb73d4a0f4bbef3b275ce/library/src/main/java/com/heinrichreimersoftware/materialdrawer/DrawerView.java#L1353-L1360 | train |
heinrichreimer/material-drawer | library/src/main/java/com/heinrichreimersoftware/materialdrawer/DrawerView.java | DrawerView.addFixedItems | public DrawerView addFixedItems(List<DrawerItem> items) {
mAdapterFixed.setNotifyOnChange(false);
for (DrawerItem item : items) {
if (item.getId() <= 0) {
item.setId(System.nanoTime() * 100 + Math.round(Math.random() * 100));
}
for (DrawerItem oldItem ... | java | public DrawerView addFixedItems(List<DrawerItem> items) {
mAdapterFixed.setNotifyOnChange(false);
for (DrawerItem item : items) {
if (item.getId() <= 0) {
item.setId(System.nanoTime() * 100 + Math.round(Math.random() * 100));
}
for (DrawerItem oldItem ... | [
"public",
"DrawerView",
"addFixedItems",
"(",
"List",
"<",
"DrawerItem",
">",
"items",
")",
"{",
"mAdapterFixed",
".",
"setNotifyOnChange",
"(",
"false",
")",
";",
"for",
"(",
"DrawerItem",
"item",
":",
"items",
")",
"{",
"if",
"(",
"item",
".",
"getId",
... | Adds fixed items to the drawer view
@param items Items to add | [
"Adds",
"fixed",
"items",
"to",
"the",
"drawer",
"view"
] | 7c2406812d73f710ef8bb73d4a0f4bbef3b275ce | https://github.com/heinrichreimer/material-drawer/blob/7c2406812d73f710ef8bb73d4a0f4bbef3b275ce/library/src/main/java/com/heinrichreimersoftware/materialdrawer/DrawerView.java#L1404-L1424 | train |
heinrichreimer/material-drawer | library/src/main/java/com/heinrichreimersoftware/materialdrawer/DrawerView.java | DrawerView.addFixedItem | public DrawerView addFixedItem(DrawerItem item) {
if (item.getId() <= 0) {
item.setId(System.nanoTime() * 100 + Math.round(Math.random() * 100));
}
for (DrawerItem oldItem : mAdapterFixed.getItems()) {
if (oldItem.getId() == item.getId()) {
mAdapterFixed.r... | java | public DrawerView addFixedItem(DrawerItem item) {
if (item.getId() <= 0) {
item.setId(System.nanoTime() * 100 + Math.round(Math.random() * 100));
}
for (DrawerItem oldItem : mAdapterFixed.getItems()) {
if (oldItem.getId() == item.getId()) {
mAdapterFixed.r... | [
"public",
"DrawerView",
"addFixedItem",
"(",
"DrawerItem",
"item",
")",
"{",
"if",
"(",
"item",
".",
"getId",
"(",
")",
"<=",
"0",
")",
"{",
"item",
".",
"setId",
"(",
"System",
".",
"nanoTime",
"(",
")",
"*",
"100",
"+",
"Math",
".",
"round",
"(",... | Adds a fixed item to the drawer view
@param item Item to add | [
"Adds",
"a",
"fixed",
"item",
"to",
"the",
"drawer",
"view"
] | 7c2406812d73f710ef8bb73d4a0f4bbef3b275ce | https://github.com/heinrichreimer/material-drawer/blob/7c2406812d73f710ef8bb73d4a0f4bbef3b275ce/library/src/main/java/com/heinrichreimersoftware/materialdrawer/DrawerView.java#L1458-L1473 | train |
heinrichreimer/material-drawer | library/src/main/java/com/heinrichreimersoftware/materialdrawer/DrawerView.java | DrawerView.findFixedItemById | public DrawerItem findFixedItemById(long id) {
for (DrawerItem item : mAdapterFixed.getItems()) {
if (item.getId() == id) {
return item;
}
}
return null;
} | java | public DrawerItem findFixedItemById(long id) {
for (DrawerItem item : mAdapterFixed.getItems()) {
if (item.getId() == id) {
return item;
}
}
return null;
} | [
"public",
"DrawerItem",
"findFixedItemById",
"(",
"long",
"id",
")",
"{",
"for",
"(",
"DrawerItem",
"item",
":",
"mAdapterFixed",
".",
"getItems",
"(",
")",
")",
"{",
"if",
"(",
"item",
".",
"getId",
"(",
")",
"==",
"id",
")",
"{",
"return",
"item",
... | Gets a fixed item from the drawer view
@param id The item ID
@return Item from the drawer view | [
"Gets",
"a",
"fixed",
"item",
"from",
"the",
"drawer",
"view"
] | 7c2406812d73f710ef8bb73d4a0f4bbef3b275ce | https://github.com/heinrichreimer/material-drawer/blob/7c2406812d73f710ef8bb73d4a0f4bbef3b275ce/library/src/main/java/com/heinrichreimersoftware/materialdrawer/DrawerView.java#L1508-L1515 | train |
heinrichreimer/material-drawer | library/src/main/java/com/heinrichreimersoftware/materialdrawer/DrawerView.java | DrawerView.clearFixedItems | public DrawerView clearFixedItems() {
for (DrawerItem item : mAdapterFixed.getItems()) {
item.detach();
}
mAdapterFixed.clear();
updateFixedList();
return this;
} | java | public DrawerView clearFixedItems() {
for (DrawerItem item : mAdapterFixed.getItems()) {
item.detach();
}
mAdapterFixed.clear();
updateFixedList();
return this;
} | [
"public",
"DrawerView",
"clearFixedItems",
"(",
")",
"{",
"for",
"(",
"DrawerItem",
"item",
":",
"mAdapterFixed",
".",
"getItems",
"(",
")",
")",
"{",
"item",
".",
"detach",
"(",
")",
";",
"}",
"mAdapterFixed",
".",
"clear",
"(",
")",
";",
"updateFixedLi... | Removes all fixed items from the drawer view | [
"Removes",
"all",
"fixed",
"items",
"from",
"the",
"drawer",
"view"
] | 7c2406812d73f710ef8bb73d4a0f4bbef3b275ce | https://github.com/heinrichreimer/material-drawer/blob/7c2406812d73f710ef8bb73d4a0f4bbef3b275ce/library/src/main/java/com/heinrichreimersoftware/materialdrawer/DrawerView.java#L1598-L1605 | train |
heinrichreimer/material-drawer | library/src/main/java/com/heinrichreimersoftware/materialdrawer/widget/LinearListView.java | LinearListView.setAdapter | public void setAdapter(ListAdapter adapter) {
if (mAdapter != null) {
mAdapter.unregisterDataSetObserver(mDataObserver);
}
mAdapter = adapter;
if (mAdapter != null) {
mAdapter.registerDataSetObserver(mDataObserver);
mAreAllItemsSelectable = mAdapter.... | java | public void setAdapter(ListAdapter adapter) {
if (mAdapter != null) {
mAdapter.unregisterDataSetObserver(mDataObserver);
}
mAdapter = adapter;
if (mAdapter != null) {
mAdapter.registerDataSetObserver(mDataObserver);
mAreAllItemsSelectable = mAdapter.... | [
"public",
"void",
"setAdapter",
"(",
"ListAdapter",
"adapter",
")",
"{",
"if",
"(",
"mAdapter",
"!=",
"null",
")",
"{",
"mAdapter",
".",
"unregisterDataSetObserver",
"(",
"mDataObserver",
")",
";",
"}",
"mAdapter",
"=",
"adapter",
";",
"if",
"(",
"mAdapter",... | Sets the data behind this LinearListView.
@param adapter The ListAdapter which is responsible for maintaining the data
backing this list and for producing a view to represent an
item in that data set.
@see #getAdapter() | [
"Sets",
"the",
"data",
"behind",
"this",
"LinearListView",
"."
] | 7c2406812d73f710ef8bb73d4a0f4bbef3b275ce | https://github.com/heinrichreimer/material-drawer/blob/7c2406812d73f710ef8bb73d4a0f4bbef3b275ce/library/src/main/java/com/heinrichreimersoftware/materialdrawer/widget/LinearListView.java#L128-L142 | train |
heinrichreimer/material-drawer | library/src/main/java/com/heinrichreimersoftware/materialdrawer/widget/LinearListView.java | LinearListView.setEmptyView | public void setEmptyView(View emptyView) {
mEmptyView = emptyView;
final ListAdapter adapter = getAdapter();
final boolean empty = ((adapter == null) || adapter.isEmpty());
updateEmptyStatus(empty);
} | java | public void setEmptyView(View emptyView) {
mEmptyView = emptyView;
final ListAdapter adapter = getAdapter();
final boolean empty = ((adapter == null) || adapter.isEmpty());
updateEmptyStatus(empty);
} | [
"public",
"void",
"setEmptyView",
"(",
"View",
"emptyView",
")",
"{",
"mEmptyView",
"=",
"emptyView",
";",
"final",
"ListAdapter",
"adapter",
"=",
"getAdapter",
"(",
")",
";",
"final",
"boolean",
"empty",
"=",
"(",
"(",
"adapter",
"==",
"null",
")",
"||",
... | Sets the view to show if the adapter is empty | [
"Sets",
"the",
"view",
"to",
"show",
"if",
"the",
"adapter",
"is",
"empty"
] | 7c2406812d73f710ef8bb73d4a0f4bbef3b275ce | https://github.com/heinrichreimer/material-drawer/blob/7c2406812d73f710ef8bb73d4a0f4bbef3b275ce/library/src/main/java/com/heinrichreimersoftware/materialdrawer/widget/LinearListView.java#L195-L201 | train |
Atmosphere/wasync | wasync/src/main/java/org/atmosphere/wasync/util/ReaderInputStream.java | ReaderInputStream.fillBuffer | private void fillBuffer() throws IOException {
if (!endOfInput && (lastCoderResult == null || lastCoderResult.isUnderflow())) {
encoderIn.compact();
int position = encoderIn.position();
// We don't use Reader#read(CharBuffer) here because it is more efficient
// t... | java | private void fillBuffer() throws IOException {
if (!endOfInput && (lastCoderResult == null || lastCoderResult.isUnderflow())) {
encoderIn.compact();
int position = encoderIn.position();
// We don't use Reader#read(CharBuffer) here because it is more efficient
// t... | [
"private",
"void",
"fillBuffer",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"endOfInput",
"&&",
"(",
"lastCoderResult",
"==",
"null",
"||",
"lastCoderResult",
".",
"isUnderflow",
"(",
")",
")",
")",
"{",
"encoderIn",
".",
"compact",
"(",
")",
... | Fills the internal char buffer from the reader.
@throws IOException If an I/O error occurs | [
"Fills",
"the",
"internal",
"char",
"buffer",
"from",
"the",
"reader",
"."
] | 0146828b2f5138d4cbb4872fcbfe7d6e1887ac14 | https://github.com/Atmosphere/wasync/blob/0146828b2f5138d4cbb4872fcbfe7d6e1887ac14/wasync/src/main/java/org/atmosphere/wasync/util/ReaderInputStream.java#L203-L221 | train |
Atmosphere/wasync | wasync/src/main/java/org/atmosphere/wasync/RequestBuilder.java | RequestBuilder.header | public T header(String name, String value) {
Collection<String> l = headers.get(name);
if (l == null) {
l = new ArrayList<String>();
}
l.add(value);
headers.put(name, l);
return derived.cast(this);
} | java | public T header(String name, String value) {
Collection<String> l = headers.get(name);
if (l == null) {
l = new ArrayList<String>();
}
l.add(value);
headers.put(name, l);
return derived.cast(this);
} | [
"public",
"T",
"header",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"Collection",
"<",
"String",
">",
"l",
"=",
"headers",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"l",
"==",
"null",
")",
"{",
"l",
"=",
"new",
"ArrayList",
"<",... | Add a header.
@param name header name
@param value header value
@return this | [
"Add",
"a",
"header",
"."
] | 0146828b2f5138d4cbb4872fcbfe7d6e1887ac14 | https://github.com/Atmosphere/wasync/blob/0146828b2f5138d4cbb4872fcbfe7d6e1887ac14/wasync/src/main/java/org/atmosphere/wasync/RequestBuilder.java#L109-L117 | train |
Atmosphere/wasync | wasync/src/main/java/org/atmosphere/wasync/RequestBuilder.java | RequestBuilder.queryString | public T queryString(String name, String value) {
List<String> l = queryString.get(name);
if (l == null) {
l = new ArrayList<String>();
}
l.add(value);
queryString.put(name, l);
return derived.cast(this);
} | java | public T queryString(String name, String value) {
List<String> l = queryString.get(name);
if (l == null) {
l = new ArrayList<String>();
}
l.add(value);
queryString.put(name, l);
return derived.cast(this);
} | [
"public",
"T",
"queryString",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"List",
"<",
"String",
">",
"l",
"=",
"queryString",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"l",
"==",
"null",
")",
"{",
"l",
"=",
"new",
"ArrayList",
"... | Add a query param.
@param name header name
@param value header value
@return this | [
"Add",
"a",
"query",
"param",
"."
] | 0146828b2f5138d4cbb4872fcbfe7d6e1887ac14 | https://github.com/Atmosphere/wasync/blob/0146828b2f5138d4cbb4872fcbfe7d6e1887ac14/wasync/src/main/java/org/atmosphere/wasync/RequestBuilder.java#L125-L133 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/Link.java | Link.create | public static Link create(final String text, final TextStyle ts, final NamedObject table) {
return new Link(text, ts, '#'+table.getName());
} | java | public static Link create(final String text, final TextStyle ts, final NamedObject table) {
return new Link(text, ts, '#'+table.getName());
} | [
"public",
"static",
"Link",
"create",
"(",
"final",
"String",
"text",
",",
"final",
"TextStyle",
"ts",
",",
"final",
"NamedObject",
"table",
")",
"{",
"return",
"new",
"Link",
"(",
"text",
",",
"ts",
",",
"'",
"'",
"+",
"table",
".",
"getName",
"(",
... | Create a new styled Link to a table
@param text the text content
@param ts the style
@param table the destination
@return the link | [
"Create",
"a",
"new",
"styled",
"Link",
"to",
"a",
"table"
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/Link.java#L51-L53 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/Link.java | Link.create | public static Link create(final String text, final NamedObject table) {
return new Link(text, null, '#'+table.getName());
} | java | public static Link create(final String text, final NamedObject table) {
return new Link(text, null, '#'+table.getName());
} | [
"public",
"static",
"Link",
"create",
"(",
"final",
"String",
"text",
",",
"final",
"NamedObject",
"table",
")",
"{",
"return",
"new",
"Link",
"(",
"text",
",",
"null",
",",
"'",
"'",
"+",
"table",
".",
"getName",
"(",
")",
")",
";",
"}"
] | Create a new Link to a table
@param text the text content
@param table the destination
@return the link | [
"Create",
"a",
"new",
"Link",
"to",
"a",
"table"
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/Link.java#L61-L63 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/Link.java | Link.create | public static Link create(final String text, final TextStyle ts, final String ref) {
return new Link(text, ts, '#'+ref);
} | java | public static Link create(final String text, final TextStyle ts, final String ref) {
return new Link(text, ts, '#'+ref);
} | [
"public",
"static",
"Link",
"create",
"(",
"final",
"String",
"text",
",",
"final",
"TextStyle",
"ts",
",",
"final",
"String",
"ref",
")",
"{",
"return",
"new",
"Link",
"(",
"text",
",",
"ts",
",",
"'",
"'",
"+",
"ref",
")",
";",
"}"
] | Create a new styled link to a given ref
@param text the text content
@param ts the style
@param ref the ref
@return the link | [
"Create",
"a",
"new",
"styled",
"link",
"to",
"a",
"given",
"ref"
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/Link.java#L73-L75 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/Link.java | Link.create | public static Link create(final String text, final String ref) {
return new Link(text, null, '#'+ref);
} | java | public static Link create(final String text, final String ref) {
return new Link(text, null, '#'+ref);
} | [
"public",
"static",
"Link",
"create",
"(",
"final",
"String",
"text",
",",
"final",
"String",
"ref",
")",
"{",
"return",
"new",
"Link",
"(",
"text",
",",
"null",
",",
"'",
"'",
"+",
"ref",
")",
";",
"}"
] | Create a new link to a given ref
@param text the text content
@param ref the ref
@return the link | [
"Create",
"a",
"new",
"link",
"to",
"a",
"given",
"ref"
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/Link.java#L83-L85 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/Link.java | Link.create | public static Link create(final String text, final TextStyle ts, final File file) {
return new Link(text, ts, file.toURI().toString());
} | java | public static Link create(final String text, final TextStyle ts, final File file) {
return new Link(text, ts, file.toURI().toString());
} | [
"public",
"static",
"Link",
"create",
"(",
"final",
"String",
"text",
",",
"final",
"TextStyle",
"ts",
",",
"final",
"File",
"file",
")",
"{",
"return",
"new",
"Link",
"(",
"text",
",",
"ts",
",",
"file",
".",
"toURI",
"(",
")",
".",
"toString",
"(",... | Create a new styled link to a given file
@param text the text content
@param ts the style
@param file the file
@return the link | [
"Create",
"a",
"new",
"styled",
"link",
"to",
"a",
"given",
"file"
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/Link.java#L94-L96 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/Link.java | Link.create | public static Link create(final String text, final File file) {
return new Link(text, null, file.toURI().toString());
} | java | public static Link create(final String text, final File file) {
return new Link(text, null, file.toURI().toString());
} | [
"public",
"static",
"Link",
"create",
"(",
"final",
"String",
"text",
",",
"final",
"File",
"file",
")",
"{",
"return",
"new",
"Link",
"(",
"text",
",",
"null",
",",
"file",
".",
"toURI",
"(",
")",
".",
"toString",
"(",
")",
")",
";",
"}"
] | Create a new link to a given file
@param text the text content
@param file the file
@return the link | [
"Create",
"a",
"new",
"link",
"to",
"a",
"given",
"file"
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/Link.java#L104-L106 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/Link.java | Link.create | public static Link create(final String text, final TextStyle ts, final URL url) {
return new Link(text, ts, url.toString());
} | java | public static Link create(final String text, final TextStyle ts, final URL url) {
return new Link(text, ts, url.toString());
} | [
"public",
"static",
"Link",
"create",
"(",
"final",
"String",
"text",
",",
"final",
"TextStyle",
"ts",
",",
"final",
"URL",
"url",
")",
"{",
"return",
"new",
"Link",
"(",
"text",
",",
"ts",
",",
"url",
".",
"toString",
"(",
")",
")",
";",
"}"
] | Create a new styled link to a given url
@param text the text content
@param ts the style
@param url the file
@return the link | [
"Create",
"a",
"new",
"styled",
"link",
"to",
"a",
"given",
"url"
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/Link.java#L115-L117 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/Link.java | Link.create | public static Link create(final String text, final URL url) {
return new Link(text, null, url.toString());
} | java | public static Link create(final String text, final URL url) {
return new Link(text, null, url.toString());
} | [
"public",
"static",
"Link",
"create",
"(",
"final",
"String",
"text",
",",
"final",
"URL",
"url",
")",
"{",
"return",
"new",
"Link",
"(",
"text",
",",
"null",
",",
"url",
".",
"toString",
"(",
")",
")",
";",
"}"
] | Create a new link to a given url
@param text the text content
@param url the file
@return the link | [
"Create",
"a",
"new",
"link",
"to",
"a",
"given",
"url"
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/Link.java#L125-L127 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/style/TableCellStyleBuilder.java | TableCellStyleBuilder.borderAll | public TableCellStyleBuilder borderAll(final Length size, final Color borderColor,
final BorderAttribute.Style style) {
final BorderAttribute bs = new BorderAttribute(size, borderColor, style);
this.bordersBuilder.all(bs);
return this;
} | java | public TableCellStyleBuilder borderAll(final Length size, final Color borderColor,
final BorderAttribute.Style style) {
final BorderAttribute bs = new BorderAttribute(size, borderColor, style);
this.bordersBuilder.all(bs);
return this;
} | [
"public",
"TableCellStyleBuilder",
"borderAll",
"(",
"final",
"Length",
"size",
",",
"final",
"Color",
"borderColor",
",",
"final",
"BorderAttribute",
".",
"Style",
"style",
")",
"{",
"final",
"BorderAttribute",
"bs",
"=",
"new",
"BorderAttribute",
"(",
"size",
... | Add a border style for all the borders of this cell.
@param size the size of the line
@param borderColor the color to be used in format #rrggbb e.g. '#ff0000' for a red border
@param style the style of the border line, either BorderAttribute.BORDER_SOLID or BorderAttribute.BORDER_DOUBLE
@return this for f... | [
"Add",
"a",
"border",
"style",
"for",
"all",
"the",
"borders",
"of",
"this",
"cell",
"."
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/style/TableCellStyleBuilder.java#L98-L103 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/style/TableCellStyleBuilder.java | TableCellStyleBuilder.borderBottom | public TableCellStyleBuilder borderBottom(final Length size, final Color borderColor,
final BorderAttribute.Style style) {
final BorderAttribute bs = new BorderAttribute(size, borderColor, style);
this.bordersBuilder.bottom(bs);
return this;
} | java | public TableCellStyleBuilder borderBottom(final Length size, final Color borderColor,
final BorderAttribute.Style style) {
final BorderAttribute bs = new BorderAttribute(size, borderColor, style);
this.bordersBuilder.bottom(bs);
return this;
} | [
"public",
"TableCellStyleBuilder",
"borderBottom",
"(",
"final",
"Length",
"size",
",",
"final",
"Color",
"borderColor",
",",
"final",
"BorderAttribute",
".",
"Style",
"style",
")",
"{",
"final",
"BorderAttribute",
"bs",
"=",
"new",
"BorderAttribute",
"(",
"size",... | Add a border style for the bottom border of this cell.
@param size the size of the line
@param borderColor the color to be used in format #rrggbb e.g. '#ff0000' for a red border
@param style the style of the border line, either BorderAttribute.BORDER_SOLID or BorderAttribute.BORDER_DOUBLE
@return this for... | [
"Add",
"a",
"border",
"style",
"for",
"the",
"bottom",
"border",
"of",
"this",
"cell",
"."
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/style/TableCellStyleBuilder.java#L113-L118 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/style/TableCellStyleBuilder.java | TableCellStyleBuilder.borderLeft | public TableCellStyleBuilder borderLeft(final Length size, final Color borderColor,
final BorderAttribute.Style style) {
final BorderAttribute bs = new BorderAttribute(size, borderColor, style);
this.bordersBuilder.left(bs);
return this;
} | java | public TableCellStyleBuilder borderLeft(final Length size, final Color borderColor,
final BorderAttribute.Style style) {
final BorderAttribute bs = new BorderAttribute(size, borderColor, style);
this.bordersBuilder.left(bs);
return this;
} | [
"public",
"TableCellStyleBuilder",
"borderLeft",
"(",
"final",
"Length",
"size",
",",
"final",
"Color",
"borderColor",
",",
"final",
"BorderAttribute",
".",
"Style",
"style",
")",
"{",
"final",
"BorderAttribute",
"bs",
"=",
"new",
"BorderAttribute",
"(",
"size",
... | Add a border style for the left border of this cell.
@param size the size of the line
@param borderColor the color to be used in format #rrggbb e.g. '#ff0000' for a red border
@param style the style of the border line, either BorderAttribute.BORDER_SOLID or BorderAttribute.BORDER_DOUBLE
@return this for f... | [
"Add",
"a",
"border",
"style",
"for",
"the",
"left",
"border",
"of",
"this",
"cell",
"."
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/style/TableCellStyleBuilder.java#L128-L133 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/style/TableCellStyleBuilder.java | TableCellStyleBuilder.borderRight | public TableCellStyleBuilder borderRight(final Length size, final Color borderColor,
final BorderAttribute.Style style) {
final BorderAttribute bs = new BorderAttribute(size, borderColor, style);
this.bordersBuilder.right(bs);
return this;
} | java | public TableCellStyleBuilder borderRight(final Length size, final Color borderColor,
final BorderAttribute.Style style) {
final BorderAttribute bs = new BorderAttribute(size, borderColor, style);
this.bordersBuilder.right(bs);
return this;
} | [
"public",
"TableCellStyleBuilder",
"borderRight",
"(",
"final",
"Length",
"size",
",",
"final",
"Color",
"borderColor",
",",
"final",
"BorderAttribute",
".",
"Style",
"style",
")",
"{",
"final",
"BorderAttribute",
"bs",
"=",
"new",
"BorderAttribute",
"(",
"size",
... | Add a border style for the right border of this cell.
@param size the size of the line
@param borderColor the color to be used in format #rrggbb e.g. '#ff0000' for a red border
@param style the style of the border line, either BorderAttribute.BORDER_SOLID or BorderAttribute.BORDER_DOUBLE
@return this for ... | [
"Add",
"a",
"border",
"style",
"for",
"the",
"right",
"border",
"of",
"this",
"cell",
"."
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/style/TableCellStyleBuilder.java#L143-L148 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/style/TableCellStyleBuilder.java | TableCellStyleBuilder.borderTop | public TableCellStyleBuilder borderTop(final Length size, final Color borderColor,
final BorderAttribute.Style style) {
final BorderAttribute bs = new BorderAttribute(size, borderColor, style);
this.bordersBuilder.top(bs);
return this;
} | java | public TableCellStyleBuilder borderTop(final Length size, final Color borderColor,
final BorderAttribute.Style style) {
final BorderAttribute bs = new BorderAttribute(size, borderColor, style);
this.bordersBuilder.top(bs);
return this;
} | [
"public",
"TableCellStyleBuilder",
"borderTop",
"(",
"final",
"Length",
"size",
",",
"final",
"Color",
"borderColor",
",",
"final",
"BorderAttribute",
".",
"Style",
"style",
")",
"{",
"final",
"BorderAttribute",
"bs",
"=",
"new",
"BorderAttribute",
"(",
"size",
... | Add a border style for the top border of this cell.
@param size the size of the line
@param borderColor the color to be used in format #rrggbb e.g. '#ff0000' for a red border
@param style the style of the border line, either BorderAttribute.BORDER_SOLID or BorderAttribute.BORDER_DOUBLE
@return this for fl... | [
"Add",
"a",
"border",
"style",
"for",
"the",
"top",
"border",
"of",
"this",
"cell",
"."
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/style/TableCellStyleBuilder.java#L158-L163 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/util/Container.java | Container.add | public boolean add(final K key, final V value) {
final V curValue = this.valueByKey.get(key);
if (curValue == null) { // key does not exist
if (this.mode == Mode.UPDATE)
return false;
} else { // key exists
if (this.mode == Mode.CREATE)
return false;
}
if (this.closed && !this.valueByKey.conta... | java | public boolean add(final K key, final V value) {
final V curValue = this.valueByKey.get(key);
if (curValue == null) { // key does not exist
if (this.mode == Mode.UPDATE)
return false;
} else { // key exists
if (this.mode == Mode.CREATE)
return false;
}
if (this.closed && !this.valueByKey.conta... | [
"public",
"boolean",
"add",
"(",
"final",
"K",
"key",
",",
"final",
"V",
"value",
")",
"{",
"final",
"V",
"curValue",
"=",
"this",
".",
"valueByKey",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"curValue",
"==",
"null",
")",
"{",
"// key does not ex... | If mode is update, then the key must exist. If the mode is create, then the key must not exist.
Otherwise, the key may exist. If the container is frozen, no new key-value pair is accepted.
@param key the key
@param value the value
@return true if the value was updated | [
"If",
"mode",
"is",
"update",
"then",
"the",
"key",
"must",
"exist",
".",
"If",
"the",
"mode",
"is",
"create",
"then",
"the",
"key",
"must",
"not",
"exist",
".",
"Otherwise",
"the",
"key",
"may",
"exist",
".",
"If",
"the",
"container",
"is",
"frozen",
... | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/util/Container.java#L71-L92 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/util/XMLUtil.java | XMLUtil.appendEAttribute | public void appendEAttribute(final Appendable appendable,
final CharSequence attrName, final String attrRawValue)
throws IOException {
appendable.append(' ').append(attrName).append("=\"")
.append(this.escaper.escapeXMLAttribute(attrRawValue))
.append('"');
} | java | public void appendEAttribute(final Appendable appendable,
final CharSequence attrName, final String attrRawValue)
throws IOException {
appendable.append(' ').append(attrName).append("=\"")
.append(this.escaper.escapeXMLAttribute(attrRawValue))
.append('"');
} | [
"public",
"void",
"appendEAttribute",
"(",
"final",
"Appendable",
"appendable",
",",
"final",
"CharSequence",
"attrName",
",",
"final",
"String",
"attrRawValue",
")",
"throws",
"IOException",
"{",
"appendable",
".",
"append",
"(",
"'",
"'",
")",
".",
"append",
... | Append a space and new element to the appendable element, the name of the element is
attrName and the value is attrRawValue. The will be escaped if necessary
@param appendable The StringBuilder to which the new element should be added.
@param attrName The new element name
@param attrRawValue The value of the ele... | [
"Append",
"a",
"space",
"and",
"new",
"element",
"to",
"the",
"appendable",
"element",
"the",
"name",
"of",
"the",
"element",
"is",
"attrName",
"and",
"the",
"value",
"is",
"attrRawValue",
".",
"The",
"will",
"be",
"escaped",
"if",
"necessary"
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/util/XMLUtil.java#L65-L71 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/util/XMLUtil.java | XMLUtil.appendAttribute | public void appendAttribute(final Appendable appendable,
final CharSequence attrName, final boolean attrValue) throws IOException {
this.appendAttribute(appendable, attrName,
Boolean.toString(attrValue));
} | java | public void appendAttribute(final Appendable appendable,
final CharSequence attrName, final boolean attrValue) throws IOException {
this.appendAttribute(appendable, attrName,
Boolean.toString(attrValue));
} | [
"public",
"void",
"appendAttribute",
"(",
"final",
"Appendable",
"appendable",
",",
"final",
"CharSequence",
"attrName",
",",
"final",
"boolean",
"attrValue",
")",
"throws",
"IOException",
"{",
"this",
".",
"appendAttribute",
"(",
"appendable",
",",
"attrName",
",... | Append a new element to the appendable element, the name of the element is
attrName and the value is the boolean attrValue.
@param appendable The StringBuilder to which the new element should be added.
@param attrName The new element name
@param attrValue The value of the element
@throws IOException If an I/O error... | [
"Append",
"a",
"new",
"element",
"to",
"the",
"appendable",
"element",
"the",
"name",
"of",
"the",
"element",
"is",
"attrName",
"and",
"the",
"value",
"is",
"the",
"boolean",
"attrValue",
"."
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/util/XMLUtil.java#L82-L86 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/util/XMLUtil.java | XMLUtil.appendAttribute | public void appendAttribute(final Appendable appendable,
final CharSequence attrName, final CharSequence attrValue) throws IOException {
appendable.append(' ').append(attrName).append("=\"").append(attrValue)
.append('"');
} | java | public void appendAttribute(final Appendable appendable,
final CharSequence attrName, final CharSequence attrValue) throws IOException {
appendable.append(' ').append(attrName).append("=\"").append(attrValue)
.append('"');
} | [
"public",
"void",
"appendAttribute",
"(",
"final",
"Appendable",
"appendable",
",",
"final",
"CharSequence",
"attrName",
",",
"final",
"CharSequence",
"attrValue",
")",
"throws",
"IOException",
"{",
"appendable",
".",
"append",
"(",
"'",
"'",
")",
".",
"append",... | Append a space, then a new element to the appendable element, the name of the element is
attrName and the value is attrValue. The value won't be escaped.
@param appendable where to write
@param attrName the name of the attribute
@param attrValue escaped attribute
@throws IOException If an I/O error occurs | [
"Append",
"a",
"space",
"then",
"a",
"new",
"element",
"to",
"the",
"appendable",
"element",
"the",
"name",
"of",
"the",
"element",
"is",
"attrName",
"and",
"the",
"value",
"is",
"attrValue",
".",
"The",
"value",
"won",
"t",
"be",
"escaped",
"."
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/util/XMLUtil.java#L112-L116 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/util/XMLUtil.java | XMLUtil.appendTag | public void appendTag(final Appendable appendable, final CharSequence tagName,
final String content) throws IOException {
appendable.append('<').append(tagName).append('>')
.append(this.escaper.escapeXMLContent(content)).append("</")
.append(tagName).append('>');
} | java | public void appendTag(final Appendable appendable, final CharSequence tagName,
final String content) throws IOException {
appendable.append('<').append(tagName).append('>')
.append(this.escaper.escapeXMLContent(content)).append("</")
.append(tagName).append('>');
} | [
"public",
"void",
"appendTag",
"(",
"final",
"Appendable",
"appendable",
",",
"final",
"CharSequence",
"tagName",
",",
"final",
"String",
"content",
")",
"throws",
"IOException",
"{",
"appendable",
".",
"append",
"(",
"'",
"'",
")",
".",
"append",
"(",
"tagN... | Append a content inside a tag
@param appendable the destination
@param tagName the tag name
@param content the content
@throws IOException if an I/O error occurs | [
"Append",
"a",
"content",
"inside",
"a",
"tag"
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/util/XMLUtil.java#L125-L130 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/OdsFactory.java | OdsFactory.create | public static OdsFactory create(final Logger logger, final Locale locale) {
final PositionUtil positionUtil = new PositionUtil(new EqualityUtil(), new TableNameUtil());
final WriteUtil writeUtil = WriteUtil.create();
final XMLUtil xmlUtil = XMLUtil.create();
final DataStyles format =... | java | public static OdsFactory create(final Logger logger, final Locale locale) {
final PositionUtil positionUtil = new PositionUtil(new EqualityUtil(), new TableNameUtil());
final WriteUtil writeUtil = WriteUtil.create();
final XMLUtil xmlUtil = XMLUtil.create();
final DataStyles format =... | [
"public",
"static",
"OdsFactory",
"create",
"(",
"final",
"Logger",
"logger",
",",
"final",
"Locale",
"locale",
")",
"{",
"final",
"PositionUtil",
"positionUtil",
"=",
"new",
"PositionUtil",
"(",
"new",
"EqualityUtil",
"(",
")",
",",
"new",
"TableNameUtil",
"(... | create an ods factory
@param logger the logger
@param locale the locale
@return the factory | [
"create",
"an",
"ods",
"factory"
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/OdsFactory.java#L68-L74 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/OdsFactory.java | OdsFactory.createAnonymousDocument | private AnonymousOdsDocument createAnonymousDocument() {
final OdsElements odsElements = OdsElements
.create(this.positionUtil, this.xmlUtil, this.writeUtil, this.format,
this.libreOfficeMode);
return AnonymousOdsDocument.create(this.logger, this.xmlUtil, odsE... | java | private AnonymousOdsDocument createAnonymousDocument() {
final OdsElements odsElements = OdsElements
.create(this.positionUtil, this.xmlUtil, this.writeUtil, this.format,
this.libreOfficeMode);
return AnonymousOdsDocument.create(this.logger, this.xmlUtil, odsE... | [
"private",
"AnonymousOdsDocument",
"createAnonymousDocument",
"(",
")",
"{",
"final",
"OdsElements",
"odsElements",
"=",
"OdsElements",
".",
"create",
"(",
"this",
".",
"positionUtil",
",",
"this",
".",
"xmlUtil",
",",
"this",
".",
"writeUtil",
",",
"this",
".",... | Create a new, empty document for an anonymous writer. Use addTable to add tables.
@return a new document | [
"Create",
"a",
"new",
"empty",
"document",
"for",
"an",
"anonymous",
"writer",
".",
"Use",
"addTable",
"to",
"add",
"tables",
"."
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/OdsFactory.java#L130-L135 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/OdsFactory.java | OdsFactory.createNamedDocument | private NamedOdsDocument createNamedDocument() {
final OdsElements odsElements = OdsElements
.create(this.positionUtil, this.xmlUtil, this.writeUtil, this.format,
this.libreOfficeMode);
return NamedOdsDocument.create(this.logger, this.xmlUtil, odsElements);
... | java | private NamedOdsDocument createNamedDocument() {
final OdsElements odsElements = OdsElements
.create(this.positionUtil, this.xmlUtil, this.writeUtil, this.format,
this.libreOfficeMode);
return NamedOdsDocument.create(this.logger, this.xmlUtil, odsElements);
... | [
"private",
"NamedOdsDocument",
"createNamedDocument",
"(",
")",
"{",
"final",
"OdsElements",
"odsElements",
"=",
"OdsElements",
".",
"create",
"(",
"this",
".",
"positionUtil",
",",
"this",
".",
"xmlUtil",
",",
"this",
".",
"writeUtil",
",",
"this",
".",
"form... | Create a new, empty document for a normal writer. Use addTable to add tables.
@return a new document | [
"Create",
"a",
"new",
"empty",
"document",
"for",
"a",
"normal",
"writer",
".",
"Use",
"addTable",
"to",
"add",
"tables",
"."
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/OdsFactory.java#L142-L147 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/OdsFactory.java | OdsFactory.createWriterAdapter | public OdsFileWriterAdapter createWriterAdapter(final File file) throws IOException {
final NamedOdsDocument document = this.createNamedDocument();
final ZipUTF8WriterBuilder zipUTF8Writer = ZipUTF8WriterImpl.builder().noWriterBuffer();
final OdsFileWriterAdapter writerAdapter = OdsFileWriter... | java | public OdsFileWriterAdapter createWriterAdapter(final File file) throws IOException {
final NamedOdsDocument document = this.createNamedDocument();
final ZipUTF8WriterBuilder zipUTF8Writer = ZipUTF8WriterImpl.builder().noWriterBuffer();
final OdsFileWriterAdapter writerAdapter = OdsFileWriter... | [
"public",
"OdsFileWriterAdapter",
"createWriterAdapter",
"(",
"final",
"File",
"file",
")",
"throws",
"IOException",
"{",
"final",
"NamedOdsDocument",
"document",
"=",
"this",
".",
"createNamedDocument",
"(",
")",
";",
"final",
"ZipUTF8WriterBuilder",
"zipUTF8Writer",
... | Create an adapter for a writer.
@param file the file
@return the adapter
@throws IOException if an I/O error occurs | [
"Create",
"an",
"adapter",
"for",
"a",
"writer",
"."
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/OdsFactory.java#L198-L207 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/util/PositionUtil.java | PositionUtil.getPosition | public Position getPosition(final String pos) {
final String s = pos.toUpperCase(Locale.US);
final int len = s.length();
int status = 0;
int row = 0;
int col = 0;
int n = 0;
while (n < len) {
final char c = s.charAt(n);
switch (s... | java | public Position getPosition(final String pos) {
final String s = pos.toUpperCase(Locale.US);
final int len = s.length();
int status = 0;
int row = 0;
int col = 0;
int n = 0;
while (n < len) {
final char c = s.charAt(n);
switch (s... | [
"public",
"Position",
"getPosition",
"(",
"final",
"String",
"pos",
")",
"{",
"final",
"String",
"s",
"=",
"pos",
".",
"toUpperCase",
"(",
"Locale",
".",
"US",
")",
";",
"final",
"int",
"len",
"=",
"s",
".",
"length",
"(",
")",
";",
"int",
"status",
... | Convert a cell position string like B3 to the column number.
@param pos The cell position in the range 'A1' to 'IV65536'
@return The row, e.g. A1 will return 0, B1 will return 1, E1 will return
4 | [
"Convert",
"a",
"cell",
"position",
"string",
"like",
"B3",
"to",
"the",
"column",
"number",
"."
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/util/PositionUtil.java#L169-L217 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/util/ColorHelper.java | ColorHelper.fromRGB | public static Color fromRGB(final int red, final int green, final int blue) {
if (ColorHelper.helper == null)
ColorHelper.helper = new ColorHelper();
return ColorHelper.helper.getFromRGB(red, green, blue);
} | java | public static Color fromRGB(final int red, final int green, final int blue) {
if (ColorHelper.helper == null)
ColorHelper.helper = new ColorHelper();
return ColorHelper.helper.getFromRGB(red, green, blue);
} | [
"public",
"static",
"Color",
"fromRGB",
"(",
"final",
"int",
"red",
",",
"final",
"int",
"green",
",",
"final",
"int",
"blue",
")",
"{",
"if",
"(",
"ColorHelper",
".",
"helper",
"==",
"null",
")",
"ColorHelper",
".",
"helper",
"=",
"new",
"ColorHelper",
... | Create a color from RGB values
@param red the red value, between 0-255
@param green the green value, between 0-255
@param blue the blue value, between 0-255
@return the color | [
"Create",
"a",
"color",
"from",
"RGB",
"values"
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/util/ColorHelper.java#L48-L52 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/util/ColorHelper.java | ColorHelper.getFromRGB | public Color getFromRGB(final int red, final int green, final int blue) {
return this.getFromString("#" + this.toHexString(red) + this.toHexString(green) + this
.toHexString(blue));
} | java | public Color getFromRGB(final int red, final int green, final int blue) {
return this.getFromString("#" + this.toHexString(red) + this.toHexString(green) + this
.toHexString(blue));
} | [
"public",
"Color",
"getFromRGB",
"(",
"final",
"int",
"red",
",",
"final",
"int",
"green",
",",
"final",
"int",
"blue",
")",
"{",
"return",
"this",
".",
"getFromString",
"(",
"\"#\"",
"+",
"this",
".",
"toHexString",
"(",
"red",
")",
"+",
"this",
".",
... | Helper function to create any available color string from color values.
@param red The red value, 0-255
@param green The green value, 0-255
@param blue The blue value, 0-255
@return The hex string in the format '#rrggbb' | [
"Helper",
"function",
"to",
"create",
"any",
"available",
"color",
"string",
"from",
"color",
"values",
"."
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/util/ColorHelper.java#L87-L90 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/datastyle/FractionStyleBuilder.java | FractionStyleBuilder.create | public static FractionStyleBuilder create(final String name, final Locale locale) {
checker.checkStyleName(name);
return new FractionStyleBuilder(name, locale);
} | java | public static FractionStyleBuilder create(final String name, final Locale locale) {
checker.checkStyleName(name);
return new FractionStyleBuilder(name, locale);
} | [
"public",
"static",
"FractionStyleBuilder",
"create",
"(",
"final",
"String",
"name",
",",
"final",
"Locale",
"locale",
")",
"{",
"checker",
".",
"checkStyleName",
"(",
"name",
")",
";",
"return",
"new",
"FractionStyleBuilder",
"(",
"name",
",",
"locale",
")",... | Create a new number style builder with the name name, minimum integer digits is
minIntDigits and decimal places is decPlaces.
@param name The name of the number style, this name must be unique.
@param locale The locale used
@return the builder | [
"Create",
"a",
"new",
"number",
"style",
"builder",
"with",
"the",
"name",
"name",
"minimum",
"integer",
"digits",
"is",
"minIntDigits",
"and",
"decimal",
"places",
"is",
"decPlaces",
"."
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/datastyle/FractionStyleBuilder.java#L46-L49 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/style/TableColumnStyle.java | TableColumnStyle.appendXMLToTable | public void appendXMLToTable(final XMLUtil util, final Appendable appendable, final int count)
throws IOException {
appendable.append("<table:table-column");
util.appendEAttribute(appendable, "table:style-name", this.name);
if (count > 1) util.appendAttribute(appendable, "table:n... | java | public void appendXMLToTable(final XMLUtil util, final Appendable appendable, final int count)
throws IOException {
appendable.append("<table:table-column");
util.appendEAttribute(appendable, "table:style-name", this.name);
if (count > 1) util.appendAttribute(appendable, "table:n... | [
"public",
"void",
"appendXMLToTable",
"(",
"final",
"XMLUtil",
"util",
",",
"final",
"Appendable",
"appendable",
",",
"final",
"int",
"count",
")",
"throws",
"IOException",
"{",
"appendable",
".",
"append",
"(",
"\"<table:table-column\"",
")",
";",
"util",
".",
... | Append the XML to the table representation
@param util an util
@param appendable the destination
@param count the number of columns concerned
@throws IOException if an I/O error occurs | [
"Append",
"the",
"XML",
"to",
"the",
"table",
"representation"
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/style/TableColumnStyle.java#L109-L118 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/style/TableColumnStyle.java | TableColumnStyle.addToContentStyles | public void addToContentStyles(final StylesContainer stylesContainer) {
stylesContainer.addContentStyle(this);
if (this.defaultCellStyle != null) {
stylesContainer.addContentStyle(this.defaultCellStyle);
}
} | java | public void addToContentStyles(final StylesContainer stylesContainer) {
stylesContainer.addContentStyle(this);
if (this.defaultCellStyle != null) {
stylesContainer.addContentStyle(this.defaultCellStyle);
}
} | [
"public",
"void",
"addToContentStyles",
"(",
"final",
"StylesContainer",
"stylesContainer",
")",
"{",
"stylesContainer",
".",
"addContentStyle",
"(",
"this",
")",
";",
"if",
"(",
"this",
".",
"defaultCellStyle",
"!=",
"null",
")",
"{",
"stylesContainer",
".",
"a... | Add this style to a styles container
@param stylesContainer the styles container | [
"Add",
"this",
"style",
"to",
"a",
"styles",
"container"
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/style/TableColumnStyle.java#L179-L184 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/odselement/MetaElement.java | MetaElement.setDateTimeNow | private void setDateTimeNow() {
final Date dt = new Date();
this.dateTime = MetaElement.DF_DATE.format(dt) +
"T" + MetaElement.DF_TIME.format(dt);
} | java | private void setDateTimeNow() {
final Date dt = new Date();
this.dateTime = MetaElement.DF_DATE.format(dt) +
"T" + MetaElement.DF_TIME.format(dt);
} | [
"private",
"void",
"setDateTimeNow",
"(",
")",
"{",
"final",
"Date",
"dt",
"=",
"new",
"Date",
"(",
")",
";",
"this",
".",
"dateTime",
"=",
"MetaElement",
".",
"DF_DATE",
".",
"format",
"(",
"dt",
")",
"+",
"\"T\"",
"+",
"MetaElement",
".",
"DF_TIME",
... | Store the date and time of the document creation in the MetaElement data. | [
"Store",
"the",
"date",
"and",
"time",
"of",
"the",
"document",
"creation",
"in",
"the",
"MetaElement",
"data",
"."
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/odselement/MetaElement.java#L115-L120 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/tool/FastOdsBus.java | FastOdsBus.get | synchronized public E get() {
if (this.isClosed())
throw new NoSuchElementException();
while (this.elements.isEmpty()) {
try {
this.wait();
} catch (final InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
}
return this.elements.remove();
} | java | synchronized public E get() {
if (this.isClosed())
throw new NoSuchElementException();
while (this.elements.isEmpty()) {
try {
this.wait();
} catch (final InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
}
return this.elements.remove();
} | [
"synchronized",
"public",
"E",
"get",
"(",
")",
"{",
"if",
"(",
"this",
".",
"isClosed",
"(",
")",
")",
"throw",
"new",
"NoSuchElementException",
"(",
")",
";",
"while",
"(",
"this",
".",
"elements",
".",
"isEmpty",
"(",
")",
")",
"{",
"try",
"{",
... | Get an element from the bus. Blocking method.
@return the next element in the bus | [
"Get",
"an",
"element",
"from",
"the",
"bus",
".",
"Blocking",
"method",
"."
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/tool/FastOdsBus.java#L81-L94 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/tool/FastOds.java | FastOds.openFile | public static boolean openFile(final File f) {
if (desktop != null && f.exists() && f.isFile()) {
try {
desktop.open(f);
return true;
} catch (final IOException e) {
Logger.getLogger(FastOds.class.getName()).log(Level.SEVERE,
"Can't open file " + f + " in appropriate application",
e);
... | java | public static boolean openFile(final File f) {
if (desktop != null && f.exists() && f.isFile()) {
try {
desktop.open(f);
return true;
} catch (final IOException e) {
Logger.getLogger(FastOds.class.getName()).log(Level.SEVERE,
"Can't open file " + f + " in appropriate application",
e);
... | [
"public",
"static",
"boolean",
"openFile",
"(",
"final",
"File",
"f",
")",
"{",
"if",
"(",
"desktop",
"!=",
"null",
"&&",
"f",
".",
"exists",
"(",
")",
"&&",
"f",
".",
"isFile",
"(",
")",
")",
"{",
"try",
"{",
"desktop",
".",
"open",
"(",
"f",
... | Opens a file with the default application.
@param f
the file to open
@return true if succeeded, false otherwise. | [
"Opens",
"a",
"file",
"with",
"the",
"default",
"application",
"."
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/tool/FastOds.java#L68-L80 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/AnonymousOdsFileWriter.java | AnonymousOdsFileWriter.saveAs | public void saveAs(final File file) throws IOException {
try {
final FileOutputStream out = new FileOutputStream(file);
try {
this.save(out);
} finally {
out.flush();
out.close();
}
} catch (final Fi... | java | public void saveAs(final File file) throws IOException {
try {
final FileOutputStream out = new FileOutputStream(file);
try {
this.save(out);
} finally {
out.flush();
out.close();
}
} catch (final Fi... | [
"public",
"void",
"saveAs",
"(",
"final",
"File",
"file",
")",
"throws",
"IOException",
"{",
"try",
"{",
"final",
"FileOutputStream",
"out",
"=",
"new",
"FileOutputStream",
"(",
"file",
")",
";",
"try",
"{",
"this",
".",
"save",
"(",
"out",
")",
";",
"... | Save the new file.
@param file the destination file
@throws IOException If an I/O error occurs | [
"Save",
"the",
"new",
"file",
"."
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/AnonymousOdsFileWriter.java#L111-L127 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/AnonymousOdsFileWriter.java | AnonymousOdsFileWriter.saveAs | public void saveAs(final String filename, final ZipUTF8WriterBuilder builder)
throws IOException {
try {
final FileOutputStream out = new FileOutputStream(filename);
final ZipUTF8Writer writer = builder.build(out);
try {
this.save(writer);
... | java | public void saveAs(final String filename, final ZipUTF8WriterBuilder builder)
throws IOException {
try {
final FileOutputStream out = new FileOutputStream(filename);
final ZipUTF8Writer writer = builder.build(out);
try {
this.save(writer);
... | [
"public",
"void",
"saveAs",
"(",
"final",
"String",
"filename",
",",
"final",
"ZipUTF8WriterBuilder",
"builder",
")",
"throws",
"IOException",
"{",
"try",
"{",
"final",
"FileOutputStream",
"out",
"=",
"new",
"FileOutputStream",
"(",
"filename",
")",
";",
"final"... | Save the document to filename.
@param filename the name of the destination file
@param builder a builder for the ZipOutputStream and the Writer (buffers,
level, ...)
@throws IOException if the file was not saved | [
"Save",
"the",
"document",
"to",
"filename",
"."
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/AnonymousOdsFileWriter.java#L136-L150 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/PageSectionBuilder.java | PageSectionBuilder.content | public F content(final String string) {
this.curRegionBox.set(Text.content(string));
return (F) this;
} | java | public F content(final String string) {
this.curRegionBox.set(Text.content(string));
return (F) this;
} | [
"public",
"F",
"content",
"(",
"final",
"String",
"string",
")",
"{",
"this",
".",
"curRegionBox",
".",
"set",
"(",
"Text",
".",
"content",
"(",
"string",
")",
")",
";",
"return",
"(",
"F",
")",
"this",
";",
"}"
] | Set the text content of the section
@param string the text
@return this for fluent style | [
"Set",
"the",
"text",
"content",
"of",
"the",
"section"
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/PageSectionBuilder.java#L87-L90 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/PageSection.java | PageSection.simpleFooter | public static Footer simpleFooter(final String text, final TextStyle ts) {
return new SimplePageSectionBuilder().text(Text.styledContent(text, ts)).buildFooter();
} | java | public static Footer simpleFooter(final String text, final TextStyle ts) {
return new SimplePageSectionBuilder().text(Text.styledContent(text, ts)).buildFooter();
} | [
"public",
"static",
"Footer",
"simpleFooter",
"(",
"final",
"String",
"text",
",",
"final",
"TextStyle",
"ts",
")",
"{",
"return",
"new",
"SimplePageSectionBuilder",
"(",
")",
".",
"text",
"(",
"Text",
".",
"styledContent",
"(",
"text",
",",
"ts",
")",
")"... | Create a simple footer, with a styled text
@param text the text
@param ts the style
@return the footer | [
"Create",
"a",
"simple",
"footer",
"with",
"a",
"styled",
"text"
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/PageSection.java#L105-L107 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/PageSection.java | PageSection.simpleHeader | public static Header simpleHeader(final String text, final TextStyle ts) {
return new SimplePageSectionBuilder().text(Text.styledContent(text, ts)).buildHeader();
} | java | public static Header simpleHeader(final String text, final TextStyle ts) {
return new SimplePageSectionBuilder().text(Text.styledContent(text, ts)).buildHeader();
} | [
"public",
"static",
"Header",
"simpleHeader",
"(",
"final",
"String",
"text",
",",
"final",
"TextStyle",
"ts",
")",
"{",
"return",
"new",
"SimplePageSectionBuilder",
"(",
")",
".",
"text",
"(",
"Text",
".",
"styledContent",
"(",
"text",
",",
"ts",
")",
")"... | Create a simple header, with a styled text
@param text the text
@param ts the style
@return the header | [
"Create",
"a",
"simple",
"header",
"with",
"a",
"styled",
"text"
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/PageSection.java#L116-L118 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/style/BordersBuilder.java | BordersBuilder.all | public BordersBuilder all(final Length size, final Color color,
final BorderAttribute.Style style) {
return this.all(new BorderAttribute(size, color, style));
} | java | public BordersBuilder all(final Length size, final Color color,
final BorderAttribute.Style style) {
return this.all(new BorderAttribute(size, color, style));
} | [
"public",
"BordersBuilder",
"all",
"(",
"final",
"Length",
"size",
",",
"final",
"Color",
"color",
",",
"final",
"BorderAttribute",
".",
"Style",
"style",
")",
"{",
"return",
"this",
".",
"all",
"(",
"new",
"BorderAttribute",
"(",
"size",
",",
"color",
","... | Set all borders
@param size the size of the borders as a length
@param color the color fo the borders
@param style the style of the borders
@return this for fluent style | [
"Set",
"all",
"borders"
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/style/BordersBuilder.java#L58-L61 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/odselement/ContentElement.java | ContentElement.addChildCellStyle | public TableCellStyle addChildCellStyle(final TableCellStyle style, final TableCell.Type type) {
final TableCellStyle newStyle;
final DataStyle dataStyle = this.format.getDataStyle(type);
if (dataStyle == null) {
newStyle = style;
} else {
newStyle = this.st... | java | public TableCellStyle addChildCellStyle(final TableCellStyle style, final TableCell.Type type) {
final TableCellStyle newStyle;
final DataStyle dataStyle = this.format.getDataStyle(type);
if (dataStyle == null) {
newStyle = style;
} else {
newStyle = this.st... | [
"public",
"TableCellStyle",
"addChildCellStyle",
"(",
"final",
"TableCellStyle",
"style",
",",
"final",
"TableCell",
".",
"Type",
"type",
")",
"{",
"final",
"TableCellStyle",
"newStyle",
";",
"final",
"DataStyle",
"dataStyle",
"=",
"this",
".",
"format",
".",
"g... | Create an automatic style for this TableCellStyle and this type of cell.
Do not produce any effect if the type is Type.STRING or Type.VOID.
@param style the style of the cell (color, data style, etc.)
@param type the type of the cell
@return the created style, or style if the type is Type.STRING or Type.VOID | [
"Create",
"an",
"automatic",
"style",
"for",
"this",
"TableCellStyle",
"and",
"this",
"type",
"of",
"cell",
".",
"Do",
"not",
"produce",
"any",
"effect",
"if",
"the",
"type",
"is",
"Type",
".",
"STRING",
"or",
"Type",
".",
"VOID",
"."
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/odselement/ContentElement.java#L87-L96 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/odselement/ContentElement.java | ContentElement.flushRows | public void flushRows(final XMLUtil util, final ZipUTF8Writer writer,
final SettingsElement settingsElement) throws IOException {
this.ensureContentBegin(util, writer);
final int lastTableIndex = this.tables.size() - 1;
if (lastTableIndex == -1) return;
i... | java | public void flushRows(final XMLUtil util, final ZipUTF8Writer writer,
final SettingsElement settingsElement) throws IOException {
this.ensureContentBegin(util, writer);
final int lastTableIndex = this.tables.size() - 1;
if (lastTableIndex == -1) return;
i... | [
"public",
"void",
"flushRows",
"(",
"final",
"XMLUtil",
"util",
",",
"final",
"ZipUTF8Writer",
"writer",
",",
"final",
"SettingsElement",
"settingsElement",
")",
"throws",
"IOException",
"{",
"this",
".",
"ensureContentBegin",
"(",
"util",
",",
"writer",
")",
";... | Flush the rows from the last position to the current position
@param util the XML util
@param writer the destination
@param settingsElement the settings.xml representation
@throws IOException if the rows were not flushed | [
"Flush",
"the",
"rows",
"from",
"the",
"last",
"position",
"to",
"the",
"current",
"position"
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/odselement/ContentElement.java#L130-L154 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/odselement/ContentElement.java | ContentElement.flushTables | public void flushTables(final XMLUtil util, final ZipUTF8Writer writer) throws IOException {
this.ensureContentBegin(util, writer);
final int lastTableIndex = this.tables.size() - 1;
if (lastTableIndex < 0)
return;
int tableIndex = this.flushPosition.getTableIndex();
... | java | public void flushTables(final XMLUtil util, final ZipUTF8Writer writer) throws IOException {
this.ensureContentBegin(util, writer);
final int lastTableIndex = this.tables.size() - 1;
if (lastTableIndex < 0)
return;
int tableIndex = this.flushPosition.getTableIndex();
... | [
"public",
"void",
"flushTables",
"(",
"final",
"XMLUtil",
"util",
",",
"final",
"ZipUTF8Writer",
"writer",
")",
"throws",
"IOException",
"{",
"this",
".",
"ensureContentBegin",
"(",
"util",
",",
"writer",
")",
";",
"final",
"int",
"lastTableIndex",
"=",
"this"... | Flush the tables.
@param util an XML util
@param writer destination
@throws IOException if the tables were not flushed | [
"Flush",
"the",
"tables",
"."
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/odselement/ContentElement.java#L163-L179 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/odselement/ContentElement.java | ContentElement.writePostamble | public void writePostamble(final XMLUtil util, final ZipUTF8Writer writer) throws IOException {
if (this.autofilters != null) this.appendAutofilters(writer, util);
writer.write("</office:spreadsheet>");
writer.write("</office:body>");
writer.write("</office:document-content>");
... | java | public void writePostamble(final XMLUtil util, final ZipUTF8Writer writer) throws IOException {
if (this.autofilters != null) this.appendAutofilters(writer, util);
writer.write("</office:spreadsheet>");
writer.write("</office:body>");
writer.write("</office:document-content>");
... | [
"public",
"void",
"writePostamble",
"(",
"final",
"XMLUtil",
"util",
",",
"final",
"ZipUTF8Writer",
"writer",
")",
"throws",
"IOException",
"{",
"if",
"(",
"this",
".",
"autofilters",
"!=",
"null",
")",
"this",
".",
"appendAutofilters",
"(",
"writer",
",",
"... | Write the postamble into the given writer. Used by the FinalizeFlusher and by standard write method
@param util an XML util
@param writer the destination
@throws IOException if the postamble could not be written | [
"Write",
"the",
"postamble",
"into",
"the",
"given",
"writer",
".",
"Used",
"by",
"the",
"FinalizeFlusher",
"and",
"by",
"standard",
"write",
"method"
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/odselement/ContentElement.java#L241-L248 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/odselement/ContentElement.java | ContentElement.writePreamble | public void writePreamble(final XMLUtil util, final ZipUTF8Writer writer) throws IOException {
writer.putNextEntry(new ZipEntry("content.xml"));
writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
writer.write(
"<office:document-content xmlns:office=\"urn:oasis:names:... | java | public void writePreamble(final XMLUtil util, final ZipUTF8Writer writer) throws IOException {
writer.putNextEntry(new ZipEntry("content.xml"));
writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
writer.write(
"<office:document-content xmlns:office=\"urn:oasis:names:... | [
"public",
"void",
"writePreamble",
"(",
"final",
"XMLUtil",
"util",
",",
"final",
"ZipUTF8Writer",
"writer",
")",
"throws",
"IOException",
"{",
"writer",
".",
"putNextEntry",
"(",
"new",
"ZipEntry",
"(",
"\"content.xml\"",
")",
")",
";",
"writer",
".",
"write"... | Write the preamble into the given writer. Used by the MetaAndStylesElementsFlusher and by standard write method
@param util an XML util
@param writer the destination
@throws IOException if the preamble was not written | [
"Write",
"the",
"preamble",
"into",
"the",
"given",
"writer",
".",
"Used",
"by",
"the",
"MetaAndStylesElementsFlusher",
"and",
"by",
"standard",
"write",
"method"
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/odselement/ContentElement.java#L257-L270 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/TextBuilder.java | TextBuilder.parStyledContent | public TextBuilder parStyledContent(final String text, final TextStyle ts) {
return this.par().styledSpan(text, ts);
} | java | public TextBuilder parStyledContent(final String text, final TextStyle ts) {
return this.par().styledSpan(text, ts);
} | [
"public",
"TextBuilder",
"parStyledContent",
"(",
"final",
"String",
"text",
",",
"final",
"TextStyle",
"ts",
")",
"{",
"return",
"this",
".",
"par",
"(",
")",
".",
"styledSpan",
"(",
"text",
",",
"ts",
")",
";",
"}"
] | Create a new paragraph with a text content
@param text the text
@param ts the style
@return this for fluent style | [
"Create",
"a",
"new",
"paragraph",
"with",
"a",
"text",
"content"
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/TextBuilder.java#L98-L100 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/NamedOdsDocument.java | NamedOdsDocument.addChildCellStyle | public void addChildCellStyle(final TableCellStyle style, final TableCell.Type type) {
this.odsElements.addChildCellStyle(style, type);
} | java | public void addChildCellStyle(final TableCellStyle style, final TableCell.Type type) {
this.odsElements.addChildCellStyle(style, type);
} | [
"public",
"void",
"addChildCellStyle",
"(",
"final",
"TableCellStyle",
"style",
",",
"final",
"TableCell",
".",
"Type",
"type",
")",
"{",
"this",
".",
"odsElements",
".",
"addChildCellStyle",
"(",
"style",
",",
"type",
")",
";",
"}"
] | Add a cell style for a given data type. Use only if you want to flush data before the end
of the document
construction.
Do not produce any effect if the type is Type.STRING or Type.VOID
@param style the style
@param type the data type | [
"Add",
"a",
"cell",
"style",
"for",
"a",
"given",
"data",
"type",
".",
"Use",
"only",
"if",
"you",
"want",
"to",
"flush",
"data",
"before",
"the",
"end",
"of",
"the",
"document",
"construction",
".",
"Do",
"not",
"produce",
"any",
"effect",
"if",
"the"... | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/NamedOdsDocument.java#L168-L170 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/PreprocessedRowsFlusher.java | PreprocessedRowsFlusher.create | public static PreprocessedRowsFlusher create(final XMLUtil xmlUtil, final List<TableRow> tableRows) throws IOException {
return new PreprocessedRowsFlusher(xmlUtil, tableRows, new StringBuilder(STRING_BUILDER_SIZE));
} | java | public static PreprocessedRowsFlusher create(final XMLUtil xmlUtil, final List<TableRow> tableRows) throws IOException {
return new PreprocessedRowsFlusher(xmlUtil, tableRows, new StringBuilder(STRING_BUILDER_SIZE));
} | [
"public",
"static",
"PreprocessedRowsFlusher",
"create",
"(",
"final",
"XMLUtil",
"xmlUtil",
",",
"final",
"List",
"<",
"TableRow",
">",
"tableRows",
")",
"throws",
"IOException",
"{",
"return",
"new",
"PreprocessedRowsFlusher",
"(",
"xmlUtil",
",",
"tableRows",
"... | Create an new rows flusher
@param xmlUtil an util
@param tableRows the rows
@return the flusher
@throws IOException if an I/O error occurs | [
"Create",
"an",
"new",
"rows",
"flusher"
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/PreprocessedRowsFlusher.java#L48-L50 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/Text.java | Text.styledContent | public static Text styledContent(final String text, final TextStyle ts) {
return Text.builder().parStyledContent(text, ts).build();
} | java | public static Text styledContent(final String text, final TextStyle ts) {
return Text.builder().parStyledContent(text, ts).build();
} | [
"public",
"static",
"Text",
"styledContent",
"(",
"final",
"String",
"text",
",",
"final",
"TextStyle",
"ts",
")",
"{",
"return",
"Text",
".",
"builder",
"(",
")",
".",
"parStyledContent",
"(",
"text",
",",
"ts",
")",
".",
"build",
"(",
")",
";",
"}"
] | Create a simple Text object with a style
@param text the text content
@param ts the style
@return the Text | [
"Create",
"a",
"simple",
"Text",
"object",
"with",
"a",
"style"
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/Text.java#L98-L100 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/OdsFileWriterAdapter.java | OdsFileWriterAdapter.flushAdaptee | public synchronized void flushAdaptee() throws IOException {
OdsFlusher flusher = this.flushers.poll();
if (flusher == null) return;
while (flusher != null) {
this.adaptee.update(flusher);
if (flusher.isEnd()) {
this.stopped = true;
this.n... | java | public synchronized void flushAdaptee() throws IOException {
OdsFlusher flusher = this.flushers.poll();
if (flusher == null) return;
while (flusher != null) {
this.adaptee.update(flusher);
if (flusher.isEnd()) {
this.stopped = true;
this.n... | [
"public",
"synchronized",
"void",
"flushAdaptee",
"(",
")",
"throws",
"IOException",
"{",
"OdsFlusher",
"flusher",
"=",
"this",
".",
"flushers",
".",
"poll",
"(",
")",
";",
"if",
"(",
"flusher",
"==",
"null",
")",
"return",
";",
"while",
"(",
"flusher",
... | Flushes all available flushers to the adaptee writer.
The thread falls asleep if we reach the end of the queue without a FinalizeFlusher.
@throws IOException if the adaptee throws an IOException | [
"Flushes",
"all",
"available",
"flushers",
"to",
"the",
"adaptee",
"writer",
".",
"The",
"thread",
"falls",
"asleep",
"if",
"we",
"reach",
"the",
"end",
"of",
"the",
"queue",
"without",
"a",
"FinalizeFlusher",
"."
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/OdsFileWriterAdapter.java#L97-L117 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/OdsFileWriterAdapter.java | OdsFileWriterAdapter.waitForData | public synchronized void waitForData() {
while (this.flushers.isEmpty() && this.isNotStopped()) {
try {
this.wait();
} catch (final InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
... | java | public synchronized void waitForData() {
while (this.flushers.isEmpty() && this.isNotStopped()) {
try {
this.wait();
} catch (final InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
... | [
"public",
"synchronized",
"void",
"waitForData",
"(",
")",
"{",
"while",
"(",
"this",
".",
"flushers",
".",
"isEmpty",
"(",
")",
"&&",
"this",
".",
"isNotStopped",
"(",
")",
")",
"{",
"try",
"{",
"this",
".",
"wait",
"(",
")",
";",
"}",
"catch",
"(... | wait for the data | [
"wait",
"for",
"the",
"data"
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/OdsFileWriterAdapter.java#L129-L138 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/util/TableNameUtil.java | TableNameUtil.escapeTableName | public String escapeTableName(final String tableName) {
// step 1: to quote or no? how many single quotes?
boolean toQuote = false;
int apostropheCount = 0;
for (int i = 0; i < tableName.length(); i++) {
final char c = tableName.charAt(i);
if (Character.isWh... | java | public String escapeTableName(final String tableName) {
// step 1: to quote or no? how many single quotes?
boolean toQuote = false;
int apostropheCount = 0;
for (int i = 0; i < tableName.length(); i++) {
final char c = tableName.charAt(i);
if (Character.isWh... | [
"public",
"String",
"escapeTableName",
"(",
"final",
"String",
"tableName",
")",
"{",
"// step 1: to quote or no? how many single quotes?\r",
"boolean",
"toQuote",
"=",
"false",
";",
"int",
"apostropheCount",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
... | 9.2.1 Referencing Table Cells
@param tableName the name of the table
@return the name of the table escaped | [
"9",
".",
"2",
".",
"1",
"Referencing",
"Table",
"Cells"
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/util/TableNameUtil.java#L69-L101 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/odselement/StylesContainer.java | StylesContainer.addChildCellStyle | public TableCellStyle addChildCellStyle(final TableCellStyle style, final DataStyle dataStyle) {
final ChildCellStyle childKey = new ChildCellStyle(style, dataStyle);
TableCellStyle anonymousStyle = this.anonymousStyleByChildCellStyle.get(childKey);
if (anonymousStyle == null) {
this... | java | public TableCellStyle addChildCellStyle(final TableCellStyle style, final DataStyle dataStyle) {
final ChildCellStyle childKey = new ChildCellStyle(style, dataStyle);
TableCellStyle anonymousStyle = this.anonymousStyleByChildCellStyle.get(childKey);
if (anonymousStyle == null) {
this... | [
"public",
"TableCellStyle",
"addChildCellStyle",
"(",
"final",
"TableCellStyle",
"style",
",",
"final",
"DataStyle",
"dataStyle",
")",
"{",
"final",
"ChildCellStyle",
"childKey",
"=",
"new",
"ChildCellStyle",
"(",
"style",
",",
"dataStyle",
")",
";",
"TableCellStyle... | Add a child style that mixes the cell style with a data style to the container
@param style the cell style
@param dataStyle the data style
@return the mixed cell style | [
"Add",
"a",
"child",
"style",
"that",
"mixes",
"the",
"cell",
"style",
"with",
"a",
"data",
"style",
"to",
"the",
"container"
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/odselement/StylesContainer.java#L124-L143 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/odselement/StylesContainer.java | StylesContainer.addDataStyle | public boolean addDataStyle(final DataStyle dataStyle) {
if (dataStyle.isHidden()) {
return this.dataStylesContainer
.add(dataStyle.getName(), Dest.CONTENT_AUTOMATIC_STYLES, dataStyle);
} else {
return this.dataStylesContainer
.add(dataStyl... | java | public boolean addDataStyle(final DataStyle dataStyle) {
if (dataStyle.isHidden()) {
return this.dataStylesContainer
.add(dataStyle.getName(), Dest.CONTENT_AUTOMATIC_STYLES, dataStyle);
} else {
return this.dataStylesContainer
.add(dataStyl... | [
"public",
"boolean",
"addDataStyle",
"(",
"final",
"DataStyle",
"dataStyle",
")",
"{",
"if",
"(",
"dataStyle",
".",
"isHidden",
"(",
")",
")",
"{",
"return",
"this",
".",
"dataStylesContainer",
".",
"add",
"(",
"dataStyle",
".",
"getName",
"(",
")",
",",
... | Create a new data style into styles container. No duplicate style name is allowed.
Must be used if the table-cell style already exists.
@param dataStyle the data style to add
@return true if the style was added | [
"Create",
"a",
"new",
"data",
"style",
"into",
"styles",
"container",
".",
"No",
"duplicate",
"style",
"name",
"is",
"allowed",
".",
"Must",
"be",
"used",
"if",
"the",
"table",
"-",
"cell",
"style",
"already",
"exists",
"."
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/odselement/StylesContainer.java#L178-L186 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/odselement/StylesContainer.java | StylesContainer.addMasterPageStyle | public boolean addMasterPageStyle(final MasterPageStyle masterPageStyle) {
if (this.masterPageStylesContainer.add(masterPageStyle.getName(), masterPageStyle)) {
masterPageStyle.addEmbeddedStyles(this);
return true;
} else return false;
} | java | public boolean addMasterPageStyle(final MasterPageStyle masterPageStyle) {
if (this.masterPageStylesContainer.add(masterPageStyle.getName(), masterPageStyle)) {
masterPageStyle.addEmbeddedStyles(this);
return true;
} else return false;
} | [
"public",
"boolean",
"addMasterPageStyle",
"(",
"final",
"MasterPageStyle",
"masterPageStyle",
")",
"{",
"if",
"(",
"this",
".",
"masterPageStylesContainer",
".",
"add",
"(",
"masterPageStyle",
".",
"getName",
"(",
")",
",",
"masterPageStyle",
")",
")",
"{",
"ma... | Create a new master page style into styles container. No duplicate style name is allowed.
@param masterPageStyle the data style to add
@return true if the style was created | [
"Create",
"a",
"new",
"master",
"page",
"style",
"into",
"styles",
"container",
".",
"No",
"duplicate",
"style",
"name",
"is",
"allowed",
"."
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/odselement/StylesContainer.java#L203-L208 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/odselement/StylesContainer.java | StylesContainer.addNewDataStyleFromCellStyle | public boolean addNewDataStyleFromCellStyle(final TableCellStyle style) {
final boolean ret = this.addContentStyle(style);
return this.addDataStyle(style.getDataStyle()) && ret;
} | java | public boolean addNewDataStyleFromCellStyle(final TableCellStyle style) {
final boolean ret = this.addContentStyle(style);
return this.addDataStyle(style.getDataStyle()) && ret;
} | [
"public",
"boolean",
"addNewDataStyleFromCellStyle",
"(",
"final",
"TableCellStyle",
"style",
")",
"{",
"final",
"boolean",
"ret",
"=",
"this",
".",
"addContentStyle",
"(",
"style",
")",
";",
"return",
"this",
".",
"addDataStyle",
"(",
"style",
".",
"getDataStyl... | Add the data style taken from a cell style
@param style the cell style
@return true if the style was created | [
"Add",
"the",
"data",
"style",
"taken",
"from",
"a",
"cell",
"style"
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/odselement/StylesContainer.java#L225-L228 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/odselement/StylesContainer.java | StylesContainer.addPageStyle | public boolean addPageStyle(final PageStyle ps) {
boolean ret = this.addMasterPageStyle(ps.getMasterPageStyle());
ret = this.addPageLayoutStyle(ps.getPageLayoutStyle()) && ret;
return ret;
} | java | public boolean addPageStyle(final PageStyle ps) {
boolean ret = this.addMasterPageStyle(ps.getMasterPageStyle());
ret = this.addPageLayoutStyle(ps.getPageLayoutStyle()) && ret;
return ret;
} | [
"public",
"boolean",
"addPageStyle",
"(",
"final",
"PageStyle",
"ps",
")",
"{",
"boolean",
"ret",
"=",
"this",
".",
"addMasterPageStyle",
"(",
"ps",
".",
"getMasterPageStyle",
"(",
")",
")",
";",
"ret",
"=",
"this",
".",
"addPageLayoutStyle",
"(",
"ps",
".... | Add a page style
@param ps the style
@return true if the master page style and the style layout where added | [
"Add",
"a",
"page",
"style"
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/odselement/StylesContainer.java#L267-L271 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/odselement/StylesContainer.java | StylesContainer.writeContentAutomaticStyles | public void writeContentAutomaticStyles(final XMLUtil util, final Appendable appendable)
throws IOException {
final Iterable<ObjectStyle> styles = this.objectStylesContainer
.getValues(Dest.CONTENT_AUTOMATIC_STYLES);
for (final ObjectStyle style : styles)
assert s... | java | public void writeContentAutomaticStyles(final XMLUtil util, final Appendable appendable)
throws IOException {
final Iterable<ObjectStyle> styles = this.objectStylesContainer
.getValues(Dest.CONTENT_AUTOMATIC_STYLES);
for (final ObjectStyle style : styles)
assert s... | [
"public",
"void",
"writeContentAutomaticStyles",
"(",
"final",
"XMLUtil",
"util",
",",
"final",
"Appendable",
"appendable",
")",
"throws",
"IOException",
"{",
"final",
"Iterable",
"<",
"ObjectStyle",
">",
"styles",
"=",
"this",
".",
"objectStylesContainer",
".",
"... | Write the various styles in the automatic styles.
@param util an XML util
@param appendable the destination
@throws IOException if the styles can't be written | [
"Write",
"the",
"various",
"styles",
"in",
"the",
"automatic",
"styles",
"."
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/odselement/StylesContainer.java#L363-L371 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/RegionPageSectionBuilder.java | RegionPageSectionBuilder.region | public RegionPageSectionBuilder region(final PageSectionContent.Region region) {
switch (region) {
case LEFT: // Use left region
this.curRegionBox = this.leftRegionBox;
break;
case CENTER: // Use center region
this.curRegionBox = this.centerRegionBox;
break;
case RIGHT: // Use right region
this.c... | java | public RegionPageSectionBuilder region(final PageSectionContent.Region region) {
switch (region) {
case LEFT: // Use left region
this.curRegionBox = this.leftRegionBox;
break;
case CENTER: // Use center region
this.curRegionBox = this.centerRegionBox;
break;
case RIGHT: // Use right region
this.c... | [
"public",
"RegionPageSectionBuilder",
"region",
"(",
"final",
"PageSectionContent",
".",
"Region",
"region",
")",
"{",
"switch",
"(",
"region",
")",
"{",
"case",
"LEFT",
":",
"// Use left region",
"this",
".",
"curRegionBox",
"=",
"this",
".",
"leftRegionBox",
"... | Switch to a new region
@param region the region that will be set
@return this for fluent style | [
"Switch",
"to",
"a",
"new",
"region"
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/RegionPageSectionBuilder.java#L69-L84 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/util/MultiContainer.java | MultiContainer.add | public boolean add(final K key, final S subcontainer, final V value) {
final S curSubcontainer = this.subcontainerByKey.get(key);
if (curSubcontainer == null) { // key does not exist
if (this.mode == Mode.UPDATE)
return false;
} else { // key exists
if (this.mode == Mode.CREATE)
return false;
i... | java | public boolean add(final K key, final S subcontainer, final V value) {
final S curSubcontainer = this.subcontainerByKey.get(key);
if (curSubcontainer == null) { // key does not exist
if (this.mode == Mode.UPDATE)
return false;
} else { // key exists
if (this.mode == Mode.CREATE)
return false;
i... | [
"public",
"boolean",
"add",
"(",
"final",
"K",
"key",
",",
"final",
"S",
"subcontainer",
",",
"final",
"V",
"value",
")",
"{",
"final",
"S",
"curSubcontainer",
"=",
"this",
".",
"subcontainerByKey",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"curSubc... | Add a value to this multi container
@param key the key
@param subcontainer the sub container
@param value the value
@return true | [
"Add",
"a",
"value",
"to",
"this",
"multi",
"container"
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/util/MultiContainer.java#L79-L111 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/TableColdCell.java | TableColdCell.setTooltip | public void setTooltip(final String tooltip) {
String escapedXMLContent = this.xmlUtil.escapeXMLContent(tooltip);
if (escapedXMLContent.contains("\n")) {
escapedXMLContent = escapedXMLContent.replaceAll("\r?\n", "</text:p><text:p>");
}
this.tooltip = escapedXMLContent;
} | java | public void setTooltip(final String tooltip) {
String escapedXMLContent = this.xmlUtil.escapeXMLContent(tooltip);
if (escapedXMLContent.contains("\n")) {
escapedXMLContent = escapedXMLContent.replaceAll("\r?\n", "</text:p><text:p>");
}
this.tooltip = escapedXMLContent;
} | [
"public",
"void",
"setTooltip",
"(",
"final",
"String",
"tooltip",
")",
"{",
"String",
"escapedXMLContent",
"=",
"this",
".",
"xmlUtil",
".",
"escapeXMLContent",
"(",
"tooltip",
")",
";",
"if",
"(",
"escapedXMLContent",
".",
"contains",
"(",
"\"\\n\"",
")",
... | Set a tooltip
@param tooltip the content | [
"Set",
"a",
"tooltip"
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/TableColdCell.java#L94-L101 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/TableColdCell.java | TableColdCell.setTooltip | public void setTooltip(final String tooltip, final Length width, final Length height, final boolean visible) {
this.setTooltip(tooltip);
this.tooltipParameter = TooltipParameter.create(width, height, visible);
} | java | public void setTooltip(final String tooltip, final Length width, final Length height, final boolean visible) {
this.setTooltip(tooltip);
this.tooltipParameter = TooltipParameter.create(width, height, visible);
} | [
"public",
"void",
"setTooltip",
"(",
"final",
"String",
"tooltip",
",",
"final",
"Length",
"width",
",",
"final",
"Length",
"height",
",",
"final",
"boolean",
"visible",
")",
"{",
"this",
".",
"setTooltip",
"(",
"tooltip",
")",
";",
"this",
".",
"tooltipPa... | Set a tooltip of a given size
@param tooltip the content
@param width the width of the tooltip
@param height the height of the tooltip
@param visible true if the tooltip is visible | [
"Set",
"a",
"tooltip",
"of",
"a",
"given",
"size"
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/TableColdCell.java#L111-L114 | train |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/ParagraphBuilder.java | ParagraphBuilder.span | public ParagraphBuilder span(final String text) {
final ParagraphElement paragraphElement = new Span(text);
this.paragraphElements.add(paragraphElement);
return this;
} | java | public ParagraphBuilder span(final String text) {
final ParagraphElement paragraphElement = new Span(text);
this.paragraphElements.add(paragraphElement);
return this;
} | [
"public",
"ParagraphBuilder",
"span",
"(",
"final",
"String",
"text",
")",
"{",
"final",
"ParagraphElement",
"paragraphElement",
"=",
"new",
"Span",
"(",
"text",
")",
";",
"this",
".",
"paragraphElements",
".",
"add",
"(",
"paragraphElement",
")",
";",
"return... | Create a span in the current paragraph.
@param text the text
@return this for fluent style | [
"Create",
"a",
"span",
"in",
"the",
"current",
"paragraph",
"."
] | a034d173083ffa602dc525699b97f753082eaef9 | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/ParagraphBuilder.java#L61-L65 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.