Top Description Inners Fields Constructors Methods
org.apache.poi.poifs.property

public Class DirectoryProperty

extends Property
implements Parent, Iterable<Property>
Class Inheritance
All Implemented Interfaces
java.lang.Iterable, org.apache.poi.poifs.property.Parent, org.apache.poi.poifs.property.Child
Known Direct Subclasses
org.apache.poi.poifs.property.RootProperty
Imports
java.io.IOException, .Serializable, java.util.ArrayList, .Arrays, .Comparator, .HashSet, .Iterator, .List, .Set, .Spliterator

Directory property

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private final List<Property>
_children

List of Property instances

private final Set<String>
_children_names

set of children's names

Inherited from org.apache.poi.poifs.property.Property:
_NO_INDEX_NODE_BLACK_NODE_RED

Constructor Summary

AccessConstructor and Description
public
DirectoryProperty(String
the name of the directory
name
)

Default constructor

protected
DirectoryProperty(final int
index number
index
,
final byte[]
byte data
array
,
final int
offset into byte data
offset
)

reader constructor

Method Summary

Modifier and TypeMethod and Description
public void
addChild(final Property
the new child to be added; must not be null
property
)

Implements org.apache.poi.poifs.property.Parent.addChild.

Add a new child to the collection of children

public boolean

Returns:

true if the name change could be made, else false
changeName
(Property
the Property whose name is being changed
property
,
String
the new name for the Property
newName
)

Change a Property's name

public boolean

Returns:

true if the Property could be deleted, else false
deleteChild
(Property
the Property being deleted
property
)

Delete a Property

public Iterator<Property>

Returns:

Iterator of children; may refer to an empty collection
getChildren
()

Implements org.apache.poi.poifs.property.Parent.getChildren.

Get an iterator over the children of this Parent; all elements are instances of Property.

public boolean

Returns:

true if a directory type Property
isDirectory
()

Implements abstract org.apache.poi.poifs.property.Property.isDirectory.

public Iterator<Property>
iterator()

Implements java.lang.Iterable.iterator.

Get an iterator over the children of this Parent, alias for getChildren() which supports foreach use

protected void
preWrite()

Implements abstract org.apache.poi.poifs.property.Property.preWrite.

Perform whatever activities need to be performed prior to writing

public Spliterator<Property>

Returns:

Spliterator of children; may refer to an empty collection
spliterator
()

Overrides default java.lang.Iterable.spliterator.

Get a spliterator over the children of this Parent; all elements are instances of Property.

Inherited from org.apache.poi.poifs.property.Property:
getChildIndexgetIndexgetNamegetNextChildgetNextChildIndexgetPreviousChildgetPreviousChildIndexgetShortDescriptiongetSizegetStartBlockgetStorageClsidgetViewableArraygetViewableIteratorisSmallisValidIndexpreferArraysetChildPropertysetIndexsetNamesetNextChildsetNodeColorsetPreviousChildsetPropertyTypesetSizesetStartBlocksetStorageClsidshouldUseSmallBlockswriteData

Field Detail

_childrenback to summary
private final List<Property> _children

List of Property instances

_children_namesback to summary
private final Set<String> _children_names

set of children's names

Constructor Detail

DirectoryPropertyback to summary
public DirectoryProperty(String name)

Default constructor

Parameters
name:String

the name of the directory

DirectoryPropertyback to summary
protected DirectoryProperty(final int index, final byte[] array, final int offset)

reader constructor

Parameters
index:int

index number

array:byte[]

byte data

offset:int

offset into byte data

Method Detail

addChildback to summary
public void addChild(final Property property) throws IOException

Implements org.apache.poi.poifs.property.Parent.addChild.

Add a new child to the collection of children

Parameters
property:Property

the new child to be added; must not be null

Exceptions
IOException:
if we already have a child with the same name
changeNameback to summary
public boolean changeName(Property property, String newName)

Change a Property's name

Parameters
property:Property

the Property whose name is being changed

newName:String

the new name for the Property

Returns:boolean

true if the name change could be made, else false

deleteChildback to summary
public boolean deleteChild(Property property)

Delete a Property

Parameters
property:Property

the Property being deleted

Returns:boolean

true if the Property could be deleted, else false

getChildrenback to summary
public Iterator<Property> getChildren()

Implements org.apache.poi.poifs.property.Parent.getChildren.

Get an iterator over the children of this Parent; all elements are instances of Property.

Returns:Iterator<Property>

Iterator of children; may refer to an empty collection

isDirectoryback to summary
public boolean isDirectory()

Implements abstract org.apache.poi.poifs.property.Property.isDirectory.

Returns:boolean

true if a directory type Property

iteratorback to summary
public Iterator<Property> iterator()

Implements java.lang.Iterable.iterator.

Get an iterator over the children of this Parent, alias for getChildren() which supports foreach use

Returns:Iterator<Property>

Doc from java.lang.Iterable.iterator.

an Iterator.

preWriteback to summary
protected void preWrite()

Implements abstract org.apache.poi.poifs.property.Property.preWrite.

Perform whatever activities need to be performed prior to writing

spliteratorback to summary
public Spliterator<Property> spliterator()

Overrides default java.lang.Iterable.spliterator.

Get a spliterator over the children of this Parent; all elements are instances of Property.

Returns:Spliterator<Property>

Spliterator of children; may refer to an empty collection

Annotations
@Override
Since
POI 5.2.0
org.apache.poi.poifs.property back to summary

public Class DirectoryProperty.PropertyComparator

extends Object
implements Comparator<Property>, Serializable
Class Inheritance
  • java.lang.Object
  • org.apache.poi.poifs.property.DirectoryProperty.PropertyComparator
All Implemented Interfaces
java.io.Serializable, java.util.Comparator

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

negative value if o1 < o2, zero if o1 == o2, positive value if o1 > o2.
compare
(Property
first object to compare, better be a Property
o1
,
Property
second object to compare, better be a Property
o2
)

Implements java.util.Comparator.compare.

compare method.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

PropertyComparatorback to summary
public PropertyComparator()

Method Detail

compareback to summary
public int compare(Property o1, Property o2)

Implements java.util.Comparator.compare.

compare method. Assumes both parameters are non-null instances of Property. One property is less than another if its name is shorter than the other property's name. If the names are the same length, the property whose name comes before the other property's name, alphabetically, is less than the other property.

Parameters
o1:Property

first object to compare, better be a Property

o2:Property

second object to compare, better be a Property

Returns:int

negative value if o1 < o2, zero if o1 == o2, positive value if o1 > o2.