Methods Summary |
---|
public boolean | equals(java.lang.Object o)equality. Two POIFSDocumentPath instances are equal if they
have the same number of component Strings, and if each
component String is equal to its coresponding component String
boolean rval = false;
if ((o != null) && (o.getClass() == this.getClass()))
{
if (this == o)
{
rval = true;
}
else
{
POIFSDocumentPath path = ( POIFSDocumentPath ) o;
if (path.components.length == this.components.length)
{
rval = true;
for (int j = 0; j < this.components.length; j++)
{
if (!path.components[ j ]
.equals(this.components[ j ]))
{
rval = false;
break;
}
}
}
}
}
return rval;
|
public java.lang.String | getComponent(int n)get the specified component
return components[ n ];
|
public org.apache.poi.poifs.filesystem.POIFSDocumentPath | getParent()Returns the path's parent or null if this path
is the root path.
final int length = components.length - 1;
if (length < 0)
{
return null;
}
POIFSDocumentPath parent = new POIFSDocumentPath(null);
parent.components = new String[ length ];
System.arraycopy(components, 0, parent.components, 0, length);
return parent;
|
public int | hashCode()calculate and return the hashcode
if (hashcode == 0)
{
for (int j = 0; j < components.length; j++)
{
hashcode += components[ j ].hashCode();
}
}
return hashcode;
|
public int | length()
return components.length;
|
public java.lang.String | toString()Returns a string representation of the path. Components are
separated by the platform-specific file separator.
final StringBuffer b = new StringBuffer();
final int l = length();
b.append(File.separatorChar);
for (int i = 0; i < l; i++)
{
b.append(getComponent(i));
if (i < l - 1)
{
b.append(File.separatorChar);
}
}
return b.toString();
|