2 * ******************************************************************************
\r
3 * Copyright (C) 2007, International Business Machines Corporation and others.
\r
4 * All Rights Reserved.
\r
5 * ******************************************************************************
\r
7 package com.ibm.icu.dev.tool.tzu;
\r
12 * Represents a path and whether it should be included or excluded.
\r
14 public class IncludePath {
\r
16 * Whether to include or exclude the path represented by this IncludePath.
\r
18 private boolean include;
\r
21 * The path represented by this IncludePath.
\r
26 * Constructs an IncludePath around a file or directory and whether it should be included or
\r
30 * The file / directory to be used.
\r
32 * Whether the file should be included / excluded.
\r
34 public IncludePath(File path, boolean include) {
\r
36 this.include = include;
\r
40 * Returns true if the other object is an IncludePath and the path that both objects represent
\r
41 * are the same. It is not required for both IncludePaths to be included or excluded.
\r
44 * The other IncludePath to compare this one to.
\r
45 * @return Whether the two IncludePaths are considered equal by the criteria above.
\r
47 public boolean equals(Object other) {
\r
48 return !(other instanceof IncludePath) ? false : path.getAbsoluteFile().equals(
\r
49 ((IncludePath) other).path.getAbsoluteFile());
\r
53 * Returns the path of this IncludePath.
\r
55 * @return The path of this IncludePath.
\r
57 public File getPath() {
\r
62 * Returns whether the path is included or not.
\r
64 * @return Whether the path is included or not.
\r
66 public boolean isIncluded() {
\r
71 * Outputs this IncludePath in the form (<b>+</b>|<b>-</b>)<i>pathstring</i>.
\r
73 * @return The IncludePath as a string.
\r
75 public String toString() {
\r
76 return (include ? '+' : '-') + path.toString();
\r