Package org.openmuc.jdlms
Class SnClassInfo
- java.lang.Object
-
- org.openmuc.jdlms.SnClassInfo
-
- All Implemented Interfaces:
java.io.Serializable
public class SnClassInfo extends java.lang.Object implements java.io.Serializable
Interface class (IC) info used to enable the mapping between attribute or method ID and SN offset. This class is only applicable if SN referencing is used.
-
-
Constructor Summary
Constructors Constructor Description SnClassInfo(int classId, int version, java.util.Collection<SnMemberRange> attributeRanges, java.util.List<SnMemberRange> methodRanges)
Construct a new SN class info.SnClassInfo(int classId, int version, SnMemberRange methodRange)
Construct a new SN class info.SnClassInfo(int classId, int version, SnMemberRange attributeRange, SnMemberRange methodRange)
Construct a new SN class info.SnClassInfo(SnClassVersion snClassVersion, java.util.Collection<SnMemberRange> attributeRanges, java.util.List<SnMemberRange> methodRanges)
Construct a new SN class info.SnClassInfo(SnClassVersion snClassVersion, SnMemberRange methodRange)
Construct a new SN class info.SnClassInfo(SnClassVersion snClassVersion, SnMemberRange attributeRange, SnMemberRange methodRange)
Construct a new SN class info.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
computeAttributeSnOffsetFor(int attributeId)
Compute the short name offset for a given attribute ID.int
computeMethodSnOffsetFor(int methodId)
Compute the short name offset for a given method ID.SnClassVersion
getSnClassVersion()
Get the (class ID, version) tuple.static java.util.Collection<SnClassInfo>
mapIcToClassInfo(java.lang.Class<? extends CosemSnInterfaceObject>... ic)
Construct a collection of SN class info from more or more COSEM SN interface classes.static java.util.Collection<SnClassInfo>
mapIcToClassInfo(java.util.Collection<java.lang.Class<? extends CosemSnInterfaceObject>> ics)
Construct a collection of SN class info from multiple COSEM SN interface classs.java.lang.String
toString()
-
-
-
Constructor Detail
-
SnClassInfo
public SnClassInfo(int classId, int version, SnMemberRange methodRange)
Construct a new SN class info.- Parameters:
classId
- the class ID.version
- the version.methodRange
- the SN offset range in which the methods lie.
-
SnClassInfo
public SnClassInfo(SnClassVersion snClassVersion, SnMemberRange methodRange)
Construct a new SN class info.- Parameters:
snClassVersion
- the (class ID, version) tuple.smethodRange
- the SN offset range in which the methods lie.
-
SnClassInfo
public SnClassInfo(int classId, int version, SnMemberRange attributeRange, SnMemberRange methodRange)
Construct a new SN class info.- Parameters:
classId
- the class ID.version
- the version.attributeRange
- the SN offset range in which the attributes lie.methodRange
- the SN offset range in which the methods lie.
-
SnClassInfo
public SnClassInfo(SnClassVersion snClassVersion, SnMemberRange attributeRange, SnMemberRange methodRange)
Construct a new SN class info.- Parameters:
snClassVersion
- the (class ID, version) tuple.attributeRange
- the SN offset range in which the attributes lie.methodRange
- the SN offset range in which the methods lie.
-
SnClassInfo
public SnClassInfo(int classId, int version, java.util.Collection<SnMemberRange> attributeRanges, java.util.List<SnMemberRange> methodRanges)
Construct a new SN class info.- Parameters:
classId
- the class ID.version
- the version.attributeRanges
- a collection of SN offset range in which the attributes lie.methodRanges
- a collection of the SN offset range in which the methods lie.
-
SnClassInfo
public SnClassInfo(SnClassVersion snClassVersion, java.util.Collection<SnMemberRange> attributeRanges, java.util.List<SnMemberRange> methodRanges)
Construct a new SN class info.- Parameters:
snClassVersion
- the (class ID, version) tuple.attributeRanges
- a collection of SN offset range in which the attributes lie.methodRanges
- a collection of the SN offset range in which the methods lie.
-
-
Method Detail
-
mapIcToClassInfo
@SafeVarargs public static java.util.Collection<SnClassInfo> mapIcToClassInfo(java.lang.Class<? extends CosemSnInterfaceObject>... ic)
Construct a collection of SN class info from more or more COSEM SN interface classes.- Parameters:
ic
- one or multiple SN interface classes.- Returns:
- a collection of SN class infos.
-
mapIcToClassInfo
public static java.util.Collection<SnClassInfo> mapIcToClassInfo(java.util.Collection<java.lang.Class<? extends CosemSnInterfaceObject>> ics)
Construct a collection of SN class info from multiple COSEM SN interface classs.- Parameters:
ics
- one or multiple SN interface classes.- Returns:
- a collection of SN class infos.
-
computeAttributeSnOffsetFor
public int computeAttributeSnOffsetFor(int attributeId)
Compute the short name offset for a given attribute ID.- Parameters:
attributeId
- the ID of the attribute in COSEM class.- Returns:
- the short name offset.
-
computeMethodSnOffsetFor
public int computeMethodSnOffsetFor(int methodId)
Compute the short name offset for a given method ID.- Parameters:
methodId
- the ID of the attribute in COSEM class.- Returns:
- the short name offset.
-
getSnClassVersion
public SnClassVersion getSnClassVersion()
Get the (class ID, version) tuple.- Returns:
- (class ID, version) tuple.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-