Class: TypedArray

Inherits:
Array
  • Object
show all
Defined in:
lib/voruby/misc.rb

Overview

An astract array which will only accept objects of a specified type, and optionally enforce a size range.

Direct Known Subclasses

VORuby::ADQL::V1_0::ConstantListSet::LiteralList, VORuby::ADQL::V1_0::From::TableList, VORuby::ADQL::V1_0::GroupBy::ColumnList, VORuby::ADQL::V1_0::JoinTable::ListOfFromTable, VORuby::ADQL::V1_0::OrderExpression::OrderList, VORuby::ADQL::V1_0::SelectionList::ItemList, VORuby::ADQL::V1_0::UserDefinedFunction::ListOfScalarExpression, VORuby::ADQL::V1_0::XMatch::XMatchTableAliasList, VORuby::STC::V1_10::Coords::DoubleArray, VORuby::STC::V1_10::Coords::ListOfCoordinates, VORuby::STC::V1_10::Coords::ListOfPixelCoordinates, VORuby::STC::V1_10::Region::ConstraintList, VORuby::STC::V1_10::Region::PointList, VORuby::STC::V1_10::Region::RegionList, VORuby::STC::V1_10::Region::VertexList, VORuby::STC::V1_10::STC::AstroCoordSystemList, VORuby::STC::V1_10::STC::CatalogEntryLocationType::AstroCoordAreaList, VORuby::STC::V1_10::STC::CatalogEntryLocationType::AstroCoordsList, VORuby::STC::V1_10::STC::CoordAreaList, VORuby::STC::V1_10::STC::CoordFrameList, VORuby::STC::V1_10::STC::CoordIntervalList, VORuby::STC::V1_10::STC::CoordScalarIntervalList, VORuby::STC::V1_10::STC::CoordsList, VORuby::STC::V1_10::STC::GenericCoordFrameList, VORuby::STC::V1_10::STC::PixelCoordFrameList, VORuby::STC::V1_10::STC::PixelCoordSystemList, VORuby::STC::V1_10::STC::PixelCoordsList, VORuby::STC::V1_10::STC::RedshiftIntervalList, VORuby::STC::V1_10::STC::SpectralIntervalList, VORuby::STC::V1_10::STC::StcDescription::CoordSysList, VORuby::STC::V1_10::STC::TimeIntervalList, VORuby::STC::V1_10::STC::VelIntervalList, VORuby::STC::V1_30::AstroCoordSystemList, VORuby::STC::V1_30::AstroCoordsList, VORuby::STC::V1_30::AstroSTCDescriptionType::AstroCoordAreaList, VORuby::STC::V1_30::CoordFrameList, VORuby::STC::V1_30::CoordIntervalList, VORuby::STC::V1_30::ErrorList, VORuby::STC::V1_30::GenCoordinateList, VORuby::STC::V1_30::HalfspaceList, VORuby::STC::V1_30::PixSizeList, VORuby::STC::V1_30::PixelCoordFrameList, VORuby::STC::V1_30::PixelCoordIntervalList, VORuby::STC::V1_30::PixelList, VORuby::STC::V1_30::PixelSpaceType::PixelCoordsList, VORuby::STC::V1_30::PointList, VORuby::STC::V1_30::RedshiftIntervalList, VORuby::STC::V1_30::RegionList, VORuby::STC::V1_30::ResolutionList, VORuby::STC::V1_30::STCCoordinateList::AstroCoordsList, VORuby::STC::V1_30::STCDescriptionType::CoordAreaList, VORuby::STC::V1_30::STCDescriptionType::CoordSysList, VORuby::STC::V1_30::STCDescriptionType::CoordsList, VORuby::STC::V1_30::STCRegionList::RegionList, VORuby::STC::V1_30::SizeList, VORuby::STC::V1_30::SpectralIntervalList, VORuby::STC::V1_30::TimeIntervalList, VORuby::STC::V1_30::Vector2CoordinateType::CError2List, VORuby::STC::V1_30::Vector2CoordinateType::CPixSize2List, VORuby::STC::V1_30::Vector2CoordinateType::CResolution2List, VORuby::STC::V1_30::Vector2CoordinateType::CSize2List, VORuby::STC::V1_30::Vector3CoordinateType::CError3List, VORuby::STC::V1_30::Vector3CoordinateType::CPixSize3List, VORuby::STC::V1_30::Vector3CoordinateType::CResolution3List, VORuby::STC::V1_30::Vector3CoordinateType::CSize3List, VORuby::STC::V1_30::VelocityIntervalList, VORuby::STC::V1_30::VertexList, VORuby::VOEvent::V1_1::Author::StringList, VORuby::VOEvent::V1_1::Citations::EventIVORNList, VORuby::VOEvent::V1_1::ConceptList, VORuby::VOEvent::V1_1::DescriptionList, VORuby::VOEvent::V1_1::GroupList, VORuby::VOEvent::V1_1::InferenceList, VORuby::VOEvent::V1_1::NameList, VORuby::VOEvent::V1_1::ParamList, VORuby::VOEvent::V1_1::ReferenceList, VORuby::VOEvent::V1_1::WhereWhen::ObsDataLocationList, VORuby::VOEvent::V1_1::Who::AuthorList, VORuby::VOEvent::V1_1::Who::DateTimeList, VORuby::VOEvent::V1_1::Who::IVORNList

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Array

#/, #to_homogeneous

Constructor Details

#initialize(args) ⇒ TypedArray

Returns a new instance of TypedArray.



36
37
38
39
40
# File 'lib/voruby/misc.rb', line 36

def initialize(args)
  check_members(args)
  super(args)
  check_length
end

Class Method Details

.maximum_lengthObject



34
# File 'lib/voruby/misc.rb', line 34

def self.maximum_length; nil end

.restricted_toObject



33
# File 'lib/voruby/misc.rb', line 33

def self.restricted_to; nil end

Instance Method Details

#<<(item) ⇒ Object



48
49
50
51
52
# File 'lib/voruby/misc.rb', line 48

def <<(item)
  check_members(item)
  super(item)
  check_length
end

#[]=(i, item) ⇒ Object



42
43
44
45
46
# File 'lib/voruby/misc.rb', line 42

def []=(i, item)
  check_members(item)
  super(i, item)
  check_length
end

#clearObject



66
67
68
69
# File 'lib/voruby/misc.rb', line 66

def clear
  super
  check_length
end

#insert(index, *items) ⇒ Object



60
61
62
63
64
# File 'lib/voruby/misc.rb', line 60

def insert(index, *items)
  check_members(items)
  super(index, *items)
  check_length
end

#replace(items) ⇒ Object



54
55
56
57
58
# File 'lib/voruby/misc.rb', line 54

def replace(items)
  check_members(items)
  super(items)
  check_length
end

#to_sObject



71
72
73
# File 'lib/voruby/misc.rb', line 71

def to_s
  self.collect{ |item| item.to_s }.join(' ')
end