Class DataSegment
java.lang.Object
svm.segment.Segment
svm.segment.DataSegment
Data Segment.
Link to GitHub: Source File.
- Author:
- Øystein Myhre Andersen
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe set of values in this DataSegment.Fields inherited from class Segment
ident, segmentKind -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidUtility: Segment dumpvoidUtility: Segment dumpEmit a value by adding it to this DataSegment.Emit the characters in the given StringvoidemitDefaultValue(int size, int repCount) Emit default value by emiting the necessary number of null values.private voidListing utility: List a DataSegment entryload(int index) Load a value from this DataSegment at the given indexReturns the next ObjectAddressofOffset(int ofst) Returns the ObjectAddress with the given offsetstatic DataSegmentreadObject(AttributeInputStream inpt, int segmentKind) Returns a DataSegment read from the given AttributeInputStreamintsize()Returns the size of this DataSegmentvoidStore a value into this DataSegment at the given indextoString()voidwrite(AttributeOutputStream oupt) Writes a Segment to the given output.
-
Field Details
-
values
-
-
Constructor Details
-
DataSegment
DataSegment constructor.- Parameters:
ident- the Segment identsegmentKind- K_SEG_DATA, K_SEG_CONST
-
-
Method Details
-
ofOffset
Returns the ObjectAddress with the given offset- Parameters:
ofst- the offset- Returns:
- the ObjectAddress with the given offset
-
nextAddress
-
size
public int size()Returns the size of this DataSegment- Returns:
- the size of this DataSegment
-
store
Store a value into this DataSegment at the given index- Parameters:
index- the indexvalue- the value
-
load
Load a value from this DataSegment at the given index- Parameters:
index- the index- Returns:
- the value at the given index
-
emit
Emit a value by adding it to this DataSegment.- Parameters:
value- value to be added- Returns:
- the address of the value emitted
-
listData
Listing utility: List a DataSegment entry- Parameters:
indent- indentation Stringidx- index to the value
-
emitDefaultValue
public void emitDefaultValue(int size, int repCount) Emit default value by emiting the necessary number of null values.- Parameters:
size- the value sizerepCount- the repetition count
-
emitChars
Emit the characters in the given String- Parameters:
chars- the String- Returns:
- the address of the first character emitted
-
dump
-
dump
-
toString
-
write
Description copied from class:SegmentWrites a Segment to the given output.- Overrides:
writein classSegment- Parameters:
oupt- the output stream- Throws:
IOException- if IOException occur
-
readObject
Returns a DataSegment read from the given AttributeInputStream- Parameters:
inpt- the AttributeInputStreamsegmentKind- the Segment kind code- Returns:
- a DataSegment read from the given AttributeInputStream
- Throws:
IOException- if IOException occur
-