aspose.pdf
Class Segments

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList
              extended by aspose.pdf.Segments
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess

public class Segments
extends java.util.ArrayList

Represents a collection of Segment objects.

Typical usages are the following:

[Java] Pdf pdf1 = new Pdf(); Section sec1 = pdf1.getSections().add(); Text text1 = new Text("seg1 "); sec1.getParagraphs().add(text1); Segment seg2 = text1.getSegments().add("seg2"); seg2.getTextInfo().setColor(new Color("Red")); seg2.getTextInfo().setFontSize(16); pdf1.save(....); [XML] <?xml version="1.0" encoding="utf-8" ?> <Pdf xmlns="Aspose.Pdf"> <Section> <Text> <Segment>seg1 </Segment> <Segment Color="Red" FontSize="16">seg2 </Segment> </Text> </Section> </Pdf>

See Also:
Serialized Form

Constructor Summary
Segments()
          Construct a new Segments object.
 
Method Summary
 Segment add()
          Initializes a new instance of the Segment class and add it to the Segments collection
 void add(Segment segment)
          Adds a new Segment object into the collection.
 Segment add(java.lang.String segmentString)
          Initializes a new instance of the Segment class and add it to the Segments collection
 void copyTo(Segment[] segmentArray, int index)
          Copies the elements to a Segment object array, starting at a specified array index.
 Segment getSegment(int index)
          Gets a Segment object from the collection according to Segment index.
 Segment getSegment(java.lang.String segmentID)
          Gets a Segment object from the collection according to Segment ID.
 Text getText()
          Get the parent text object .
 int indexOf(Segment segment)
          Gets the index of a specified Segment object in the collection.
 void insert(int index, Segment segment)
          Inserts a new Segment object into the collection after specified Segment object.
 void insert(Segment segmentToInsertAfter, Segment newSegment)
          Inserts a new Segment object into the collection after specified Segment object.
 void moveAfter(Segment segToMoveAfter, Segments newSegments)
          Move a segment after the other segment .
 void moveAt(int index, Segments newSegments)
          Move a segment identified by index
 void remove(Segment segmentToRemove)
          Removes a Segment object from the collection.
 void setSegment(int index, Segment value)
          Sets a Segment object from the collection according to Segment index.
 void setSegment(java.lang.String segmentID, Segment value)
          Sets a Segment object from the collection according to Segment ID.
 void setText(Text value)
          Set the parent text object .
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

Segments

public Segments()
Construct a new Segments object.

Method Detail

add

public void add(Segment segment)
Adds a new Segment object into the collection.


add

public Segment add(java.lang.String segmentString)
Initializes a new instance of the Segment class and add it to the Segments collection

Parameters:
segmentString - The string content of the segment.
Returns:
The Segment object.

add

public Segment add()
Initializes a new instance of the Segment class and add it to the Segments collection

Returns:
The Segment object.

getText

public Text getText()
Get the parent text object .


setText

public void setText(Text value)
Set the parent text object .


insert

public void insert(int index,
                   Segment segment)
Inserts a new Segment object into the collection after specified Segment object.

Parameters:
index - The Segment object to insert after.
segment - The Segment object to be inserted.

insert

public void insert(Segment segmentToInsertAfter,
                   Segment newSegment)
Inserts a new Segment object into the collection after specified Segment object.

Parameters:
segmentToInsertAfter - The Segment object to insert after
newSegment - The Segment object to be inserted.

remove

public void remove(Segment segmentToRemove)
Removes a Segment object from the collection.

Parameters:
segmentToRemove - The Segment object to be romoved.

moveAt

public void moveAt(int index,
                   Segments newSegments)
Move a segment identified by index

Parameters:
index - the index of the segment.
newSegments - the new segments after moving .

moveAfter

public void moveAfter(Segment segToMoveAfter,
                      Segments newSegments)
Move a segment after the other segment .

Parameters:
segToMoveAfter - the segment to be moved .
newSegments - the new segments after moving.

indexOf

public int indexOf(Segment segment)
Gets the index of a specified Segment object in the collection.

Parameters:
segment - The specified Segment object.
Returns:
The index value.

copyTo

public void copyTo(Segment[] segmentArray,
                   int index)
Copies the elements to a Segment object array, starting at a specified array index.

Parameters:
segmentArray - The Gets or sets a Segment object array.
index - The start index.

getSegment

public Segment getSegment(int index)
Gets a Segment object from the collection according to Segment index.

Parameters:
index -

setSegment

public void setSegment(int index,
                       Segment value)
Sets a Segment object from the collection according to Segment index.

Parameters:
index - the index of the segment
value - the result segment.

getSegment

public Segment getSegment(java.lang.String segmentID)
Gets a Segment object from the collection according to Segment ID.

Parameters:
segmentID - the ID of the segment .

setSegment

public void setSegment(java.lang.String segmentID,
                       Segment value)
Sets a Segment object from the collection according to Segment ID.

Parameters:
segmentID - the ID of segment .
value - the result segment .