Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSAnnotateBlock.java')
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSAnnotateBlock.java131
1 files changed, 0 insertions, 131 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSAnnotateBlock.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSAnnotateBlock.java
deleted file mode 100644
index c1cfd9036..000000000
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSAnnotateBlock.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.team.internal.ccvs.core;
-import org.eclipse.team.internal.ccvs.core.Policy;
-
-/**
- * Model for a CVS Annotate block.
- */
-public class CVSAnnotateBlock {
-
- String revision = ""; //$NON-NLS-1$
- String user = ""; //$NON-NLS-1$
- int startLine = 0;
- int endLine = 0;
- int sourceOffset = 0;
- boolean valid = false;
-
- /**
- * @return
- */
- public boolean isValid() {
- return valid;
- }
-
- /**
- * @return index of line where source starts.
- */
- public int getSourceOffset() {
- return sourceOffset;
- }
-
- /**
- * @return int the last source line of the receiver
- */
- public int getEndLine() {
- return endLine;
- }
-
- /**
- * @param line
- */
- public void setEndLine(int line) {
- endLine = line;
- }
-
- /**
- * @return the revision the receiver occured in.
- */
- public String getRevision() {
- return revision;
- }
-
- /**
- * @return the first source line number of the receiver
- */
- public int getStartLine() {
- return startLine;
- }
-
-
- /**
- * Parase a CVS Annotate output line and instantiate the receiver
- * @param line a CVS Annotate output line
- */
- public CVSAnnotateBlock(String line, int lineNumber) {
- super();
-
- startLine = lineNumber;
- endLine = lineNumber;
-
- int index = line.indexOf(' ');
- if (index == -1) {
- return;
- }
- revision = line.substring(0, index);
-
- index = line.indexOf("(", index); //$NON-NLS-1$
- if (index == -1) {
- return;
- }
-
- int index2 = line.indexOf(' ', index);
- if (index2 == -1) {
- return;
- }
-
- user = line.substring(index + 1, index2);
-
- index = line.indexOf(":", index2); //$NON-NLS-1$
- if (index == -1) {
- return;
- }
-
- sourceOffset = index + 2;
- valid = true;
- }
-
- /**
- * Used by the default LabelProvider to display objects in a List View
- */
- public String toString() {
- int delta = endLine - startLine + 1;
- String line = Policy.bind("CVSAnnotateBlock.4"); //$NON-NLS-1$
- if (delta == 1) {
- line = Policy.bind("CVSAnnotateBlock.5"); //$NON-NLS-1$
- }
- return Policy.bind("CVSAnnotateBlock.6", new Object[] { //$NON-NLS-1$
- user,
- revision,
- String.valueOf(delta),
- line
- });
- }
-
- /**
- * Answer true if the receiver contains the given line number, false otherwse.
- * @param i a line number
- * @return true if receiver contains a line number.
- */
- public boolean contains(int i) {
- return (i >= startLine && i <= endLine);
- }
-}

Back to the top