id stringlengths 5 19 | content stringlengths 94 57.5k | max_stars_repo_path stringlengths 36 95 |
|---|---|---|
Chart-1 | public LegendItemCollection getLegendItems() {
LegendItemCollection result = new LegendItemCollection();
if (this.plot == null) {
return result;
}
int index = this.plot.getIndexOf(this);
CategoryDataset dataset = this.plot.getDataset(index);
if (dataset !=... | source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java |
Chart-10 | public String generateToolTipFragment(String toolTipText) {
return " title=\"" + toolTipText
+ "\" alt=\"\"";
}
public String generateToolTipFragment(String toolTipText) {
return " title=\"" + ImageMapUtilities.htmlEscape(toolTipText)
+ "\" alt=\"\"";
} | source/org/jfree/chart/imagemap/StandardToolTipTagFragmentGenerator.java |
Chart-11 | public static boolean equal(GeneralPath p1, GeneralPath p2) {
if (p1 == null) {
return (p2 == null);
}
if (p2 == null) {
return false;
}
if (p1.getWindingRule() != p2.getWindingRule()) {
return false;
}
PathIterator iterator... | source/org/jfree/chart/util/ShapeUtilities.java |
Chart-12 | public MultiplePiePlot(CategoryDataset dataset) {
super();
this.dataset = dataset;
PiePlot piePlot = new PiePlot(null);
this.pieChart = new JFreeChart(piePlot);
this.pieChart.removeLegend();
this.dataExtractOrder = TableOrder.BY_COLUMN;
this.pieChart.setBackgr... | source/org/jfree/chart/plot/MultiplePiePlot.java |
Chart-13 | protected Size2D arrangeFF(BlockContainer container, Graphics2D g2,
RectangleConstraint constraint) {
double[] w = new double[5];
double[] h = new double[5];
w[0] = constraint.getWidth();
if (this.topBlock != null) {
RectangleConstraint c1 =... | source/org/jfree/chart/block/BorderArrangement.java |
Chart-17 | public Object clone() throws CloneNotSupportedException {
Object clone = createCopy(0, getItemCount() - 1);
return clone;
}
public Object clone() throws CloneNotSupportedException {
TimeSeries clone = (TimeSeries) super.clone();
clone.data = (List) ObjectUtilities.deepClone(... | source/org/jfree/data/time/TimeSeries.java |
Chart-20 | public ValueMarker(double value, Paint paint, Stroke stroke,
Paint outlinePaint, Stroke outlineStroke, float alpha) {
super(paint, stroke, paint, stroke, alpha);
this.value = value;
}
public ValueMarker(double value, Paint paint, Stroke stroke,
... | source/org/jfree/chart/plot/ValueMarker.java |
Chart-24 | public Paint getPaint(double value) {
double v = Math.max(value, this.lowerBound);
v = Math.min(v, this.upperBound);
int g = (int) ((value - this.lowerBound) / (this.upperBound
- this.lowerBound) * 255.0);
return new Color(g, g, g);
}
public Paint getPaint(d... | source/org/jfree/chart/renderer/GrayPaintScale.java |
Chart-26 | protected AxisState drawLabel(String label, Graphics2D g2,
Rectangle2D plotArea, Rectangle2D dataArea, RectangleEdge edge,
AxisState state, PlotRenderingInfo plotState) {
// it is unlikely that 'state' will be null, but check anyway...
if (state == null) {
thro... | source/org/jfree/chart/axis/Axis.java |
Chart-3 | public TimeSeries createCopy(int start, int end)
throws CloneNotSupportedException {
if (start < 0) {
throw new IllegalArgumentException("Requires start >= 0.");
}
if (end < start) {
throw new IllegalArgumentException("Requires start <= end.");
}
... | source/org/jfree/data/time/TimeSeries.java |
Chart-4 | public Range getDataRange(ValueAxis axis) {
Range result = null;
List mappedDatasets = new ArrayList();
List includedAnnotations = new ArrayList();
boolean isDomainAxis = true;
// is it a domain axis?
int domainIndex = getDomainAxisIndex(axis);
if (domainInd... | source/org/jfree/chart/plot/XYPlot.java |
Chart-5 | public XYDataItem addOrUpdate(Number x, Number y) {
if (x == null) {
throw new IllegalArgumentException("Null 'x' argument.");
}
// if we get to here, we know that duplicate X values are not permitted
XYDataItem overwritten = null;
int index = indexOf(x);
... | source/org/jfree/data/xy/XYSeries.java |
Chart-6 | public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof ShapeList)) {
return false;
}
return super.equals(obj);
}
public boolean equals(Object obj) {
if (obj == this) {
return true;
... | source/org/jfree/chart/util/ShapeList.java |
Chart-7 | private void updateBounds(TimePeriod period, int index) {
long start = period.getStart().getTime();
long end = period.getEnd().getTime();
long middle = start + ((end - start) / 2);
if (this.minStartIndex >= 0) {
long minStart = getDataItem(this.minStartIndex).ge... | source/org/jfree/data/time/TimePeriodValues.java |
Chart-8 | public Week(Date time, TimeZone zone) {
// defer argument checking...
this(time, RegularTimePeriod.DEFAULT_TIME_ZONE, Locale.getDefault());
}
public Week(Date time, TimeZone zone) {
// defer argument checking...
this(time, zone, Locale.getDefault());
} | source/org/jfree/data/time/Week.java |
Chart-9 | public TimeSeries createCopy(RegularTimePeriod start, RegularTimePeriod end)
throws CloneNotSupportedException {
if (start == null) {
throw new IllegalArgumentException("Null 'start' argument.");
}
if (end == null) {
throw new IllegalArgumentException("Null '... | source/org/jfree/data/time/TimeSeries.java |
Cli-11 | private static void appendOption(final StringBuffer buff,
final Option option,
final boolean required)
{
if (!required)
{
buff.append("[");
}
if (option.getOpt() != null)
{
... | src/java/org/apache/commons/cli/HelpFormatter.java |
Cli-12 | protected String[] flatten(Options options, String[] arguments, boolean stopAtNonOption)
{
List tokens = new ArrayList();
boolean eatTheRest = false;
for (int i = 0; i < arguments.length; i++)
{
String arg = arguments[i];
if ("--".equals(arg))
... | src/java/org/apache/commons/cli/GnuParser.java |
Cli-14 | public void validate(final WriteableCommandLine commandLine)
throws OptionException {
// number of options found
int present = 0;
// reference to first unexpected option
Option unexpected = null;
for (final Iterator i = options.iterator(); i.hasNext();) {
... | src/java/org/apache/commons/cli2/option/GroupImpl.java |
Cli-15 | public List getValues(final Option option,
List defaultValues) {
// initialize the return list
List valueList = (List) values.get(option);
// grab the correct default values
if ((valueList == null) || valueList.isEmpty()) {
valueList = defaultVa... | src/java/org/apache/commons/cli2/commandline/WriteableCommandLineImpl.java |
Cli-17 | protected void burstToken(String token, boolean stopAtNonOption)
{
for (int i = 1; i < token.length(); i++)
{
String ch = String.valueOf(token.charAt(i));
if (options.hasOption(ch))
{
tokens.add("-" + ch);
currentOption = optio... | src/java/org/apache/commons/cli/PosixParser.java |
Cli-19 | private void processOptionToken(String token, boolean stopAtNonOption)
{
if (options.hasOption(token))
{
currentOption = options.getOption(token);
tokens.add(token);
}
else if (stopAtNonOption)
{
eatTheRest = true;
tokens.ad... | src/java/org/apache/commons/cli/PosixParser.java |
Cli-20 | protected String[] flatten(Options options, String[] arguments, boolean stopAtNonOption)
{
init();
this.options = options;
// an iterator for the command line tokens
Iterator iter = Arrays.asList(arguments).iterator();
// process each command line token
while (i... | src/java/org/apache/commons/cli/PosixParser.java |
Cli-23 | protected StringBuffer renderWrappedText(StringBuffer sb, int width,
int nextLineTabStop, String text)
{
int pos = findWrapPos(text, width, 0);
if (pos == -1)
{
sb.append(rtrim(text));
return sb;
}
sb... | src/java/org/apache/commons/cli/HelpFormatter.java |
Cli-24 | protected StringBuffer renderWrappedText(StringBuffer sb, int width,
int nextLineTabStop, String text)
{
int pos = findWrapPos(text, width, 0);
if (pos == -1)
{
sb.append(rtrim(text));
return sb;
}
sb... | src/java/org/apache/commons/cli/HelpFormatter.java |
Cli-25 | protected StringBuffer renderWrappedText(StringBuffer sb, int width,
int nextLineTabStop, String text)
{
int pos = findWrapPos(text, width, 0);
if (pos == -1)
{
sb.append(rtrim(text));
return sb;
}
sb... | src/java/org/apache/commons/cli/HelpFormatter.java |
Cli-26 | public static Option create(String opt) throws IllegalArgumentException
{
// create the option
Option option = new Option(opt, description);
// set the option properties
option.setLongOpt(longopt);
option.setRequired(required);
option.setOptio... | src/java/org/apache/commons/cli/OptionBuilder.java |
Cli-27 | public void setSelected(Option option) throws AlreadySelectedException
{
if (option == null)
{
// reset the option previously selected
selected = null;
return;
}
// if no option has already been selected or the
// same option ... | src/java/org/apache/commons/cli/OptionGroup.java |
Cli-28 | protected void processProperties(Properties properties)
{
if (properties == null)
{
return;
}
for (Enumeration e = properties.propertyNames(); e.hasMoreElements();)
{
String option = e.nextElement().toString();
if (!cmd.hasOption(opti... | src/java/org/apache/commons/cli/Parser.java |
Cli-29 | static String stripLeadingAndTrailingQuotes(String str)
{
if (str.startsWith("\""))
{
str = str.substring(1, str.length());
}
int length = str.length();
if (str.endsWith("\""))
{
str = str.substring(0, length - 1);
}
... | src/java/org/apache/commons/cli/Util.java |
Cli-32 | protected int findWrapPos(String text, int width, int startPos)
{
int pos;
// the line ends before the max wrap pos or a new line char found
if (((pos = text.indexOf('\n', startPos)) != -1 && pos <= width)
|| ((pos = text.indexOf('\t', startPos)) != -1 && pos <= ... | src/main/java/org/apache/commons/cli/HelpFormatter.java |
Cli-35 | public List<String> getMatchingOptions(String opt)
{
opt = Util.stripLeadingHyphens(opt);
List<String> matchingOpts = new ArrayList<String>();
// for a perfect match return the single option only
for (String longOpt : longOpts.keySet())
{
if (longOp... | src/main/java/org/apache/commons/cli/Options.java |
Cli-37 | private boolean isShortOption(String token)
{
// short options (-S, -SV, -S=V, -SV1=V2, -S1S2)
return token.startsWith("-") && token.length() >= 2 && options.hasShortOption(token.substring(1, 2));
// remove leading "-" and "=value"
}
private boolean isShortOption(String token)
... | src/main/java/org/apache/commons/cli/DefaultParser.java |
Cli-38 | private boolean isShortOption(String token)
{
// short options (-S, -SV, -S=V, -SV1=V2, -S1S2)
if (!token.startsWith("-") || token.length() == 1)
{
return false;
}
// remove leading "-" and "=value"
int pos = token.indexOf("=");
String optName... | src/main/java/org/apache/commons/cli/DefaultParser.java |
Cli-4 | private void checkRequiredOptions()
throws MissingOptionException
{
// if there are required options that have not been
// processsed
if (requiredOptions.size() > 0)
{
Iterator iter = requiredOptions.iterator();
StringBuffer buff = new StringBuffer... | src/java/org/apache/commons/cli/Parser.java |
Cli-40 | public static <T> T createValue(final String str, final Class<T> clazz) throws ParseException
{
if (PatternOptionBuilder.STRING_VALUE == clazz)
{
return (T) str;
}
else if (PatternOptionBuilder.OBJECT_VALUE == clazz)
{
return (T) createObject(str);... | src/main/java/org/apache/commons/cli/TypeHandler.java |
Cli-5 | static String stripLeadingHyphens(String str)
{
if (str.startsWith("--"))
{
return str.substring(2, str.length());
}
else if (str.startsWith("-"))
{
return str.substring(1, str.length());
}
return str;
}
static String stri... | src/java/org/apache/commons/cli/Util.java |
Cli-8 | protected StringBuffer renderWrappedText(StringBuffer sb, int width,
int nextLineTabStop, String text)
{
int pos = findWrapPos(text, width, 0);
if (pos == -1)
{
sb.append(rtrim(text));
return sb;
}
sb... | src/java/org/apache/commons/cli/HelpFormatter.java |
Cli-9 | protected void checkRequiredOptions()
throws MissingOptionException
{
// if there are required options that have not been
// processsed
if (getRequiredOptions().size() > 0)
{
Iterator iter = getRequiredOptions().iterator();
StringBuffer buff = new ... | src/java/org/apache/commons/cli/Parser.java |
Closure-1 | private void removeUnreferencedFunctionArgs(Scope fnScope) {
// Notice that removing unreferenced function args breaks
// Function.prototype.length. In advanced mode, we don't really care
// about this: we consider "length" the equivalent of reflecting on
// the function's lexical source.
//
/... | src/com/google/javascript/jscomp/RemoveUnusedVars.java |
Closure-10 | static boolean mayBeString(Node n, boolean recurse) {
if (recurse) {
return allResultsMatch(n, MAY_BE_STRING_PREDICATE);
} else {
return mayBeStringHelper(n);
}
}
static boolean mayBeString(Node n, boolean recurse) {
if (recurse) {
return anyResultsMatch(n, MAY_BE_STRING_PREDICA... | src/com/google/javascript/jscomp/NodeUtil.java |
Closure-101 | protected CompilerOptions createOptions() {
CompilerOptions options = new CompilerOptions();
options.setCodingConvention(new ClosureCodingConvention());
CompilationLevel level = flags.compilation_level;
level.setOptionsForCompilationLevel(options);
if (flags.debug) {
level.setDebugOptionsFor... | src/com/google/javascript/jscomp/CommandLineRunner.java |
Closure-102 | public void process(Node externs, Node root) {
NodeTraversal.traverse(compiler, root, this);
if (MAKE_LOCAL_NAMES_UNIQUE) {
MakeDeclaredNamesUnique renamer = new MakeDeclaredNamesUnique();
NodeTraversal t = new NodeTraversal(compiler, renamer);
t.traverseRoots(externs, root);
}
remov... | src/com/google/javascript/jscomp/Normalize.java |
Closure-104 | JSType meet(JSType that) {
UnionTypeBuilder builder = new UnionTypeBuilder(registry);
for (JSType alternate : alternates) {
if (alternate.isSubtype(that)) {
builder.addAlternate(alternate);
}
}
if (that instanceof UnionType) {
for (JSType otherAlternate : ((UnionType) that).... | src/com/google/javascript/rhino/jstype/UnionType.java |
Closure-105 | void tryFoldStringJoin(NodeTraversal t, Node n, Node left, Node right,
Node parent) {
if (!NodeUtil.isGetProp(left) || !NodeUtil.isImmutableValue(right)) {
return;
}
Node arrayNode = left.getFirstChild();
Node functionName = arrayNode.getNext();
if ((arrayNode.getT... | src/com/google/javascript/jscomp/FoldConstants.java |
Closure-107 | protected CompilerOptions createOptions() {
CompilerOptions options = new CompilerOptions();
if (flags.processJqueryPrimitives) {
options.setCodingConvention(new JqueryCodingConvention());
} else {
options.setCodingConvention(new ClosureCodingConvention());
}
options.setExtraAnnotatio... | src/com/google/javascript/jscomp/CommandLineRunner.java |
Closure-109 | private Node parseContextTypeExpression(JsDocToken token) {
return parseTypeName(token);
}
private Node parseContextTypeExpression(JsDocToken token) {
if (token == JsDocToken.QMARK) {
return newNode(Token.QMARK);
} else {
return parseBasicTypeExpression(token);
}
} | src/com/google/javascript/jscomp/parsing/JsDocInfoParser.java |
Closure-11 | private void visitGetProp(NodeTraversal t, Node n, Node parent) {
// obj.prop or obj.method()
// Lots of types can appear on the left, a call to a void function can
// never be on the left. getPropertyType will decide what is acceptable
// and what isn't.
Node property = n.getLastChild();
Node... | src/com/google/javascript/jscomp/TypeCheck.java |
Closure-111 | protected JSType caseTopType(JSType topType) {
return topType;
}
protected JSType caseTopType(JSType topType) {
return topType.isAllType() ?
getNativeType(ARRAY_TYPE) : topType;
} | src/com/google/javascript/jscomp/type/ClosureReverseAbstractInterpreter.java |
Closure-112 | private boolean inferTemplatedTypesForCall(
Node n, FunctionType fnType) {
final ImmutableList<TemplateType> keys = fnType.getTemplateTypeMap()
.getTemplateKeys();
if (keys.isEmpty()) {
return false;
}
// Try to infer the template types
Map<TemplateType, JSType> inferred =
... | src/com/google/javascript/jscomp/TypeInference.java |
Closure-113 | private void processRequireCall(NodeTraversal t, Node n, Node parent) {
Node left = n.getFirstChild();
Node arg = left.getNext();
if (verifyLastArgumentIsString(t, left, arg)) {
String ns = arg.getString();
ProvidedName provided = providedNames.get(ns);
if (provided == null || !provided.... | src/com/google/javascript/jscomp/ProcessClosurePrimitives.java |
Closure-114 | private void recordAssignment(NodeTraversal t, Node n, Node recordNode) {
Node nameNode = n.getFirstChild();
Node parent = n.getParent();
NameInformation ns = createNameInformation(t, nameNode);
if (ns != null) {
if (parent.isFor() && !NodeUtil.isForIn(parent)) {
// Patch f... | src/com/google/javascript/jscomp/NameAnalyzer.java |
Closure-115 | private CanInlineResult canInlineReferenceDirectly(
Node callNode, Node fnNode) {
if (!isDirectCallNodeReplacementPossible(fnNode)) {
return CanInlineResult.NO;
}
Node block = fnNode.getLastChild();
boolean hasSideEffects = false;
if (block.hasChildren()) {
Preconditions.checkS... | src/com/google/javascript/jscomp/FunctionInjector.java |
Closure-116 | private CanInlineResult canInlineReferenceDirectly(
Node callNode, Node fnNode) {
if (!isDirectCallNodeReplacementPossible(fnNode)) {
return CanInlineResult.NO;
}
Node block = fnNode.getLastChild();
// CALL NODE: [ NAME, ARG1, ARG2, ... ]
Node cArg = callNode.getFirstChild().getNext... | src/com/google/javascript/jscomp/FunctionInjector.java |
Closure-117 | String getReadableJSTypeName(Node n, boolean dereference) {
// The best type name is the actual type name.
// If we're analyzing a GETPROP, the property may be inherited by the
// prototype chain. So climb the prototype chain and find out where
// the property was originally defined.
if (n.isGet... | src/com/google/javascript/jscomp/TypeValidator.java |
Closure-118 | private void handleObjectLit(NodeTraversal t, Node n) {
for (Node child = n.getFirstChild();
child != null;
child = child.getNext()) {
// Maybe STRING, GET, SET
// We should never see a mix of numbers and strings.
String name = child.getString();
T type = t... | src/com/google/javascript/jscomp/DisambiguateProperties.java |
Closure-119 | public void collect(JSModule module, Scope scope, Node n) {
Node parent = n.getParent();
String name;
boolean isSet = false;
Name.Type type = Name.Type.OTHER;
boolean isPropAssign = false;
switch (n.getType()) {
case Token.GETTER_DEF:
case Token.SETTER_DEF:
... | src/com/google/javascript/jscomp/GlobalNamespace.java |
Closure-12 | private boolean hasExceptionHandler(Node cfgNode) {
return false;
}
private boolean hasExceptionHandler(Node cfgNode) {
List<DiGraphEdge<Node, Branch>> branchEdges = getCfg().getOutEdges(cfgNode);
for (DiGraphEdge<Node, Branch> edge : branchEdges) {
if (edge.getValue() == Branch.ON_EX) {
... | src/com/google/javascript/jscomp/MaybeReachingVariableUse.java |
Closure-120 | boolean isAssignedOnceInLifetime() {
Reference ref = getOneAndOnlyAssignment();
if (ref == null) {
return false;
}
// Make sure this assignment is not in a loop.
for (BasicBlock block = ref.getBasicBlock();
block != null; block = block.getParent()) {
if (blo... | src/com/google/javascript/jscomp/ReferenceCollectingCallback.java |
Closure-121 | private void inlineNonConstants(
Var v, ReferenceCollection referenceInfo,
boolean maybeModifiedArguments) {
int refCount = referenceInfo.references.size();
Reference declaration = referenceInfo.references.get(0);
Reference init = referenceInfo.getInitializingReference();
int... | src/com/google/javascript/jscomp/InlineVariables.java |
Closure-122 | private void handleBlockComment(Comment comment) {
if (comment.getValue().indexOf("/* @") != -1 || comment.getValue().indexOf("\n * @") != -1) {
errorReporter.warning(
SUSPICIOUS_COMMENT_WARNING,
sourceName,
comment.getLineno(), "", 0);
}
}
private void handleBlockComm... | src/com/google/javascript/jscomp/parsing/IRFactory.java |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 4