求大神解答,下面这段代码的返回值是什么?

F10huihui11 2012-08-04 11:04:34
public class RuleMatch implements Comparable<RuleMatch> {

private static final Pattern SUGGESTION_PATTERN = Pattern.compile("<suggestion>(.*?)</suggestion>");

private int fromLine = -1;
private int column = -1;
private int offset = -1;
private int endLine = -1;
private int endColumn = -1;

private final Rule rule;
private final int fromPos;
private final int toPos;
private final String message;
private final String shortMessage; // for OOo/LO context menu

private List<String> suggestedReplacements = new ArrayList<String>();

//TODO: remove this one after all rules get their short comments in place
public RuleMatch(Rule rule, int fromPos, int toPos, String message) {
this(rule, fromPos, toPos, message, null, false);
}

// TODO: remove this constructor?
public RuleMatch(Rule rule, int fromPos, int toPos, String message, String shortMessage) {
this(rule, fromPos, toPos, message, shortMessage, false);
}

/**
* Creates a RuleMatch object, taking the rule that triggered
* this match, position of the match and an explanation message.
* This message is scanned for <suggestion>...</suggestion>
* to get suggested fixes for the problem detected by this rule.
*
* @param shortMessage used in OpenOffice/LibreOffice's context menu
* @param startWithUppercase whether the original text at the position
* of the match start with an uppercase character
*/
public RuleMatch(Rule rule, int fromPos, int toPos, String message, String shortMessage,
boolean startWithUppercase) {
this.rule = rule;
this.fromPos = fromPos;
this.toPos = toPos;
this.message = message;
this.shortMessage = shortMessage;
// extract suggestion from <suggestion>...</suggestion> in message:
final Matcher matcher = SUGGESTION_PATTERN.matcher(message);
int pos = 0;
while (matcher.find(pos)) {
pos = matcher.end();
String replacement = matcher.group(1);
if (startWithUppercase) {
replacement = StringTools.uppercaseFirstChar(replacement);
}
suggestedReplacements.add(replacement);
}
}
...全文
72 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
it491328322 2012-08-06
  • 打赏
  • 举报
回复
构造函数无需定义返回值啊。。。
wwwcomcn123 2012-08-05
  • 打赏
  • 举报
回复
哪有返回值啊?不懂
对java有感觉 2012-08-05
  • 打赏
  • 举报
回复
返回0吧 不确定
iGoodLoser 2012-08-04
  • 打赏
  • 举报
回复
这段代码有返回值吗,这里只是定义了一个类,里面有几个重载了的构造方法

51,410

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧