Browse Source

Fix javadoc in org.eclipse.jgit fnmatch package

Change-Id: I14384c3bf3c41f8e1c62ec117837c2fc782a832f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
stable-4.10
Matthias Sohn 7 years ago
parent
commit
6c83cc1660
  1. 12
      org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/AbstractHead.java
  2. 8
      org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/CharacterHead.java
  3. 29
      org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/FileNameMatcher.java
  4. 1
      org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/GroupHead.java
  5. 1
      org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/Head.java
  6. 1
      org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/LastHead.java
  7. 2
      org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/RestrictedWildCardHead.java
  8. 1
      org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/WildCardHead.java

12
org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/AbstractHead.java

@ -53,6 +53,13 @@ abstract class AbstractHead implements Head {
private final boolean star; private final boolean star;
/**
* Whether the char matches
*
* @param c
* a char.
* @return whether the char matches
*/
protected abstract boolean matches(char c); protected abstract boolean matches(char c);
AbstractHead(boolean star) { AbstractHead(boolean star) {
@ -60,9 +67,11 @@ abstract class AbstractHead implements Head {
} }
/** /**
* Set {@link org.eclipse.jgit.fnmatch.Head}s which will not be modified.
* *
* @param newHeads * @param newHeads
* a list of {@link Head}s which will not be modified. * a list of {@link org.eclipse.jgit.fnmatch.Head}s which will
* not be modified.
*/ */
public final void setNewHeads(List<Head> newHeads) { public final void setNewHeads(List<Head> newHeads) {
if (this.newHeads != null) if (this.newHeads != null)
@ -70,6 +79,7 @@ abstract class AbstractHead implements Head {
this.newHeads = newHeads; this.newHeads = newHeads;
} }
/** {@inheritDoc} */
@Override @Override
public List<Head> getNextHeads(char c) { public List<Head> getNextHeads(char c) {
if (matches(c)) if (matches(c))

8
org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/CharacterHead.java

@ -47,16 +47,24 @@ package org.eclipse.jgit.fnmatch;
final class CharacterHead extends AbstractHead { final class CharacterHead extends AbstractHead {
private final char expectedCharacter; private final char expectedCharacter;
/**
* Constructor for CharacterHead
*
* @param expectedCharacter
* expected {@code char}
*/
protected CharacterHead(final char expectedCharacter) { protected CharacterHead(final char expectedCharacter) {
super(false); super(false);
this.expectedCharacter = expectedCharacter; this.expectedCharacter = expectedCharacter;
} }
/** {@inheritDoc} */
@Override @Override
protected final boolean matches(final char c) { protected final boolean matches(final char c) {
return c == expectedCharacter; return c == expectedCharacter;
} }
/** {@inheritDoc} */
@Override @Override
public String toString() { public String toString() {
return String.valueOf(expectedCharacter); return String.valueOf(expectedCharacter);

29
org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/FileNameMatcher.java

@ -126,12 +126,14 @@ public class FileNameMatcher {
} }
/** /**
* Constructor for FileNameMatcher
*
* @param patternString * @param patternString
* must contain a pattern which fnmatch would accept. * must contain a pattern which fnmatch would accept.
* @param invalidWildgetCharacter * @param invalidWildgetCharacter
* if this parameter isn't null then this character will not * if this parameter isn't null then this character will not
* match at wildcards(* and ? are wildcards). * match at wildcards(* and ? are wildcards).
* @throws InvalidPatternException * @throws org.eclipse.jgit.errors.InvalidPatternException
* if the patternString contains a invalid fnmatch pattern. * if the patternString contains a invalid fnmatch pattern.
*/ */
public FileNameMatcher(final String patternString, public FileNameMatcher(final String patternString,
@ -141,11 +143,13 @@ public class FileNameMatcher {
} }
/** /**
* A Copy Constructor which creates a new {@link FileNameMatcher} with the * A Copy Constructor which creates a new
* same state and reset point like <code>other</code>. * {@link org.eclipse.jgit.fnmatch.FileNameMatcher} with the same state and
* reset point like <code>other</code>.
* *
* @param other * @param other
* another {@link FileNameMatcher} instance. * another {@link org.eclipse.jgit.fnmatch.FileNameMatcher}
* instance.
*/ */
public FileNameMatcher(FileNameMatcher other) { public FileNameMatcher(FileNameMatcher other) {
this(other.headsStartValue, other.heads); this(other.headsStartValue, other.heads);
@ -347,6 +351,7 @@ public class FileNameMatcher {
} }
/** /**
* Append to the string which is matched against the patterns of this class
* *
* @param stringToMatch * @param stringToMatch
* extends the string which is matched against the patterns of * extends the string which is matched against the patterns of
@ -369,10 +374,13 @@ public class FileNameMatcher {
} }
/** /**
* Create a {@link org.eclipse.jgit.fnmatch.FileNameMatcher} instance which
* uses the same pattern like this matcher, but has the current state of
* this matcher as reset and start point
* *
* @return a {@link FileNameMatcher} instance which uses the same pattern * @return a {@link org.eclipse.jgit.fnmatch.FileNameMatcher} instance which
* like this matcher, but has the current state of this matcher as * uses the same pattern like this matcher, but has the current
* reset and start point. * state of this matcher as reset and start point.
*/ */
public FileNameMatcher createMatcherForSuffix() { public FileNameMatcher createMatcherForSuffix() {
final List<Head> copyOfHeads = new ArrayList<>(heads.size()); final List<Head> copyOfHeads = new ArrayList<>(heads.size());
@ -381,8 +389,9 @@ public class FileNameMatcher {
} }
/** /**
* Whether the matcher matches
* *
* @return true, if the string currently being matched does match. * @return whether the matcher matches
*/ */
public boolean isMatch() { public boolean isMatch() {
if (heads.isEmpty()) if (heads.isEmpty())
@ -400,9 +409,9 @@ public class FileNameMatcher {
} }
/** /**
* Whether a match can be appended
* *
* @return false, if the string being matched will not match when the string * @return a boolean.
* gets extended.
*/ */
public boolean canAppendMatch() { public boolean canAppendMatch() {
for (int i = 0; i < heads.size(); i++) { for (int i = 0; i < heads.size(); i++) {

1
org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/GroupHead.java

@ -130,6 +130,7 @@ final class GroupHead extends AbstractHead {
} }
} }
/** {@inheritDoc} */
@Override @Override
protected final boolean matches(final char c) { protected final boolean matches(final char c) {
for (CharacterPattern pattern : characterClasses) { for (CharacterPattern pattern : characterClasses) {

1
org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/Head.java

@ -48,6 +48,7 @@ import java.util.List;
interface Head { interface Head {
/** /**
* Get the character which decides which heads are returned
* *
* @param c * @param c
* the character which decides which heads are returned. * the character which decides which heads are returned.

1
org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/LastHead.java

@ -56,6 +56,7 @@ final class LastHead implements Head {
// defined because of javadoc and visibility modifier. // defined because of javadoc and visibility modifier.
} }
/** {@inheritDoc} */
@Override @Override
public List<Head> getNextHeads(char c) { public List<Head> getNextHeads(char c) {
return FileNameMatcher.EMPTY_HEAD_LIST; return FileNameMatcher.EMPTY_HEAD_LIST;

2
org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/RestrictedWildCardHead.java

@ -52,11 +52,13 @@ final class RestrictedWildCardHead extends AbstractHead {
this.excludedCharacter = excludedCharacter; this.excludedCharacter = excludedCharacter;
} }
/** {@inheritDoc} */
@Override @Override
protected final boolean matches(final char c) { protected final boolean matches(final char c) {
return c != excludedCharacter; return c != excludedCharacter;
} }
/** {@inheritDoc} */
@Override @Override
public String toString() { public String toString() {
return isStar() ? "*" : "?"; //$NON-NLS-1$ //$NON-NLS-2$ return isStar() ? "*" : "?"; //$NON-NLS-1$ //$NON-NLS-2$

1
org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/WildCardHead.java

@ -49,6 +49,7 @@ final class WildCardHead extends AbstractHead {
super(star); super(star);
} }
/** {@inheritDoc} */
@Override @Override
protected final boolean matches(final char c) { protected final boolean matches(final char c) {
return true; return true;

Loading…
Cancel
Save