VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
END
Attribute VB_Name = "c_javautilHashMap"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'Generated by IDL2VB v099. Copyright (c) 1999 Martin.Both
'Source File Name: jdk1.4/idl/HelloApp/HelloInterface.idl

Option Explicit

'You can use this class as a value example:
' Rename class to c_javautilHashMap and save the file as c_javautilHashMap.cls.
' Finally write your own local value operations.

Implements cOrbAbstractBase
Implements cOrbValueBase
'Implements c_javalangCloneable

'valuetype ::java::util::HashMap
Const sTypeId As String = "RMI:java.util.HashMap:86573568A211C011:0507DAC1C31660D1"

Public fLoadFactor As Single
Public lThreshold As Long
Public lCapacity As Long
Public lSize As Long

'Helper
Private Function cOrbAbstractBase_isObjRef() As Boolean
    cOrbAbstractBase_isObjRef = False
End Function

'Helper to get different COM interface
Friend Function thisOrbValueBase() As cOrbValueBase
    Set thisOrbValueBase = Me
End Function

Private Function cOrbValueBase_UniqueId() As Long
    cOrbValueBase_UniqueId = VBOrb.getNextUniqueID()
End Function

'Helper
Private Sub cOrbValueBase_initByRead(ByVal oIn As cOrbStream)
    On Error GoTo ErrHandler
    'See Custom Marshaling Format of the Java 2 IDL mapping
    Dim CSMVersion As Byte
    Dim defaultWriteObject As Boolean
    CSMVersion = oIn.readOctet()
    defaultWriteObject = oIn.readBoolean()
    If CSMVersion > 1 Then
        Call oIn.readValue(Nothing)
    End If
    fLoadFactor = oIn.readFloat()
    lThreshold = oIn.readLong()
    lCapacity = oIn.readLong()
    lSize = oIn.readLong()
    Dim lCnt As Long
    Dim oTabKey As cOrbValueBase
    Dim oTabVal As cOrbValueBase
    For lCnt = 0 To lSize - 1
        Set oTabKey = oIn.readValue(Nothing)
        Set oTabVal = oIn.readValue(Nothing)
    Next lCnt
    
    Exit Sub
ErrHandler:
    Call VBOrb.ErrReraise(Err, "HashMap.read")
End Sub

'Helper
Private Sub cOrbValueBase_writeMe(ByVal oOut As cOrbStream)
    On Error GoTo ErrHandler
    'See Custom Marshaling Format of the Java 2 IDL mapping
    Call oOut.writeOctet(1)         'Format version 1 or 2
    Call oOut.writeBoolean(True)    'defaultWriteObject() was called
    'Data written by defaultWriteObject()
    'Data written by writeObject() Here are differences between version 1 and 2
    Call oOut.writeFloat(fLoadFactor)
    Call oOut.writeLong(lThreshold)
    Call oOut.writeLong(lCapacity)
    Call oOut.writeLong(lSize)
    
    Exit Sub
ErrHandler:
    Call VBOrb.ErrReraise(Err, "HashMap.write")
End Sub

Private Function cOrbValueBase_getIds(ByVal Item As Integer) As String
    Select Case Item
    Case 0: cOrbValueBase_getIds = sTypeId
    End Select
End Function

Private Function cOrbValueBase_isCustom() As Boolean
    cOrbValueBase_isCustom = True
End Function

Public Sub initToEmpty()
    fLoadFactor = 0.75
    lThreshold = 16
    lCapacity = 16
    lSize = 0
End Sub

